@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes popOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8); }
}

.warning-banner {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.956);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: popIn 0.3s ease-out;
}
.warning-banner-content {
    background: #111;
    border: 2px solid #0ff;
    border-radius: 16px;
    padding: 1.5rem;
    width: 90%;
    max-width: 700px;
    max-height: 100vh;
    height: auto;
    overflow-y: auto;
    box-shadow: 0 0 40px #0ff8;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    animation: popIn 0.3s ease-out;
    box-sizing: border-box;
    word-break: break-word;
    color: #fff;
    margin: 2rem 0;
}

.warning-banner h2 {
    color: #0ff;
    margin: 0 0 .5rem 0;
    border-bottom: 1px solid #0ff;
    padding-bottom: 0.5rem;
    width: 100%;
    text-align: center;
}

.warning-banner h3 {
    color: #0ff;
    margin: .5rem 0 0.5rem 0;
    font-size: 1.2em;
}

.warning-banner ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.warning-banner li {
    margin: 0.5rem 0;
    line-height: 1.5;
}
.warning-banner .warning-icon {
    width: 75px;
    height: 75px;
    margin: 0 auto 0.5rem auto;
}

.password-tips {
    width: 100%;
    margin: 1rem 0;
}

.btn-close {
    position: relative; /* Change from absolute to relative */
    margin: 0 auto; /* Center horizontally with auto margins */
    background: linear-gradient(45deg, #00ffff, #0066ff);
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    color: white;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Orbitron', sans-serif;
    z-index: 10;
    overflow: hidden;
    display: block; /* Ensure it's a block element for auto margins to work */
}

.dont-show-again {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-size: 0.9rem;
}

/* Style the checkbox */
.checkbox-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #00ffff;
    border-radius: 3px;
    background: transparent;
    position: relative;
    cursor: pointer;
}

.checkbox-container input[type="checkbox"]:checked {
    background: #00ffff;
}

.checkbox-container input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    color: #000;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-container label {
    cursor: pointer;
}

/* Remove the absolute positioning from the button shine effect */
.btn-close::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    animation: buttonShine 3s infinite;
}

.btn-close:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    animation: buttonPulse 1s infinite;
}


/* Info tooltip styles */
.info-tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-left: 8px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.info-tooltip {
    color: #0ff;
    transition: text-shadow 0.2s ease;
}

.info-tooltip:hover {
    text-shadow: 0 0 8px #0ff;
}

/* Reset for tooltip content */
.info-tooltip .tooltip-text,
.info-tooltip .tooltip-text * {
    text-shadow: none !important;
    color: #fff !important;
}

.info-tooltip .tooltip-text {
    visibility: hidden;
    width: 500px;
    background-color: rgba(17, 17, 17, 0.98);
    color: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 0;
    position: fixed;
    z-index: 1100;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #0ff;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.9em;
    line-height: 1.4;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.password-words-table {
    width: 100%;
    border-collapse: collapse;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.table-scroll {
    overflow-y: auto;
    max-height: 70vh;
    scrollbar-width: thin;
    scrollbar-color: #0ff #0a3d62;
    padding: 1rem;
}

.table-scroll::-webkit-scrollbar {
    width: 8px;
}

.table-scroll::-webkit-scrollbar-track {
    background: #0a3d62;
    border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb {
    background-color: #0ff;
    border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #0dd;
}

.password-words-table .table-header {
    background-color: #0a3d62;
    color: #0ff;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid #0ff;
}

.password-words-table .table-row {
    display: flex;
    border-bottom: 1px solid #1a3a52;
    min-height: 32px;
    align-items: center;
}

.password-words-table .table-row:last-child {
    border-bottom: none;
}

.password-words-table .table-row span {
    flex: 1;
    padding: 6px 8px;
    text-align: center;
    border-right: 1px solid #1a3a52;
    font-family: 'Courier New', monospace;
    color: #f0f0f0;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.password-words-table .table-row span:last-child {
    border-right: none;
}

.password-words-table .table-row:nth-child(even) {
    background-color: #0d1a26;
}

.password-words-table .table-row span:hover {
    background-color: #1a3a52;
    color: #fff;
    cursor: pointer;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Tooltip styles - controlled by JavaScript */
.info-tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: auto;
}

.info-tooltip::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}


.warning-banner p {
    margin: 0;
    font-size: .95em;
    max-width: 800px;
    line-height: 1.5;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* Audio Controls Styling */
/* Audio Controls Styling */
.audio-controls {
  display: none;
  align-items: center;
  gap: 15px;
  height: 45px;
  
  padding: 5px;
  background: linear-gradient(135deg, #0a1120 0%, #0f1724 100%);
  border-radius: 12px;
  border: 2px solid #00ffff;
  box-shadow: 0 4px 15px rgba(0, 255, 255, 0.2);
}

.audio-btn {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #00ffff;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.audio-btn:hover {
  background: rgba(0, 255, 255, 0.1);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.audio-btn:active {
  transform: scale(0.95);
}

.audio-time-display {
  font-family: 'Orbitron', monospace;
  color: #00ffff;
  font-size: 14px;
  font-weight: bold;
  min-width: 45px;
  text-align: center;
  flex-shrink: 0;
}

.audio-progress-container {
  flex: 1;
  position: relative;
  height: 8px;
  width: 15vw;
  min-width: 15vw;
}

.audio-progress-bar {
  width: 100%;
  height: 8px;
  position: absolute;
  top: 0;
  left: 0;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0, 255, 255, 0.2);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.audio-progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 8px;
  border-radius: 50%;
  background: #00ffff;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
  transition: all 0.2s ease;
}

.audio-progress-bar::-moz-range-thumb {
  width: 16px;
  height: 8px;
  border-radius: 50%;
  background: #00ffff;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
  transition: all 0.2s ease;
}

.audio-progress-bar::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

.audio-progress-bar::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  background: linear-gradient(to right, 
    #00ffff 0%, 
    #00ffff var(--progress, 0%), 
    rgba(0, 255, 255, 0.2) var(--progress, 0%), 
    rgba(0, 255, 255, 0.2) 100%);
  border-radius: 4px;
}

/* Remove responsive changes to keep styling the same on mobile */
/* Commenting out previous responsive rules */
/*
@media (max-width: 768px) {
  .audio-controls {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 15px;
  }
  
  .audio-progress-container {
    order: 4;
    flex-basis: 100%;
    margin-top: 5px;
  }
}

@media (max-width: 480px) {
  .audio-btn {
    width: 40px;
    height: 40px;
  }
  
  .audio-time-display {
    font-size: 12px;
    min-width: 40px;
  }
}
*/

/* Video Modal Styles */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(10px);
  padding: 20px;
  box-sizing: border-box;
}

.video-modal-content {
  display: flex;
  position: relative;
  background: #0b1220;
  border: 2px solid #00ffff;
  border-radius: 15px;
  padding: clamp(10px, 3vw, 20px);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
  text-align: center;
  animation: popIn 0.3s ease-out;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: min(95%, 800px);
  height: min(85%, 600px);
  margin: 0 auto;
}

.video-modal-content video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: clamp(10px, 2vh, 15px);
  border: 2px solid #00ffff;
  max-width: min(95vw, 800px);
  max-height: min(70vh, 450px);
}

/* Responsive buttons */
.skip-btn,
.video-tutorial-btn {
  border: none;
  padding: clamp(8px, 2vw, 12px) clamp(16px, 4vw, 28px);
  border-radius: 25px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-top: clamp(10px, 2vh, 15px);
  font-size: clamp(12px, 3vw, 16px);
}

.skip-btn {
  background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
  color: white;
}

.video-tutorial-btn {
  background: linear-gradient(45deg, #6beeff, #8efffd);
  color: rgb(0, 0, 0);
}

/* Hover effects only on devices that support hover */
@media (hover: hover) {
  .skip-btn:hover {
    background: linear-gradient(45deg, #ff5252, #ff7979);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
  }
  
  .video-tutorial-btn:hover {
    background: linear-gradient(45deg, #6beeff, #8efffd);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107, 245, 255, 0.4);
  }
}

/* Mobile-specific adjustments */
@media (max-width: 767px) {
  .video-modal {
    padding: 10px;
  }
  
  .video-modal-content {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }
  
  /* Stack buttons vertically on mobile */
  .skip-btn,
  .video-tutorial-btn {
    width: 100%;
    max-width: 200px;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
  .video-modal-content {
    width: 80%;
    height: 75%;
  }
}

/* Large screens */
@media (min-width: 1200px) {
  .video-modal-content {
    width: 50%;
    height: 75%;
  }
}

body {
    font-family: 'Orbitron';
    background-color: #000;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #00ffff;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    overflow-y: auto;
}

/* Tooltip styles */
@keyframes popInOut {
    0% { 
        opacity: 0; 
        transform: scale(0.8) translateY(5px);
    }
    20% { 
        opacity: 1; 
        transform: scale(1.05) translateY(0);
    }
    40% {
        transform: scale(0.95);
    }
    60% {
        transform: scale(1.02);
    }
    80% { 
        opacity: 1; 
        transform: scale(1);
    }
    100% { 
        opacity: 0; 
        transform: scale(0.9);
    }
}

/* Input field styles */
input[type="text"] {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #b2ebf2;
    border-radius: 6px;
    padding: 6px 10px;
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
    outline: none;
}

input[type="text"]:focus {
    border-color: #00ffff;
    box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.2);
    background-color: rgba(0, 0, 0, 0.3);
}

/* Tooltip element */
#character-limit-tooltip {
    position: absolute;
    background: #ff4444;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10000;
    pointer-events: none;
    animation: popInOut 2s ease-in-out forwards;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Error state for input fields */
.input-error {
    border-color: #ff4444 !important;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.6) !important;
}

.container {
    width: 100%;
    max-width: 1000px;
    min-height: 100vh;
}

.header {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #0ff;
    border-radius: 10px;
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 50px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    animation: glow 2s infinite alternate;
    position: relative;
    overflow: hidden;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.header-title {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    position: relative;
    animation: glitch 5s infinite;
}

.header-title::before,
.header-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.header-title::before {
    color: #00ffff;
    z-index: -1;
    animation: glitch-effect 5s infinite;
}

.header-title::after {
    color: #f0f;
    z-index: -2;
    animation: glitch-effect 5s infinite reverse;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.card {
    background: #000000b3;
    /* box-shadow: 0 0 20px rgba(0, 255, 255, 0.3); */
    animation: glowsoon 2s infinite alternate;
    position: relative;
    overflow: hidden;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    border: 2px solid #0ff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 175px;
    height: auto;
    min-width: 108px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Scanline overlay hidden by default */
.card::after {
    content: "";
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 200%;
    background: linear-gradient(to bottom, rgba(0,255,255,0.1) 0%, transparent 50%, rgba(0,255,255,0.1) 100%);
    transform: translateY(-100%);
    pointer-events: auto;
    opacity: 0;
}

.card:hover::after {
    animation: scanlinecard 3s linear forwards infinite;
    opacity: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
.card:not(.coming-soon):hover {
    cursor: pointer;
}

.card[data-difficulty="easy"] {
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.5);
    border-color: rgba(0, 255, 0, 0.3);
    animation: glowEasy 2s infinite alternate;
}

.card[data-difficulty="easy"]:hover::after {
    animation: scanlineeasy 3s linear forwards infinite;
}

.card[data-difficulty="medium"] {
    box-shadow: 0 0 25px rgba(235, 149, 0, 0.5);
    border-color: rgba(235, 149, 0, 0.3);
    animation: glowMedium 2s infinite alternate;
}

.card[data-difficulty="medium"]:hover::after {
    animation: scanlinemedium 3s linear forwards infinite;
}

.card[data-difficulty="hard"] {
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.5);
    border-color: rgba(255, 0, 0, 0.3);
    animation: glowHard 2s infinite alternate;
}

.card[data-difficulty="hard"]:hover::after {
    animation: scanlinehard 3s linear forwards infinite;
}

.mini-canvas {
    width: 75%;
    height: 75%;
    display: block;
    background: transparent;
    object-fit: contain;
}


.card h2 {
    margin: 0 0 15px 0;
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: 1px;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    position: relative;
}

/* Remove always-on glitch on h2 */
.card h2::before,
.card h2::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.card h2::before {
    color: rgb(255, 255, 255);
    z-index: -1;
}

.card h2::after {
    color: rgb(136, 136, 136);
    z-index: -2;
}

/* Only glitch animation on hover */
.card:hover h2,
.card:hover h2::before,
.card:hover h2::after {
    animation: glitch-effect 5s infinite;
}

.card[data-difficulty="easy"] h2,
.card[data-difficulty="easy"] h2::before,
.card[data-difficulty="easy"] h2::after {
    text-shadow: 0 0 10px rgb(0, 255, 26);
    color: rgb(0, 255, 26);
}

.card[data-difficulty="medium"] h2,
.card[data-difficulty="medium"] h2::before,
.card[data-difficulty="medium"] h2::after {
    text-shadow: 0 0 10px rgb(235, 149, 0);
    color: rgb(235, 149, 0);
}

.card[data-difficulty="hard"] h2,
.card[data-difficulty="hard"] h2::before,
.card[data-difficulty="hard"] h2::after {
    text-shadow: 0 0 10px rgb(255, 0, 0);
    color: rgb(255, 0, 0);
}

.coming-soon {
    background: linear-gradient(45deg, #495057, #6c757d);
    cursor: not-allowed;
    border: 2px solid #6c757d;
}

.coming-soon h2 {
    color: #adb5bd;
    text-shadow: 0 0 10px #adb5bd;
}

.coming-soon h2::before,
.coming-soon h2::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.coming-soon h2::before {
    color: #0ff;
    z-index: -1;
}

.coming-soon h2::after {
    color: #f0f;
    z-index: -2;
}

/* Base style */
.modal-title h2 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: 1px;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    position: relative;
}

/* Glitch pseudo-elements */
.modal-title h2::before,
.modal-title h2::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.modal-title h2::before {
    color: #0ff;
    z-index: -1;
}

.modal-title h2::after {
    color: #f0f;
    z-index: -2;
}

/* Always-on glitch animation */
.modal-title h2,
.modal-title h2::before,
.modal-title h2::after {
    animation: glitch-effect 5s infinite;
}




/* .coming-soon .lock-icon {
    filter: grayscale(80%);
} */

.help-button {
    position: fixed;
    bottom: 1rem;
    left: 2rem;
    border: none;
    font-size: 1.25em;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    z-index: 10;
    overflow: hidden;
}

.back-button-tech {
    position: fixed;
    top: 1rem;
    left: 1rem;
    /* background: linear-gradient(45deg, #00ffff, #0066ff); */
    background: rgba(0, 0, 0, 0.9);
    border: none;
    padding: 10px 20px;
    font-size: .5em;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Orbitron', sans-serif;
    z-index: 10;
    overflow: hidden;
    border: 2px solid #00ffff;
    text-decoration: none;
}

.back-button-tech::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: buttonShine 3s infinite;
}

.back-button-tech:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    animation: buttonPulse 1s infinite;
}

@keyframes glow {
    from { box-shadow: 0 0 10px rgba(0, 255, 255, 0.3); }
    to { box-shadow: 0 0 20px rgba(0, 255, 255, 0.6); }
}

@keyframes glowsoon {
    from { box-shadow: 0 0 10px rgba(167, 167, 167, 0.3); }
    to { box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); }
}


@keyframes glowHard {
    from { box-shadow: 0 0 10px rgba(252, 101, 101, 0.3); }
    to { box-shadow: 0 0 20px rgba(255, 0, 0, 0.6); }
}

@keyframes glowMedium {
    from { box-shadow: 0 0 10px rgba(255, 181, 102, 0.3); }
    to { box-shadow: 0 0 20px rgba(255, 132, 0, 0.6); }
}

@keyframes glowEasy {
    from { box-shadow: 0 0 10px rgba(112, 255, 119, 0.3); }
    to { box-shadow: 0 0 20px rgba(0, 255, 13, 0.6); }
}

@keyframes scanlinecard {
    0% {
        transform: translateY(-100%);
        opacity: 0;
        height: 2px;
    }
    2% {
        opacity: 1;
        height: 4px;
        box-shadow: 0 0 20px #000000;
    }
    90% {
        opacity: 1;
        height: 4px;
    }
    95% {
        opacity: 0.2;
        height: 8px;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
        height: 2px;
    }
}

@keyframes scanlineeasy {
    0% {
        transform: translateY(-100%);
        opacity: 0;
        height: 2px;
    }
    2% {
        opacity: 1;
        height: 4px;
        box-shadow: 0 0 20px rgb(0, 255, 21);
    }
    90% {
        opacity: 1;
        height: 4px;
    }
    95% {
        opacity: 0.2;
        height: 8px;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
        height: 2px;
    }
}

@keyframes scanlinemedium {
    0% {
        transform: translateY(-100%);
        opacity: 0;
        height: 2px;
    }
    2% {
        opacity: 1;
        height: 4px;
        box-shadow: 0 0 20px rgb(235, 149, 0);
    }
    90% {
        opacity: 1;
        height: 4px;
    }
    95% {
        opacity: 0.2;
        height: 8px;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
        height: 2px;
    }
}

@keyframes scanlinehard {
    0% {
        transform: translateY(-100%);
        opacity: 0;
        height: 2px;
    }
    2% {
        opacity: 1;
        height: 4px;
        box-shadow: 0 0 20px rgb(255, 0, 0);
    }
    90% {
        opacity: 1;
        height: 4px;
    }
    95% {
        opacity: 0.2;
        height: 8px;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
        height: 2px;
    }
}

@keyframes flicker {
    0% { opacity: 0.5; }
    50% { opacity: 0.7; }
    100% { opacity: 0.5; }
}

@keyframes textFlicker {
    0%, 100% { 
        opacity: 1;
        transform: translateY(0);
    }
    50% { 
        opacity: 0.95;
        transform: translateY(1px);
    }
}

@keyframes glitch-effect {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes buttonShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

@keyframes buttonPulse {
    0% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.8); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 255, 1); }
    100% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.8); }
}

@keyframes dotGlow {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

@keyframes glitch {
    0% { text-shadow: 2px 0 #0ff, -2px 0 #f0f; }
    20% { text-shadow: -2px 0 #0ff, 2px 0 #f0f; }
    40% { text-shadow: 2px 0 #0ff, -2px 0 #f0f; }
    60% { text-shadow: -2px 0 #0ff, 2px 0 #f0f; }
    80% { text-shadow: 2px 0 #0ff, -2px 0 #f0f; }
    100% { text-shadow: -2px 0 #0ff, 2px 0 #f0f; }
}

.card-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    overflow: hidden;
    /* overflow-y: auto; */
}

/* Limit modal content width and allow text wrapping */
.card-modal-content {
  background: #111;
  border: 2px solid #0ff;
  border-radius: 16px;
  padding: 1rem;
  width: 600px;
  max-width: 90vw; /* Responsive width */
    overflow-y: auto; /* Scroll inside modal if needed */
    height: 700px;
  box-shadow: 0 0 40px #0ff8;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: popIn 0.3s;
  box-sizing: border-box;
  word-break: break-word;

  scrollbar-width: none;
  -ms-overflow-style: none;
}
.card-modal-content::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Modal description styling */
.modal-description {
    white-space: normal;
    font-size: .95em;
    word-break: break-word;
    overflow-wrap: break-word;
    color: #fff;
    margin-bottom: .5em;
    text-align: justify;
}

.card-modal-close {
    position: absolute;
    top: 5px;
    right: 15px;
    font-size: 2rem;
    color: #0ff;
    cursor: pointer;
    z-index: 1000;
    animation: popOut 0.3s;
}

@keyframes popIn {
    from { transform: 0; opacity: 0; }
    to   { transform: 0; opacity: 1; }
}
@keyframes popOut {
    from { transform: 0; opacity: 1; }
    to   { transform: 0; opacity: 0; }
}

.modal-title {
    color: #0ff;
    font-size: 2em;
    margin-bottom: 0.1em;
    margin-top: 0.8em;
    text-align: center;
}



.canvas-container {
    margin: 20px auto;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}
#renderCanvas {
    height: 400px;
    width: 100%;
    display: block;
    cursor: grab;
    border-radius: 12px;
    pointer-events: none;
}
/*Caesar Cipher Styling */

/* Caesar Canvas Styles */
.caesar-canvas {
    width: 98%;
    height: 300px;
    display: block;
    margin: 10px auto;
    outline: 2px solid #00ffff;
    border-radius: 5px;
    padding: 5px;
    background: transparent;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* Caesar Input Group Styles */
.caesar-input-group {
    width: fit-content;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
    padding: 12px;
    border-radius: 10px;
    z-index: 10;
    flex-wrap: wrap;
}

.input-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.caesar-label {
    font-size: 14px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
    margin-bottom: 2px;
    font-family: 'Orbitron', sans-serif;
}

.caesar-textbox {
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 8px 12px;
    color: #00ffff;
    background-color: #111;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Orbitron';
    min-width: 100px;
    width: 100px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.caesar-textbox:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.caesar-slider {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: #1a1a1a;
    border: 1px solid #00ffff;
    outline: none;
    accent-color: #00ffff;
}

.caesar-slider-value {
    color: #00ffff;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    font-family: 'Orbitron', sans-serif;
}

.ascii-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.ascii-toggle-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.ascii-label {
    font-size: 12px;
    font-weight: normal;
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
}

.ascii-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #00ffff;
    background-color: #000;
}

.ascii-note {
    font-size: 12px;
    color: #00ffff;
    font-style: italic;
    margin: 2px 0 0 0;
    font-family: 'Orbitron', sans-serif;
}

.caesar-mode-select {
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 5px;
    color: #00ffff;
    background-color: #000;
    font-size: 14px;
    font-weight: bold;
    width: 120px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
}

.caesar-mode-select:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.caesar-mode-select option {
    background-color: #000;
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
}


/* Style the Caesar slider to match your theme */
.slider-container input[type="range"] {
  accent-color: #00ffff; /* Modern browsers, quick theming */
  width: 200px;
  height: 4px;
  background: #63ffff;
  border-radius: 5px;
  outline: none;
  /* Remove default styles for a more custom look */
}


/* For more advanced custom styling (cross-browser):
.slider-container input[type="range"]::-webkit-slider-thumb {
  background: #00ffff;
  border: 2px solid #15162e;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.slider-container input[type="range"]::-moz-range-thumb {
  background: #00ffff;
  border: 2px solid #15162e;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.slider-container input[type="range"]::-ms-thumb {
  background: #00ffff;
  border: 2px solid #15162e;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  cursor: pointer;
} */

/* Caesar Cipher Bubble Styles */
.caesar-shift-bubble {
    position: absolute;
    top: 20px;
    right: 20px;
    /* cursor: move; */
    user-select: none;
    z-index: 1000;
    
    /* Bubble background and styling */
    background: #111;
    border: 2px solid #00ffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: 280px;
    max-width: 320px;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.caesar-shift-bubble.dragging {
    opacity: 0.9;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.7);
    border-color: #00ff88;
}

.caesar-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #334155;
    cursor: move;
}

.caesar-bubble-title {
    font-size: 16px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.caesar-minimize-button {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #00ffff;
    color: #00ffff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.5);
}

.caesar-minimize-button:hover {
    background: rgba(0, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.caesar-bubble-formula-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.caesar-formula-container {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #00ffff;
    transition: border-color 0.3s ease;
}

.caesar-formula-label {
    font-size: 12px;
    color: #00ffff;
    margin-bottom: 6px;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.3);
}

.caesar-formula {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-align: center;
    letter-spacing: 1px;
    font-weight: bold;
}

.caesar-formula-encrypt {
    color: #00ff88;
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

.caesar-formula-decrypt {
    color: #ff6666;
    text-shadow: 0 0 6px rgba(255, 102, 102, 0.4);
}

.caesar-bubble-example {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed #00ffff;
}

.caesar-example-title {
    font-size: 12px;
    color: #00ffff;
    margin-bottom: 8px;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.3);
}

.caesar-example-content {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #ffffff;
    line-height: 1.6;
}

.caesar-bubble-legend {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #334155;
    line-height: 1.4;
}

.caesar-bubble-legend strong {
    color: #00ffff;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.3);
}



/* Vigenère Table Styling */

/* Vigenère Canvas Styles */
.vigenere-canvas {
    width: 98%;
    height: 200px;
    display: block;
    margin: 10px auto;
    outline: 2px solid #00ffff;
    border-radius: 5px;
    padding: 5px;
    background: transparent;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}
.vig-table {
    border-collapse: collapse;
    margin: 0 auto;
    font-family: 'Orbitron';
    font-size: 1rem;
    background: #000000;
    box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
    border-radius: 12px;
    /* overflow: hidden; */
}

.vig-table th, .vig-table td {
    border: 1px solid #00e1ff;
    padding: 5px 6px;
    text-align: center;
    min-width: 28px;
    transition: all 0.3s ease;
}

.vig-table th {
    background: #000000;
    color: #00ffff;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.vig-table tr:nth-child(even) td {
    background: #000;
    color: #00ffff;
}

.vig-table tr:nth-child(odd) td {
    background: #000;
    color: #00ffff;
}

.vig-table td:first-child {
    background: #000;
    color: #00ffff;
    font-weight: bold;
}

/* Vigenère Table Animations */
.cell-reveal {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
    animation: cellReveal 0.6s ease-out forwards;
}

@keyframes cellReveal {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    70% {
        opacity: 0.8;
        transform: scale(1.05) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Column highlight */
.vig-table th.highlight-col,
.vig-table td.highlight-col {
    background: #4fffff !important;
    border-right: 3px solid #00bcd4 !important;
    border-left: 3px solid #00bcd4 !important;
    color: #000 !important;
    animation: highlightPulse 2s ease-in-out infinite;
}

/* Row highlight via <tr class="highlight-row"> */
.vig-table tr.highlight-row td,
.vig-table tr.highlight-row td:first-child {
    background: #4fffff !important;
    border-top: 3px solid #00bcd4 !important;
    border-bottom: 3px solid #00bcd4 !important;
    color: #000 !important;
    animation: highlightPulse 2s ease-in-out infinite;
}

/* Row + column intersection */
.vig-table tr.highlight-row td.highlight-col {
    background: #b0ffff !important;
    color: #000 !important;
    font-weight: bold;
    animation: intensePulse 1.5s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    }
}

@keyframes intensePulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 1);
    }
}

/* Decrypt mode adjustments: move strong intersection emphasis to the column header */
.decrypt-mode .vig-table tr.highlight-row td.highlight-col {
    background: #4fffff !important;
    color: #000 !important;
    font-weight: 600;
}

.decrypt-mode .vig-table th.highlight-col {
    background: #b0ffff !important;
    color: #000 !important;
    border-bottom: 3px solid #00bcd4 !important;
    box-shadow: 0 0 0 2px #00bcd4 inset;
    font-weight: 800;
}

/* Hide scrollbars but keep scrolling functionality */
.vigenere-scroll-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.vigenere-scroll-container::-webkit-scrollbar {
    display: none;
}

/* Vigenère Controls Styles */
.vig-controls {
    margin-top: 24px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: row;
    gap: 32px;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
    flex-wrap: wrap;
}

.vig-input-group {
    display: flex;
    align-items: left;
    gap: 4px;
    flex-direction: column;
}

.vig-label {
    font-size: 1rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
    font-family: 'Orbitron';
}

.vig-textbox {
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 8px 12px;
    color: #00ffff;
    background-color: #000;
    font-size: 1rem;
    font-weight: bold;
    font-family: 'Orbitron';
    min-width: 100px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
    width: 100px;
}

.vig-textbox:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.vig-mode-select {
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 5px;
    color: #00ffff;
    background-color: #000;
    font-size: 1rem;
    font-weight: bold;
    width: 120px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
}

.vig-mode-select:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.vig-mode-select option {
    background-color: #000;
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
}

.vig-button-group {
    display: flex;
    align-items: center;
}

.pauseplay-btn {
    background: #000;
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 8px 16px;
    color: #00ffff;
    font-size: 1rem;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.5);
}

.pauseplay-btn:hover {
    background: #00ffff;
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
    transform: scale(1.05);
}

.pauseplay-btn:active {
    transform: scale(0.95);
}

/* Comic Bubble Styles */
#key-bubble {
    position: absolute;
    top: 50%;
    left: -40px;
    transform: translateY(-50%);
    background: #000;
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 8px 12px;
    font-family: 'Orbitron';
    font-size: 14px;
    font-weight: bold;
    color: #00ffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1000;
    text-align: center;
    animation: bubbleAppear 0.3s ease-out;
}

#key-bubble::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #00ffff;
}

#key-bubble::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 7px solid #00ffff;
}

#plaintext-bubble {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 8px 12px;
    font-family: 'Orbitron';
    font-size: 14px;
    font-weight: bold;
    color: #00ffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1000;
    text-align: center;
    animation: bubbleAppear 0.3s ease-out;
}

#plaintext-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #00ffff;
}

#plaintext-bubble::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #00ffff;
}

#ciphertext-bubble {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #00ffff;
    border: 2px solid #000;
    border-radius: 5px;
    padding: 8px 12px;
    font-family: 'Orbitron';
    font-size: 14px;
    font-weight: bold;
    color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1000;
    text-align: center;
    animation: bubbleAppear 0.3s ease-out;
}

#ciphertext-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #000;
}

#ciphertext-bubble::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #000;
}

.ciphertext-bubble .bubble-letter {
    font-weight: bold;
    font-family: 'Orbitron';
    color: #000;
    font-size: 16px;
    margin-top: 2px;
}

.plaintext-bubble .bubble-letter {
    font-weight: bold;
    font-family: 'Orbitron';
    color: #00ffff;
    font-size: 16px;
    margin-top: 2px;
}

@keyframes bubbleAppear {
    0% { 
        opacity: 0; 
        transform: scale(0.8) translateY(-50%); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1) translateY(-50%); 
    }
}

/* Vigenère Keystream Styles */
.vigenere-keystream {
    margin: 5px auto;
    padding: 5px;
    border: 1px solid #00ffff;
    border-radius: 5px;
    background-color: #001a1a;
    color: #00ffff;
    font-family: monospace;
    font-size: 16px;
    text-align: center;
    min-height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

.keystream-label {
    font-weight: bold;
    margin-right: 10px;
    color: #4fffff;
}

.keystream-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    align-items: center;
}

.keystream-char {
    padding: 2px 4px;
    border-radius: 3px;
    min-width: 20px;
    text-align: center;
    display: inline-block;
}

.keystream-char.non-letter {
    color: #666;
    background-color: transparent;
}

.keystream-char.key-char {
    background-color: #003333;
    color: #00ffff;
    border: 1px solid #00ffff;
    font-weight: normal;
}

.keystream-char.key-char.highlighted {
    background-color: #4fffff;
    color: #000000;
    border: 2px solid #00ffff;
    font-weight: bold;
}

.keystream-separator {
    margin: 0 2px;
}

.keystream-placeholder {
    color: #666;
    font-style: italic;
}

/* Vigenère Controls Styles */
.vigenere-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
    margin-top: 10px;
}

.vigenere-input-group {
    display: flex;
    align-items: left;
    gap: 10px;
}

.vigenere-label {
    color: #00ffff;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}

.vigenere-textbox {
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 5px;
    color: #00ffff;
    background-color: #000000;
    font-size: 14px;
    font-weight: bold;
    width: 120px;
}

.vigenere-select {
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 5px;
    color: #00ffff;
    background-color: #000000;
    font-size: 14px;
    font-weight: bold;
    width: 120px;
}

.vigenere-button-group {
    display: flex;
    gap: 10px;
}

.pauseplay-btn {
    background-color: #000;
    color: #00ffff;
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pauseplay-btn:hover {
    background-color: #4fffff;
    border-color: #000;
    border: 2px solid #000;
}

/* Canvas Styles */

/* Table Container */
#vigenere-table {
    margin: 0 auto;
    width: fit-content;
}

/* Vigenère Bubble Styles */
.vigenere-shift-bubble {
    position: absolute;
    top: 60px;
    right: 20px;
    user-select: none;
    z-index: 1000;
    
    /* Bubble background and styling */
    background: #111;
    border: 2px solid #00ffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: 280px;
    max-width: 320px;
    animation: popIn 0.3s ease-out;
}

.vigenere-shift-bubble.dragging {
    opacity: 0.9;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.7);
    border-color: #00ff88;
}

.vigenere-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #334155;
    cursor: move;
}

.vigenere-bubble-title {
    font-size: 16px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.vigenere-minimize-button {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #00ffff;
    color: #00ffff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.5);
}

.vigenere-minimize-button:hover {
    background: rgba(0, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.vigenere-bubble-formula-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.vigenere-formula-container {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #00ffff;
    transition: border-color 0.3s ease;
}

.vigenere-formula-label {
    font-size: 12px;
    color: #00ffff;
    margin-bottom: 6px;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.3);
}

.vigenere-formula {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-align: center;
    letter-spacing: 1px;
    font-weight: bold;
}

.vigenere-formula-encrypt {
    color: #00ff88;
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

.vigenere-formula-decrypt {
    color: #ff6666;
    text-shadow: 0 0 6px rgba(255, 102, 102, 0.4);
}

.key-repeat-section {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #00ffff;
    margin-bottom: 10px;
}

.key-repeat-title {
    font-size: 11px;
    color: #00ffff;
    margin-bottom: 4px;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.3);
}

.key-repeat-content {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #ffffff;
    line-height: 1.4;
}

.vigenere-bubble-example {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed #00ffff;
}

.vigenere-example-title {
    font-size: 12px;
    color: #00ffff;
    margin-bottom: 8px;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.3);
}

.vigenere-example-content {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #ffffff;
    line-height: 1.6;
}

.vigenere-bubble-legend {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #334155;
    line-height: 1.4;
}

.vigenere-bubble-legend strong {
    color: #00ffff;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.3);
}


/* Transposition Styles */
/* Transposition Cipher Styles */
.trans-input-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.trans-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trans-label {
    font-size: 14px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
    font-family: 'Orbitron';
}

.trans-textbox {
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 8px 12px;
    color: #00ffff;
    background-color: #000000;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Orbitron';
    min-width: 100px;
    width: 100px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.trans-textbox:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.pad-toggle-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.pad-label {
    font-size: 10px;
    color: #00ffff;
    font-family: 'Orbitron';
}

.pad-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #00ffff;
    background-color: #000;
}

.trans-text-container {
    color: #00ffff;
    font-family: 'Orbitron';
    font-size: 16px;
    white-space: pre-wrap;
    padding: 8px;
    border: 1px solid #00ffff;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
}

.trans-mode-select {
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 5px;
    color: #00ffff;
    background-color: #000000;
    font-size: 14px;
    font-weight: bold;
    width: 100px;
    font-family: 'Orbitron';
    cursor: pointer;
}

.trans-mode-select:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.trans-mode-select option {
    background-color: #000;
    color: #00ffff;
    font-family: 'Orbitron';
}

.display-text-value {
    font-family: 'Orbitron';
    font-weight: bold;
    color: #00ff88;
}


/* AES Styles */
/* AES Visualizer Styles */
.aes-main-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    flex-direction: column;
}

.aes-input-container {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    flex-direction: row;
}

.aes-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aes-label {
    font-size: 14px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
    font-family: 'Orbitron', sans-serif;
}

.aes-textbox {
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 8px 12px;
    color: #00ffff;
    background-color: #000000;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    width: 100px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.aes-textbox:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.aes-mode-select, .aes-type-select {
    border: 2px solid #00ffff;
    border-radius: 5px;
    padding: 5px;
    color: #00ffff;
    background-color: #000000;
    font-size: 14px;
    font-weight: bold;
    width: 100px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
}

.aes-mode-select:focus, .aes-type-select:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.aes-mode-select option, .aes-type-select option {
    background-color: #000;
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
}

.aes-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
}

.aes-button-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.aes-example-btn {
    background: transparent;
    border: 1px solid #00ffff;
    color: #00ffff;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s ease;
}

.aes-example-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.aes-generate-btn {
    background: #00ffff;
    color: #000;
    border: 1px solid #00ffff;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s ease;
}

.aes-generate-btn:hover {
    background: #00ff88;
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.7);
}

.aes-visualizer {
    align-items: center;
    width: 100%;
    height: 100%;
}

.aes-container-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-direction: row;
    gap: 20px;
}

.aes-step-controls {
    display: flex;
    align-items: center;
    gap: 35px;
    padding: 5px;
    width: fit-content;
    background-color: transparent;
    border-radius: 10px;
}

.aes-step-btn {
    background: transparent;
    border: 1px solid #00ffff;
    color: #00ffff;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s ease;
}

.aes-step-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.aes-step-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.aes-step-info {
    color: #94a3b8;
    font-size: 14px;
    flex: wrap;
}

.round-stage-display {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px;
    background-color: #0a1120;
    border-radius: 8px;
    width: fit-content;
}

.round-stage-label {
    color: #00ffff;
    font-size: 14px;
    font-family: 'Orbitron', sans-serif;
}

.round-stage-value {
    color: #00ffff;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
}

.matrices-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
}

.state-panel, .key-panel {
    width: 245px;
    background-color: #0f1724;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #00ffff;
    /* box-shadow: 0 0 15px rgba(0, 255, 255, 0.2); */
}

.panel-header {
    margin-bottom: 10px;
}

.panel-label {
    color: #00ffff;
    font-weight: bold;
    font-size: 14px;
    font-family: 'Orbitron', sans-serif;
}

.panel-note {
    color: #94a3b8;
    font-size: 12px;
    font-family: 'Orbitron', sans-serif;
    display: none;
}

.state-matrix, .round-key-matrix {
    display: grid;
    grid-template-columns: repeat(4, 50px);
    grid-template-rows: repeat(4, 40px);
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background-color: #06101a;
    border: 1px solid #0a3361;
}

.matrix-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a1a2a;
    border: 1px solid #0a3361;
    border-radius: 4px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.matrix-cell.active {
    background: #00ffff;
    color: #000;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
}

.matrix-cell.changed {
    background: #00ff88;
    color: #000;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.7);
}

.log-panel {
    background-color: #0f1724;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.log-label {
    color: #00ffff;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 14px;
    font-family: 'Orbitron', sans-serif;
}

.aes-log {
    max-height: 120px;
    overflow: auto;
    padding: 10px;
    background-color: #05101a;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #cfeff3;
    border: 1px solid #0a3361;
}

/* Hide scrollbar for log */
.aes-log::-webkit-scrollbar {
    width: 6px;
}

.aes-log::-webkit-scrollbar-track {
    background: #0a1a2a;
    border-radius: 3px;
}

.aes-log::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 3px;
}

.cipher-out {
    padding: 10px;
    background-color: transparent;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    color: #00ffff;
    text-align: center;
    font-size: 14px;
    /* border: 1px solid #00ffff; */
    margin: 10px 0;
}
.aes-matrix-cell, .aes-roundkey-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1220;
    border-radius: 6px;
    font-weight: 700;
    font-family: monospace;
    color: #9FEFF7;
    font-size: 14px;
    transition: all 0.3s ease;
}
/* .aes-roundkey-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1220;
    border-radius: 6px;
    font-weight: 700;
    font-family: monospace;
    color: #9FEFF7;
    font-size: 12px;
    padding: 4px;
    transition: all 0.3s ease;
} */
 

/* Key Expansion Bubble Styles */
.key-expansion-bubble {
    position: absolute;
    top: 100px;
    right: 20px;
    user-select: none;
    z-index: 1000;
    
    /* Bubble background and styling - matching Caesar */
    background: #111;
    border: 2px solid #00ffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: 280px;
    max-width: 320px;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.key-expansion-bubble.dragging {
    opacity: 0.9;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.7);
    border-color: #00ff88;
}

.key-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #334155;
    cursor: move;
}

.key-bubble-title {
    font-size: 16px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.key-minimize-button {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #00ffff;
    color: #00ffff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.5);
}

.key-minimize-button:hover {
    background: rgba(0, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.key-expansion-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.key-step-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #00ffff;
    transition: border-color 0.3s ease;
}

.key-step-section:hover {
    border-color: #00ff88;
}

.key-step-title {
    font-size: 12px;
    color: #00ffff;
    margin-bottom: 8px;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.3);
}

.key-step-content {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #ffffff;
    line-height: 1.6;
    margin-bottom: 8px;
}

.key-word-grid {
    display: grid;
    gap: 6px;
    margin: 8px 0;
}

/* 128-bit: 4 words */
.key-word-grid:has(.key-word-cell:nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

/* 192-bit: 6 words */  
.key-word-grid:has(.key-word-cell:nth-child(6):last-child) {
    grid-template-columns: repeat(3, 1fr);
}

/* 256-bit: 8 words */
.key-word-grid:has(.key-word-cell:nth-child(8):last-child) {
    grid-template-columns: repeat(4, 1fr);
}

.key-word-cell {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #0a3361;
    border-radius: 4px;
    padding: 6px 4px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #00ffff;
    font-weight: bold;
    transition: all 0.3s ease;
}

.key-word-cell.active {
    background: #00ffff;
    color: #000;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

.key-word-cell.changed {
    background: #00ff88;
    color: #000;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    transform: scale(1.05);
}

.key-step-explanation {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    padding: 10px;
    border: 1px dashed #00ffff;
    margin-bottom: 10px;
}

.step-highlight {
    color: #00ff88;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
}

.rcon-value {
    color: #ff6666;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(255, 102, 102, 0.3);
}

/* Custom scrollbar for content if needed */
.key-expansion-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.key-expansion-content::-webkit-scrollbar {
    width: 6px;
}

.key-expansion-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.key-expansion-content::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 3px;
}

.key-expansion-content::-webkit-scrollbar-thumb:hover {
    background: #00ff88;
}

/* Legend section matching Caesar style */
.key-bubble-legend {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #334155;
    line-height: 1.4;
}

.key-bubble-legend strong {
    color: #00ffff;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.3);
}

/* Formula containers matching Caesar style */
.key-formula-container {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #00ffff;
    transition: border-color 0.3s ease;
}

.key-formula-label {
    font-size: 12px;
    color: #00ffff;
    margin-bottom: 6px;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.3);
}

.key-formula {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    text-align: center;
    letter-spacing: 1px;
    font-weight: bold;
    color: #00ff88;
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}