  :root {
    --bg: #0f0e17;
    --surface: #1a1828;
    --surface2: #252338;
    --accent: #4361ee;
    --accent2: #ffd60a;
    --green: #06d6a0;
    --red: #ef233c;
    --text: #fffffe;
    --text-muted: #a7a9be;
    --radius: 16px;
    --border-color: rgba(255, 255, 255, 0.2);
  }

  [data-theme="light"] {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface2: #e4e6eb;
    --accent: #3a86ff;
    --accent2: #f59e0b;
    --green: #10b981;
    --red: #ef4444;
    --text: #1c1e21;
    --text-muted: #65676b;
    --border-color: rgba(0, 0, 0, 0.15);
  }

  [data-theme="light"] body {
    background-image: radial-gradient(ellipse at 20% 50%, #e0e7ff 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, #dbeafe 0%, transparent 50%);
  }

  [data-theme="light"] .word-card {
    border: 2px solid var(--border-color);
  }

  [data-theme="light"] .word-card::before {
    display: none;
  }

  [data-theme="light"] .lb-item.top-1 {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #f59e0b;
  }

  [data-theme="light"] .lb-item.top-2 {
    background: linear-gradient(135deg, #f9fafb, #e5e7eb);
    border-color: #9ca3af;
  }

  [data-theme="light"] .lb-item.top-3 {
    background: linear-gradient(135deg, #fff7ed, #fed7aa);
    border-color: #f97316;
  }

  [data-theme="light"] .lb-item.is-me {
    background: linear-gradient(135deg, #fffbeb, #fef9c3);
    border-color: #f59e0b;
  }

  [data-theme="light"] .card {
    border: 1px solid rgba(0, 0, 0, 0.08);
  }

  [data-theme="light"] .matching-mode-banner {
    background: linear-gradient(135deg, rgba(58, 134, 255, 0.12), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  }

  [data-theme="light"] .matching-column {
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  }

  [data-theme="light"] .matching-card {
    border: 2px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  }

  [data-theme="light"] .matching-card:hover {
    border-color: rgba(58, 134, 255, 0.55);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  }

  [data-theme="light"] .matching-card.selected {
    border-color: var(--accent2);
    background: rgba(245, 158, 11, 0.08);
  }

  [data-theme="light"] .matching-column:first-child .matching-card.selected {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
  }

  [data-theme="light"] .matching-column:last-child .matching-card.selected {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
  }

  [data-theme="light"] .matching-card.matched {
    background: #ffffff;
  }

  [data-theme="light"] .nav-tabs,
  [data-theme="light"] .filter-btn {
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 2px solid rgba(0, 0, 0, 0.12)
  }

  /* ─── THEME SWITCH ─── */
  .theme-switch-wrapper {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface2);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
  }

  .theme-toggle:hover {
    border-color: var(--accent);
    transform: scale(1.1);
  }

  .theme-toggle svg {
    position: absolute;
    transition: transform 0.4s cubic-bezier(0.45, 0.05, 0.55, 0.95), opacity 0.3s ease;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 16px;
    background-image: radial-gradient(ellipse at 20% 50%, #1e1a3a 0%, transparent 60%),
      radial-gradient(ellipse at 80% 20%, #1a2a1a 0%, transparent 50%);
    overscroll-behavior: none;
  }

  .app {
    width: 100%;
    max-width: 480px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px auto 16px auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    width: fit-content;
    user-select: none;
  }

  .app-footer:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: var(--text);
  }

  .app-footer .teacher-name {
    color: var(--accent);
    font-weight: 900;
  }

  .theme-toggle .sun-icon {
    opacity: 0;
    transform: translateY(100%) rotate(45deg);
  }

  .theme-toggle .moon-icon {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }

  [data-theme="light"] .theme-toggle .sun-icon {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }

  [data-theme="light"] .theme-toggle .moon-icon {
    opacity: 0;
    transform: translateY(-100%) rotate(-45deg);
  }

  /* ─── SCREENS ─── */
  .screen {
    display: none;
  }

  .screen.active {
    display: block;
  }

  /* ─── LOGIN ─── */
  .logo {
    text-align: center;
    margin-bottom: 32px;
  }

  .logo-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 8px;
  }

  .logo-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
  }

  .logo-icon-item {
    font-size: 40px;
    animation: float 3s ease-in-out infinite;
  }

  @keyframes float {

    0%,
    100% {
      transform: translateY(0);
    }

    50% {
      transform: translateY(-8px);
    }
  }

  .logo h1 {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
  }

  .card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    border: 2px solid var(--border-color);
  }

  #screen-login .card,
  #screen-post-login-choice .card,
  #screen-achievements .card {
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
  }

  .form-group select,
  .form-group input[type="text"],
  .form-group input[type="password"] {
    width: 100%;
    background: var(--surface2);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 16px;
    outline: none;
    transition: .4s;
    -webkit-appearance: none;
    appearance: none;
  }

  .form-group select:focus,
  .form-group input:focus {
    border-color: var(--accent);
  }

  .form-group select option {
    background: #1a1828;
  }

  .btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.02em;
  }

  .btn:active {
    transform: scale(0.97);
  }

  .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.2);
    transform: none !important;
  }

  .btn-primary {
    background: linear-gradient(135deg, var(--accent), #4895ef);
    color: white;
    box-shadow: 0 4px 24px rgba(67, 97, 238, 0.4);
  }

  .btn-primary:hover {
    box-shadow: 0 6px 32px rgba(67, 97, 238, 0.55);
  }

  .btn-green {
    background: #06d6a0 !important;
    background: linear-gradient(135deg, #06d6a0, #05b386) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 20px rgba(6, 214, 160, 0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .btn-green:hover {
    box-shadow: 0 6px 28px rgba(6, 214, 160, 0.45);
    background: #05b386 !important;
    background: linear-gradient(135deg, #05b386, #048a68) !important;
    transform: translateY(-2px);
    color: #ffffff !important;
  }

  .btn-green:active {
    transform: translateY(0) scale(0.98);
  }

  .btn-skip {
    background: var(--surface2);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
  }

  .btn-guest {
    border-width: 2px;
    font-weight: 700;
    background-color: #4dabf7; /* İstenilen orta tonlu açık mavi */
    border-color: #4dabf7;
    color: white;
  }

  .btn-guest:hover {
    background-color: #3b9adb; /* Üzerine gelince biraz koyulaşsın */
    border-color: #3b9adb;
    color: white;
  }

  .btn-logout {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.25);
  }

  .btn-logout:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 6px 28px rgba(239, 68, 68, 0.35);
    color: #ffffff;
  }

  .btn-pulse {
    background: linear-gradient(90deg, var(--accent), #4895ef, var(--accent));
    background-size: 200% 200%;
    color: white;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 0 25px rgba(67, 97, 238, 0.6);
    animation: gradient-pulse 2s ease infinite;
  }

  @keyframes gradient-pulse {
    0% {
      background-position: 0% 50%;
      transform: scale(1);
    }

    50% {
      background-position: 100% 50%;
      transform: scale(1.05);
    }

    100% {
      background-position: 0% 50%;
      transform: scale(1);
    }
  }

  .quiz-actions {
    display: flex;
    gap: 10px;
  }

  .quiz-actions #btn-pass {
    flex: 1;
    margin-top: 0;
  }

  .quiz-actions #btn-check {
    flex: 2;
  }

  /* ─── QUIZ ─── */
  .quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }

  .player-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 700;
  }

  .player-badge .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
  }

  .avatar-image,
  .lb-avatar-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
  }

  .score-badge {
    background: var(--surface);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 800;
    color: var(--accent2);
    font-family: 'Space Mono', monospace;
  }

  .streak-pill,
  .streak-banner {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.01em;
    border: 1px solid rgba(255, 214, 10, 0.25);
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.16), rgba(67, 97, 238, 0.12));
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  }

  .streak-pill {
    cursor: pointer;
  }

  .streak-pill {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .streak-info-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 14, 23, 0.35);
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
    flex-shrink: 0;
  }

  .streak-info-btn:hover {
    transform: scale(1.08);
    background: rgba(15, 14, 23, 0.5);
    border-color: rgba(255, 255, 255, 0.8);
  }

  .streak-info-btn:active {
    transform: scale(0.96);
  }

  .streak-pill-icon,
  .streak-banner-icon {
    font-size: 15px;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(255, 214, 10, 0.35));
  }

  .streak-banner {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    margin-bottom: 14px;
    text-align: center;
    cursor: pointer;
  }

  .streak-pill-compact {
    display: flex;
    width: fit-content;
    margin: 0 auto 14px auto;
    padding: 8px 12px;
    flex: 0 0 auto;
    justify-content: center;
  }

  .streak-banner-text {
    font-size: 14px;
    font-weight: 900;
  }

  .streak-popover {
    position: fixed;
    z-index: 9999;
    max-width: 280px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
    font-size: 13px;
    line-height: 1.45;
  }

  .streak-popover strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
  }

  .progress-bar {
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    margin-bottom: 28px;
    overflow: hidden;
  }

  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 3px;
    transition: width 0.4s ease;
  }

  .word-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 28px 24px;
    padding-bottom: 52px;
    text-align: center;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
  }

  .word-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.12), transparent 70%);
    border-radius: 50%;
  }

  .word-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 12px;
  }

  .word-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
  }

  .english-word-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
    position: relative;
    max-width: 100%;
    white-space: nowrap;
    flex-wrap: nowrap;
  }

  .quiz-word-canvas {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    height: 72px;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
  }

  .english-word-container.notranslate,
  .english-word-container[translate="no"] {
    -webkit-user-select: none;
    user-select: none;
  }

  .btn-speak {
    background: var(--surface2);
    border: 2px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex: 0 0 auto;
  }

  .btn-speak:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(72, 149, 239, 0.3);
  }

  .btn-speak:active {
    transform: translateY(0) scale(0.95);
  }

  .btn-speak svg {
    width: 22px;
    height: 22px;
  }

  .btn-speak.btn-speak-active {
    animation: speak-pulse 0.8s ease-out;
    border-color: var(--accent);
    color: var(--accent);
    background: var(--surface2);
    /* Arka planın ezilmesini önle */
  }

  @keyframes speak-pulse {
    0% {
      transform: scale(1);
      box-shadow: 0 0 0 0 rgba(72, 149, 239, 0.7);
    }

    50% {
      transform: scale(1.15);
      box-shadow: 0 0 0 15px rgba(72, 149, 239, 0);
    }

    100% {
      transform: scale(1);
      box-shadow: 0 0 0 0 rgba(72, 149, 239, 0);
    }
  }

  .word-counter {
    position: absolute;
    bottom: 17px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 700;
  }

  .card-score {
    position: absolute;
    bottom: 14px;
    right: 24px;
    font-family: 'Space Mono', monospace;
    font-weight: 800;
    font-size: 22px;
    color: var(--green);
    display: flex;
    align-items: baseline;
    gap: 4px;
  }

  .card-score .score-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
  }

  .score-popup {
    position: fixed;
    font-family: 'Space Mono', monospace;
    font-weight: 900;
    font-size: 32px;
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: popupFloat 1.2s ease-out forwards;
  }

  @keyframes popupFloat {
    0% {
      opacity: 0;
      transform: translate(-50%, 0);
    }

    20% {
      opacity: 1;
      transform: translate(-50%, -15px);
    }

    100% {
      opacity: 0;
      transform: translate(-50%, -60px);
    }
  }

  .timer-circle-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
  }

  .timer-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    transition: font-size 0.3s;
  }

  .timer-svg {
    transform: scaleX(-1) rotate(-90deg);
  }

  .timer-circle .timer-bg {
    fill: none;
    stroke: var(--surface2);
    stroke-width: 9;
  }

  .timer-circle .timer-path-remaining {
    fill: none;
    stroke-width: 9;
    stroke-linecap: round;
    stroke: var(--green);
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
    stroke-dasharray: 283;
    /* 2 * PI * 45 */
    stroke-dashoffset: 0;
  }

  .timeup-message {
    font-family: 'Space Mono', monospace;
    font-size: 32px;
    font-weight: 900;
    color: var(--red);
    margin: 0 auto 20px;
    height: 90px;
    display: none;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 15px rgba(239, 35, 60, 0.5);
  }

  @keyframes pulse {
    0% {
      opacity: 1;
    }

    50% {
      opacity: 0.7;
    }

    100% {
      opacity: 1;
    }
  }

  .feedback-strip {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    display: none;
    animation: slideIn 0.25s ease;
  }

  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .feedback-strip.correct {
    background: rgba(6, 214, 160, 0.15);
    border: 1px solid rgba(6, 214, 160, 0.3);
    color: var(--green);
    display: block;
  }

  .feedback-strip.wrong {
    background: rgba(239, 35, 60, 0.15);
    border: 1px solid rgba(239, 35, 60, 0.3);
    color: var(--red);
    display: block;
  }

  .btn-flashcard {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.24);
  }

  .btn-flashcard:hover {
    background: linear-gradient(135deg, #fbbf24, #fb923c);
    box-shadow: 0 6px 28px rgba(249, 115, 22, 0.34);
    transform: translateY(-2px);
  }

  .answer-area {
    margin-bottom: 16px;
  }

  .answer-input-wrap {
    position: relative;
    width: 100%;
  }

  .answer-input {
    width: 100%;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 20px;
    font-weight: 700;
    padding: 16px 20px;
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
    display: block;
    box-sizing: border-box;
    padding-right: 66px;
  }

  .answer-input:focus {
    border-color: var(--accent);
  }

  .answer-input.correct-anim {
    border-color: var(--green);
    background: rgba(6, 214, 160, 0.08);
  }

  .answer-input.wrong-anim {
    border-color: var(--red);
    animation: shake 0.4s ease;
    width: 100%;
    background: rgba(239, 35, 60, 0.05);
  }

  .answer-clear-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    min-width: 42px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--surface2);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    padding: 0 14px;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  .answer-clear-btn:hover {
    background: var(--surface);
    color: var(--text);
    border-color: rgba(72, 149, 239, 0.45);
    transform: translateY(-50%) scale(1.03);
  }

  .answer-clear-btn:active {
    transform: translateY(-50%) scale(0.96);
  }

  .flashcard-area {
    margin: 14px 0 12px;
  }

  .flashcard-options {
    display: grid;
    gap: 10px;
  }

  .flashcard-options.flashcard-options-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flashcard-options.flashcard-options-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  @media (max-width: 540px) {
    .flashcard-options.flashcard-options-cols-4 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .flashcard-options.flashcard-options-cols-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
    }

    .flashcard-options.flashcard-options-cols-3 .flashcard-option {
      min-height: 56px;
      padding: 10px 6px;
      font-size: clamp(11px, 2.8vw, 14px);
      border-radius: 12px;
    }
  }

  .flashcard-option {
    min-height: 68px;
    padding: 14px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(15px, 3vw, 18px);
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
    word-break: break-word;
  }

  .flashcard-option:hover {
    transform: translateY(-1px);
    border-color: rgba(72, 149, 239, 0.45);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
  }

  .flashcard-option.correct {
    border-color: var(--green);
    background: rgba(6, 214, 160, 0.12);
    box-shadow: 0 0 0 2px rgba(6, 214, 160, 0.10);
  }

  .flashcard-option.wrong {
    border-color: var(--red);
    background: rgba(239, 35, 60, 0.10);
    animation: shake 0.4s ease;
  }

  .flashcard-option.disabled {
    pointer-events: none;
    opacity: 0.82;
  }

  @keyframes shake {

    0%,
    100% {
      transform: translateX(0);
    }

    20%,
    60% {
      transform: translateX(-6px);
    }

    40%,
    80% {
      transform: translateX(6px);
    }
  }

  .mistake-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 14px;
  }

  .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface2);
    transition: background 0.2s;
  }

  .dot.filled {
    background: var(--red);
  }

  /* ─── LEADERBOARD ─── */
  .lb-header {
    text-align: center;
    margin-bottom: 24px;
  }

  .lb-header h2 {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 4px;
  }

  .lb-header p {
    color: var(--text-muted);
    font-size: 14px;
  }

  .lb-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  /* Misafir liderlik tablosu kategori filtrelerinin kaydırılabilir olmak yerine sığdığı kadar yan yana durmasını sağlar */
  #guest-lb-filter-btns {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .lb-filter::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: var(--surface2);
    color: var(--text-muted);
    transition: all 0.2s;
  }

  .filter-btn.active {
    background: var(--accent);
    color: white;
  }

  .lb-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
  }

  .lb-list::-webkit-scrollbar {
    width: 4px;
  }

  .lb-list::-webkit-scrollbar-track {
    background: transparent;
  }

  .lb-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
  }

  .lb-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border-radius: 14px;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    transition: transform 0.15s;
    cursor: pointer;
  }

  .lb-item:hover {
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  }

  .lb-item:active {
    transform: scale(0.99);
  }

  .lb-item.top-1 {
    border-color: rgba(255, 214, 10, 0.3);
    background: linear-gradient(135deg, #1f1c30, #252038);
  }

  .lb-item.is-me {
    border-color: var(--accent2);
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.05), rgba(255, 214, 10, 0.15));
  }

  .lb-item.top-2 {
    border-color: rgba(192, 192, 192, 0.2);
  }

  .lb-item.top-3 {
    border-color: rgba(205, 127, 50, 0.2);
  }

  .rank {
    font-family: 'Space Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
  }

  .rank.gold {
    color: var(--green);
  }

  .rank.silver {
    color: #c0c0c0;
  }

  .rank.bronze {
    color: #cd7f32;
  }

  .lb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: var(--surface2);
  }

  .lb-avatar-fallback {
    background: linear-gradient(135deg, rgba(72, 149, 239, 0.18), rgba(6, 214, 160, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .lb-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .lb-name,
  .lb-name-btn {
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lb-name-btn {
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    padding: 0;
    text-align: left;
    width: fit-content;
    max-width: 100%;
    font-family: inherit;
  }

  .lb-name-btn:hover {
    color: var(--accent);
  }

  .lb-badge-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    min-height: 18px;
  }

  .lb-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    font-size: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text);
  }

  [data-theme="light"] .lb-badge-icon {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.04);
  }

  .lb-badge-empty {
    font-size: 11px;
    color: var(--text-muted);
  }

  .lb-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
  }

  .lb-score {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
    flex-shrink: 0;
  }

  .nav-tabs {
    display: flex;
    background: var(--surface2);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
  }

  .avatar-preview-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
  }

  .avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(72, 149, 239, 0.16), rgba(6, 214, 160, 0.16));
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 24px 50px rgba(0,0,0,0.18);
  }

  .avatar-preview.has-selection {
    border-color: rgba(6, 214, 160, 0.95);
    box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.18), 0 24px 50px rgba(0,0,0,0.22);
  }

  .avatar-preview-fallback {
    font-size: 52px;
    line-height: 1;
  }

  .avatar-preview-emoji {
    font-size: 50px;
    font-weight: 900;
    letter-spacing: 0;
  }

  .avatar-preview-caption {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 700;
    text-align: center;
  }

  .avatar-helper-text {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
  }

  .post-login-choice-profile {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 10px 0 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  [data-theme="light"] .post-login-choice-profile {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .post-login-choice-profile .post-login-choice-avatar {
    margin: 0;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  [data-theme="light"] .post-login-choice-profile .post-login-choice-avatar {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .post-login-choice-profile-content {
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    justify-content: center;
  }

  .post-login-avatar-btn {
    flex: 0 0 auto;
    width: fit-content;
    min-width: 0;
    height: 50px;
    min-height: 50px;
    border-radius: 16px;
    padding: 0 16px;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    line-height: 1.12;
    font-size: 15px;
    letter-spacing: 0.01em;
    background: #4dabf7 !important;
    background-color: #4dabf7 !important;
    color: #ffffff !important;
    border: 1px solid #4dabf7 !important;
    box-shadow: none !important;
  }

  .post-login-avatar-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
  }

  .btn.btn-blue.post-login-avatar-btn {
    background: #4dabf7 !important;
    background-color: #4dabf7 !important;
    border-color: #4dabf7 !important;
    color: #ffffff !important;
    box-shadow: none !important;
  }

  .btn.btn-blue.post-login-avatar-btn:hover {
    background: #3b9adb !important;
    background-color: #3b9adb !important;
    color: #ffffff !important;
  }

  .post-login-choice-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .post-login-choice-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    position: relative;
    padding-inline: 10px;
  }

  .post-login-choice-actions-grid::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 50%;
    width: 1px;
    transform: translateX(-0.5px);
    background: var(--border-color);
    opacity: 0.9;
    pointer-events: none;
  }

  .post-login-choice-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0;
  }

  .post-login-choice-preview {
    width: 92px;
    height: 92px;
    border-radius: 24px;
    border: 2px solid var(--border-color);
    background: var(--surface2);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
  }

  [data-theme="light"] .post-login-choice-preview {
    border-color: rgba(0, 0, 0, 0.14);
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  }

  .post-login-choice-preview .avatar-preview-fallback,
  .post-login-choice-preview .avatar-image,
  .post-login-choice-preview .avatar-preview-emoji {
    border-radius: 22px;
  }

  #screen-post-login-choice .post-login-choice-actions .btn {
    min-height: 56px;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.1;
    white-space: normal;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    font-size: 16px;
    font-weight: 800;
  }

  #screen-post-login-choice .btn-skip {
    background: var(--surface2);
  }

  #screen-post-login-choice .btn-skip:hover {
    background: var(--surface);
  }

  #screen-post-login-choice .post-login-choice-actions .btn:hover {
    transform: translateY(-2px);
  }

  #screen-post-login-choice .btn-green:hover,
  #screen-post-login-choice .btn-blue:hover,
  #screen-post-login-choice .btn-lightblue:hover,
  #screen-post-login-choice .btn-skip:hover,
  #screen-post-login-choice .btn-logout:hover {
    background: var(--surface);
    color: var(--text);
  }

  #screen-post-login-choice .btn-green {
    background: var(--surface2);
  }

  #screen-post-login-choice .btn-green:hover {
    background: var(--surface);
  }

  #screen-post-login-choice .btn-logout {
    justify-content: center;
    text-align: center;
    background: #e63946 !important;
    border-color: #e63946;
    color: #ffffff;
  }

  #screen-post-login-choice .btn-logout:hover {
    background: #d62839 !important;
  }

  #screen-post-login-choice .btn-logout-standalone {
    width: 100%;
  }

  #screen-post-login-choice .btn-skip:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(1);
    transform: none !important;
    background: var(--surface2) !important;
    color: var(--text-muted) !important;
  }

  .matching-mode-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
    justify-content: center;
  }

  .matching-mode-choice-card {
    border-radius: 20px;
    padding: 18px 20px;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 210px;
    align-items: center;
    text-align: center;
  }

  .matching-choice-card {
    min-height: 226px;
  }

  .matching-choice-card p {
    min-height: 96px;
    display: block;
  }

  .mode-desc-list {
    width: 100%;
    max-width: 320px;
    min-height: 96px;
    margin: 0;
    padding: 0 0 0 18px;
    text-align: left;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.55;
  }

  .flashcard-choice-card .mode-desc-list {
    min-height: 120px;
  }

  .mode-info-panel {
    width: 100%;
    max-width: 320px;
    padding: 18px 14px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    justify-content: center;
  }

  [data-theme="light"] .mode-info-panel {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.1);
  }

  .mode-daily-status-box {
    max-width: 320px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    margin-top: 0;
  }

  [data-theme="light"] .mode-daily-status-box {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.1);
  }

  .mode-desc-list li + li {
    margin-top: 6px;
  }

  .mode-daily-status {
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .mode-daily-label {
    width: 100%;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
    line-height: 1.35;
  }

  .mode-daily-label strong {
    color: var(--green);
    font-weight: 900;
  }

  .mode-daily-leds {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }

  .mode-daily-led-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }

  .mode-daily-led {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border-color);
    flex: 0 0 auto;
  }

  .mode-daily-led.filled {
    background: var(--green);
    border-color: var(--green);
    box-shadow: 0 0 10px rgba(6, 214, 160, 0.28);
  }

  .mode-daily-leds-empty {
    min-height: 14px;
  }

  .mode-daily-empty {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
  }

  .mode-choice-footer {
    width: 100%;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 0;
  }

  .matching-choice-card .flashcard-mode-badge {
    margin-bottom: 4px;
  }

  .flashcard-choice-card {
    min-height: 240px;
  }

  .flashcard-choice-normal p {
    margin-top: auto;
    margin-bottom: auto;
  }

  .flashcard-mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
  }

  .flashcard-mode-badge-normal {
    background: rgba(77, 171, 247, 0.12);
    border: 1px solid rgba(77, 171, 247, 0.3);
    color: var(--text);
  }

  .flashcard-mode-badge-fast {
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: var(--text);
  }

  .matching-mode-badge-relax {
    background: rgba(67, 97, 238, 0.12);
    border: 1px solid rgba(67, 97, 238, 0.3);
    color: var(--text);
  }

  .matching-mode-badge-timed {
    background: rgba(6, 214, 160, 0.12);
    border: 1px solid rgba(6, 214, 160, 0.3);
    color: var(--text);
  }

  .matching-highlight-timed {
    color: #16d39a;
    font-weight: 900;
  }

  .matching-positive-timed {
    color: #14b87a;
    font-weight: 900;
  }

  .matching-danger-relax {
    color: #ef4444;
    font-weight: 900;
  }

  .matching-positive-relax {
    color: #4dabf7;
    font-weight: 900;
  }

  .matching-mode-choice-timed {
    border-color: rgba(6, 214, 160, 0.35);
  }

  .matching-mode-choice-relax {
    border-color: rgba(67, 97, 238, 0.35);
  }

  .btn-timed {
    background: linear-gradient(135deg, #00c896, #0ea5a8);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(6, 214, 160, 0.24);
  }

  .btn-timed:hover {
    background: linear-gradient(135deg, #11d5a0, #14b8a6);
    box-shadow: 0 6px 24px rgba(6, 214, 160, 0.34);
    transform: translateY(-2px);
  }

  .btn-relax {
    background: linear-gradient(135deg, #5b7cfa, #4361ee);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(67, 97, 238, 0.24);
  }

  .matching-mode-choice-card .btn-full {
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.01em;
    margin-top: 0;
  }

  .flashcard-choice-card .btn-full {
    min-height: 50px;
  }

  .flashcard-choice-start-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    min-height: 58px;
    width: 100%;
    line-height: 1.05;
    white-space: normal;
  }

  .flashcard-choice-start-btn span {
    display: block;
  }

  .btn-relax:hover {
    background: linear-gradient(135deg, #6b8cff, #5a6ff0);
    box-shadow: 0 6px 24px rgba(67, 97, 238, 0.34);
    transform: translateY(-2px);
  }

  .btn-blue {
    background: linear-gradient(135deg, #4dabf7, #228be6);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(34, 139, 230, 0.28);
  }

  .btn-blue:hover {
    background: linear-gradient(135deg, #5fb3fb, #1c7ed6);
    box-shadow: 0 6px 28px rgba(34, 139, 230, 0.4);
    transform: translateY(-2px);
  }

  .btn-blue:active {
    transform: translateY(0) scale(0.98);
  }

  .btn-lightblue {
    background: linear-gradient(135deg, #7cc4ff, #4dabf7);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(77, 171, 247, 0.22);
  }

  .btn-lightblue:hover {
    background: linear-gradient(135deg, #8ad0ff, #5fb3fb);
    box-shadow: 0 6px 28px rgba(77, 171, 247, 0.32);
    transform: translateY(-2px);
    color: #ffffff;
  }

  .btn-lightblue:active {
    transform: translateY(0) scale(0.98);
  }

  .result-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .result-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .flashcard-intro-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 10px 4px 2px;
    max-width: 520px;
    margin: 0 auto;
  }

  .flashcard-intro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.16), rgba(6, 214, 160, 0.14));
    border: 1px solid rgba(67, 97, 238, 0.24);
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.03em;
  }

  .flashcard-intro-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
  }

  .flashcard-intro-btn {
    margin-top: 2px;
  }

  .avatar-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    margin: 0 0 18px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(72, 149, 239, 0.10), rgba(6, 214, 160, 0.08));
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-align: center;
  }

  .avatar-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
  }

  .avatar-category-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    justify-content: center;
  }

  .avatar-category-btn {
    border: 1px solid var(--border-color);
    background: var(--surface2);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
  }

  .avatar-category-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(72, 149, 239, 0.5);
  }

  .avatar-category-btn.active {
    background: linear-gradient(135deg, rgba(6, 214, 160, 0.18), rgba(72, 149, 239, 0.12));
    border-color: rgba(6, 214, 160, 0.88);
  }

  .avatar-column {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 14px;
    min-width: 0;
  }

  .avatar-column-title {
    font-size: 13px;
    font-weight: 900;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-align: center;
  }

  .avatar-selected {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface2);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin-bottom: 12px;
    font-weight: 800;
    color: var(--text);
    padding: 8px 10px;
    text-align: center;
  }

  .avatar-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
  }

  .avatar-choice {
    border: 1px solid var(--border-color);
    background: var(--surface2);
    border-radius: 14px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
  }

  .avatar-choice:hover {
    transform: translateY(-1px);
    border-color: rgba(72, 149, 239, 0.5);
  }

  .avatar-choice.selected {
    background: linear-gradient(135deg, rgba(6, 214, 160, 0.22), rgba(72, 149, 239, 0.10));
    border-color: rgba(6, 214, 160, 0.92);
    box-shadow: 0 0 0 2px rgba(6, 214, 160, 0.16), 0 0 20px rgba(6, 214, 160, 0.10);
  }

  .avatar-choice.disabled,
  .avatar-choice:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.25);
  }

  .avatar-choice.disabled:hover,
  .avatar-choice:disabled:hover {
    transform: none;
    border-color: var(--border-color);
  }

  .avatar-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .nav-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.2s;
  }

  .nav-tab.active {
    background: var(--accent);
    color: white;
  }

  /* ─── RESULT ─── */
  .result-card {
    text-align: center;
    padding: 32px 24px;
  }

  .result-emoji {
    font-size: 40px;
    display: block;
    margin-bottom: 16px;
  }

  .result-card h2 {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 8px;
  }

  .result-card p {
    color: var(--text-muted);
    margin-bottom: 24px;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
  }

  .stat-box {
    background: var(--surface2);
    border-radius: 12px;
    padding: 16px;
  }

  .stat-box .stat-val {
    font-family: 'Space Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--green);
    display: block;
  }

  .stat-box .stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
    display: block;
  }

  .result-details {
    margin-top: 24px;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
    padding-right: 4px;
  }

  .result-details::-webkit-scrollbar {
    width: 6px;
  }

  .result-details::-webkit-scrollbar-thumb {
    background: var(--surface2);
    border-radius: 3px;
  }

  .result-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface2);
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .result-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .result-word-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
  }

  .result-item.correct {
    border-left: 4px solid var(--green);
  }

  .result-item.wrong {
    border-left: 4px solid var(--red);
  }

  .result-item.passed {
    border-left: 4px solid var(--text-muted);
  }

  .res-word {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
  }

  .res-stats {
    font-size: 14px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    width: 75px;
    text-align: right;
    margin-right: 8px;
  }

  .res-points {
    font-weight: 800;
    color: var(--green);
    font-size: 13px;
    font-family: 'Space Mono', monospace;
    width: 45px;
    text-align: right;
  }

  .reveal-answer-btn {
    width: fit-content;
    margin-left: 2px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    flex: 0 0 auto;
  }

  .wrong-answer-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
  }

  .correct-answer-inline {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
  }

  .correct-answer-inline.show {
    display: inline-flex;
  }

  .correct-answer-list {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
  }

  .correct-answer-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(34, 139, 230, 0.12);
    border: 1px solid rgba(34, 139, 230, 0.24);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
  }

  .error-msg {
    background: rgba(239, 35, 60, 0.12);
    border: 1px solid rgba(239, 35, 60, 0.25);
    color: var(--red);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    display: none;
  }

  .shake-anim {
    animation: shake 0.4s ease;
  }

  .grade-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .grade-btn {
    padding: 18px 10px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--surface2);
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.18s;
    letter-spacing: 0.01em;
  }

  .grade-btn:hover {
    border-color: rgba(67, 97, 238, 0.4);
    color: var(--text);
  }

  .grade-btn.selected {
    background: linear-gradient(135deg, var(--accent), #4895ef);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 20px rgba(67, 97, 238, 0.35);
  }

  @media (min-width: 500px) {
    .quiz-word-canvas {
      height: 84px;
    }
  }

  @keyframes floatUp {
    0% {
      opacity: 0;
      transform: translate(-50%, 0);
    }

    20% {
      opacity: 1;
    }

    100% {
      opacity: 0;
      transform: translate(-50%, -120px);
    }
  }

  .floating-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: bold;
    z-index: 9999;
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  }

  .streak-celebration {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translate(-50%, -12px) scale(0.96);
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .streak-celebration.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  .streak-celebration-card {
    position: relative;
    pointer-events: auto;
    min-width: 220px;
    max-width: min(90vw, 320px);
    padding: 16px 18px 18px;
    border-radius: 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.2), rgba(67, 97, 238, 0.16));
    border: 1px solid rgba(255, 214, 10, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  }

  .streak-celebration-progress {
    position: relative;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    margin: 0 30px 12px 0;
  }

  .streak-celebration-progress-fill {
    position: absolute;
    top: 0;
    right: 0;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent2), var(--green));
    clip-path: inset(0 0 0 0);
    will-change: clip-path;
  }

  @keyframes streakCountdown {
    from {
      clip-path: inset(0 0 0 0);
    }

    to {
      clip-path: inset(0 100% 0 0);
    }
  }

  .streak-celebration-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.18);
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.15s ease, background 0.15s ease;
  }

  .streak-celebration-close:hover {
    transform: scale(1.08);
    background: rgba(0, 0, 0, 0.28);
  }

  .streak-celebration-emoji {
    display: block;
    font-size: 26px;
    margin-bottom: 6px;
  }

  .streak-celebration-text {
    font-size: 18px;
    font-weight: 900;
    color: var(--text);
  }

  .unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
  }

  .unit-btn {
    padding: 24px 10px;
    border-radius: 12px;
    position: relative;
    border: 2px solid var(--border-color);
    background: var(--surface2);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
    padding-top: 36px;
    padding-bottom: 16px;
    line-height: 1.2;
  }

  .unit-btn.no-dots,
  .unit-btn.practice-mode {
    padding-top: 26px;
    padding-bottom: 26px;
  }

  .unit-btn:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(67, 97, 238, 0.2);
  }

  .play-dots {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
  }

  .play-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--surface);
    border: 2px solid var(--border-color);
    transition: all 0.3s;
  }

  .play-dots .dot.filled {
    background-color: var(--green);
    border-color: var(--green);
    box-shadow: 0 0 8px rgba(6, 214, 160, 0.5);
  }

  .unit-btn small {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
  }

  .unit-btn.practice-mode {
    grid-column: span 2;
    background: rgba(6, 214, 160, 0.1);
    border-color: rgba(6, 214, 160, 0.3);
    color: var(--green);
  }

  .unit-btn.practice-mode small {
    /* Soluk yeşil */
    color: rgba(6, 214, 160, 0.7);
  }

  .unit-btn.selected {
    border-color: var(--accent);
    background: rgba(72, 149, 239, 0.15);
    box-shadow: 0 0 0 2px var(--accent);
    transform: translateY(-2px);
  }

  /* Practice mode seçildiğinde yeşil vurgu */
  .unit-btn.practice-mode.selected {
    border-color: var(--green);
    background: rgba(6, 214, 160, 0.2);
    box-shadow: 0 0 0 2px var(--green);
    color: white;
    transform: translateY(-2px);
  }

  .difficulty-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .difficulty-btn {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    background: var(--surface2);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .difficulty-btn:hover {
    border-color: var(--accent);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }

  .difficulty-btn.selected {
    border-color: var(--accent);
    background: rgba(72, 149, 239, 0.15);
    box-shadow: 0 0 0 2px var(--accent);
    transform: translateY(-2px);
  }

  .difficulty-btn strong {
    font-weight: 800;
    font-size: 16px;
    color: var(--text);
  }

  .difficulty-btn small {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
  }

  .unit-btn.disabled {
    background: var(--surface2);
    color: var(--text-muted);
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border-color);
    pointer-events: none;
  }

  .unit-btn.disabled:hover {
    transform: none;
    box-shadow: none;
  }

  .btn-back {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .btn-back:hover {
    background: var(--surface2);
    color: var(--text);
    border-color: var(--accent);
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  @media (max-width: 480px) {
    body {
      padding: 20px 16px;
    }

    .post-login-choice-profile {
      flex-direction: row;
      align-items: center;
    }

    .post-login-avatar-btn {
      height: 48px;
      min-height: 48px;
      width: 100%;
    }

    .post-login-choice-actions {
      gap: 12px;
    }

    .post-login-choice-actions-grid {
      grid-template-columns: 1fr;
      gap: 10px;
      padding-inline: 0;
    }

    .post-login-choice-actions-grid::before {
      display: none;
    }

    #screen-post-login-choice .post-login-choice-actions .btn {
      min-height: 50px;
      padding: 10px 8px;
      font-size: 13px;
      line-height: 1.15;
    }

    .matching-mode-choice-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .matching-mode-choice-card {
      padding: 14px 10px;
      min-height: 0;
      gap: 8px;
    }

    .matching-choice-card,
    .flashcard-choice-card {
      min-height: 0;
    }

    .mode-info-panel {
      max-width: 100%;
      padding: 12px 10px;
      gap: 8px;
    }

    .mode-desc-list {
      max-width: 100%;
      min-height: 0;
      font-size: 12px;
      line-height: 1.45;
      padding-left: 16px;
    }

    .flashcard-choice-card .mode-desc-list {
      min-height: 0;
    }

    .flashcard-mode-badge {
      min-height: 34px;
      padding: 7px 12px;
      font-size: 13px;
      margin-bottom: 0;
    }

    .mode-daily-status-box {
      max-width: 100%;
      padding: 8px 10px;
      border-radius: 14px;
    }

    .mode-daily-label {
      font-size: 12px;
    }

    .mode-daily-led {
      width: 9px;
      height: 9px;
    }

    .matching-mode-choice-card .btn-full {
      min-height: 44px;
      font-size: 12px;
      padding: 10px 8px;
      line-height: 1.1;
    }

    .flashcard-choice-start-btn {
      min-height: 48px;
      font-size: 12px;
      padding: 10px 8px;
      line-height: 1.08;
    }
  }

  /* Klavye açıldığında ekran yüksekliği küçülür.
     Bu durumda arayüzü sıkıştırarak önemli kısımların (süre, kelime) görünmesini sağlıyoruz. */
  @media (max-height: 500px) {
    body {
      padding: 0 16px;
      align-items: flex-start;
    }

    .app {
      margin-top: 10px;
    }

    /* Quiz Ekranı Sıkıştırma */
    .quiz-header {
      margin-bottom: 5px;
    }

    .player-badge,
    .score-badge,
    .streak-pill {
      padding: 4px 8px;
      font-size: 11px;
    }

    .player-badge .avatar {
      width: 20px;
      height: 20px;
      font-size: 10px;
    }

    .streak-banner {
      padding: 8px 10px;
      margin-bottom: 10px;
    }

    .streak-banner-text {
      font-size: 12px;
    }

    .progress-bar {
      margin-bottom: 8px;
      height: 4px;
    }

  .word-card {
      padding: 10px 10px 36px 10px;
      margin-bottom: 8px;
      border-radius: 12px;
    }

    .word-card::before {
      display: none;
    }

    .card-score {
      bottom: 7px;
      right: 10px;
      font-size: 16px;
    }

    .word-counter {
      bottom: 9px;
      left: 50%;
      transform: translateX(-50%);
    }

    .timer-circle-container {
      width: 40px;
      height: 40px;
      margin-bottom: 4px;
    }

    .timer-text {
      font-size: 16px;
    }

    .timer-circle .timer-bg,
    .timer-circle .timer-path-remaining {
      stroke-width: 8;
    }

    .quiz-word-canvas {
      height: 58px;
    }

    .mistake-dots {
      margin-bottom: 5px;
    }

    .dot {
      width: 6px;
      height: 6px;
    }

    .answer-area {
      margin-bottom: 8px;
    }

    .answer-input {
      padding: 8px;
      font-size: 16px;
      border-radius: 8px;
    }

    .btn {
      padding: 10px;
      font-size: 14px;
      border-radius: 8px;
    }

    /* Override for mobile quiz actions */
    .quiz-actions {
      gap: 8px;
    }

    .post-login-choice-actions-grid {
      grid-template-columns: 1fr;
      gap: 10px;
      padding-inline: 0;
    }

    .post-login-choice-actions-grid::before {
      display: none;
    }

    /* Giriş Ekranı Sıkıştırma */
    .logo {
      margin-bottom: 5px;
    }

    .logo-icon {
      display: none;
    }

    .logo h1 {
      font-size: 18px;
    }

    .logo p {
      display: none;
    }

    .card {
      padding: 12px;
    }

    .form-group {
      margin-bottom: 8px;
    }

    .form-group label {
      font-size: 11px;
      margin-bottom: 2px;
    }

    .form-group input {
      padding: 8px;
      font-size: 16px;
    }

    .grade-btn {
      padding: 8px;
      font-size: 12px;
    }
  }

  /* ── INFO MODAL (Practice Mode için) ── */
  .info-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .info-modal.show {
    opacity: 1;
    visibility: visible;
  }

  .info-modal-content {
    background: var(--surface);
    padding: 45px 32px 32px 32px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 550px;
    border: 1px solid var(--border-color);
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s;
    position: relative;
  }

  .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: var(--red);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
  }

  .modal-close:hover {
    background: #bd1f36;
    /* Daha koyu bir kırmızı */
    transform: scale(1.1);
  }

  .info-modal.show .info-modal-content {
    transform: scale(1);
  }

  .info-modal-content h2 {
    font-size: 24px;
    font-weight: 900;
    color: var(--accent2);
    margin-bottom: 16px;
  }

  .info-modal-content ul {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--text-muted);
  }

  .info-modal-content ul li {
    font-size: 15px;
    line-height: 1.6;
  }

  /* ── FEEDBACK BUTTON & MODAL ── */
  .feedback-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    /* Animasyon için başlangıç genişliği */
    height: 50px;
    background: var(--red);
    border-radius: 25px;
    /* Genişlerken yuvarlak kalması için */
    border: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* İçeriği sola hizala */
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(239, 35, 60, 0.4);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    /* Zıplama efekti */
    overflow: hidden;
    /* İçerik taşmasını engelle */
    white-space: nowrap;
    /* Yazının alt satıra inmesini engelle */
    padding-left: 11px;
    /* İkonu ortalamak için: (50px - 28px) / 2 */
  }

  .feedback-btn.show-text {
    width: 220px;
    /* Genişlemiş hali */
  }

  .feedback-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(239, 35, 60, 0.5);
  }

  .feedback-btn svg {
    width: 28px;
    height: 28px;
    color: white;
    flex-shrink: 0;
    /* İkonun küçülmesini engelle */
  }

  .feedback-btn .feedback-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: white;
    margin-left: 10px;
    opacity: 0;
    transition: opacity 0.2s 0.2s;
    /* Genişleme bittikten sonra yazı görünsün */
  }

  .feedback-btn.show-text .feedback-text {
    opacity: 1;
  }

  #feedback-modal .form-group textarea {
    width: 100%;
    background: var(--surface2);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 16px;
    outline: none;
    transition: .4s;
    min-height: 120px;
    resize: vertical;
  }

  #feedback-modal .form-group textarea:focus {
    border-color: var(--accent);
  }

  #feedback-modal .file-input {
    width: 100%;
    background: var(--surface2);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
    outline: none;
    transition: border-color 0.2s;
  }

  #feedback-modal .file-input:hover {
    border-color: var(--accent);
  }

  #feedback-modal .file-input::file-selector-button {
    display: none;
  }

  .beast-speak-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: -8px auto 12px;
    padding: 16px 24px;
    border-radius: 20px;
    border: 2px solid var(--accent);
    background: rgba(72, 149, 239, 0.1);
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
    position: relative;
  }

  .beast-speak-btn span {
    font-size: 14px;
    font-weight: 700;
    margin-top: 8px;
    color: var(--text);
  }

  .beast-speak-btn.btn-speak-active {
    border-color: var(--accent);
    background: rgba(72, 149, 239, 0.2);
    animation: beast-pulse 0.6s ease-out infinite;
  }

  @keyframes beast-pulse {
    0% { box-shadow: 0 0 0 0 rgba(72, 149, 239, 0.4); }
    70% { box-shadow: 0 0 0 16px rgba(72, 149, 239, 0); }
    100% { box-shadow: 0 0 0 0 rgba(72, 149, 239, 0); }
  }

  .beast-speak-btn:active {
    transform: scale(0.96);
    background: rgba(72, 149, 239, 0.2);
  }

  .beast-speak-btn.btn-speak-active {
    background: rgba(72, 149, 239, 0.25);
    border-color: var(--accent);
  }

  /* ─── LOADING DOTS ─── */
  .loading-dots {
    font-size: 32px;
    color: var(--text-muted);
    font-weight: 900;
  }

  .loading-dots::after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
  }

  @keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
  }

  .matching-mode-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.18), rgba(6, 214, 160, 0.12));
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
  }

  .word-card #matching-mode-area {
    margin-top: 52px !important;
    padding: 0 6px;
    box-sizing: border-box;
  }

  .word-card #matching-mode-area .matching-mode-banner {
    margin-top: 0;
  }

  .matching-mode-banner > div {
    width: 100%;
  }

  .matching-mode-title {
    font-size: 18px;
    font-weight: 900;
    text-align: center;
  }

  .matching-mode-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
    text-align: center;
  }

  .matching-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    position: relative;
  }

  .matching-board::before {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, transparent, rgba(128, 128, 128, 0.38), transparent);
    pointer-events: none;
    z-index: 1;
  }

  .matching-board::after {
    content: '>';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 900;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  }

  .matching-column {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px;
    min-height: 220px;
  }

  .matching-column-title {
    font-size: 12px;
    font-weight: 900;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
  }

  .matching-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .matching-card {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 14px 12px;
    border-radius: 14px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(12px, 3.4vw, 16px);
    line-height: 1.15;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, opacity 0.22s ease, background 0.18s ease, box-shadow 0.18s ease;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .matching-card:hover {
    transform: translateY(-1px);
    border-color: rgba(67, 97, 238, 0.55);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  }

  .matching-card.selected {
    border-color: var(--accent2);
    box-shadow: 0 0 0 2px rgba(255, 214, 10, 0.14);
    background: rgba(255, 214, 10, 0.08);
  }

  .matching-column:first-child .matching-card.selected {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.16);
    background: rgba(245, 158, 11, 0.12);
  }

  .matching-column:last-child .matching-card.selected {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.16);
    background: rgba(139, 92, 246, 0.12);
  }

  .matching-card.selected.selected-yellow {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.16);
    background: rgba(245, 158, 11, 0.12);
  }

  .matching-card.selected.selected-purple {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.16);
    background: rgba(139, 92, 246, 0.12);
  }

  .matching-card.selected.selected-green {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16);
    background: rgba(34, 197, 94, 0.12);
  }

  .matching-card.matched {
    opacity: 0.15;
    pointer-events: none;
    transform: scale(0.96);
    animation: matchingFadeOut 0.45s ease forwards;
  }

  .matching-card.entering {
    animation: matchingFadeIn 0.38s ease both;
  }

  .matching-card.matching-empty {
    opacity: 0;
    pointer-events: none;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: transparent;
    transform: none;
  }

  .matching-card.wrong {
    border-color: var(--red);
    background: rgba(239, 35, 60, 0.12);
    animation: shake 0.4s ease;
  }

  .matching-status {
    margin-top: 12px;
    min-height: 22px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
  }

  .matching-status.correct {
    color: var(--green);
  }

  .matching-status.wrong {
    color: var(--red);
  }

  #btn-end-matching {
    display: none;
    width: 100%;
    margin-top: 12px;
  }

  @keyframes matchingFadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.92); }
  }

  @keyframes matchingFadeIn {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
  }

  @media (max-width: 700px) {
    .matching-column {
      padding: 10px;
      min-height: 200px;
    }

    .matching-mode-banner {
      align-items: flex-start;
      flex-direction: column;
    }

    .matching-board::after {
      width: 24px;
      height: 24px;
      font-size: 12px;
    }
  }

  .achievement-preview-card,
  .achievement-summary-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
    margin: 0;
  }

  .achievement-preview-header,
  .achievement-summary-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .achievement-hero-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
  }

  .achievement-hero-count {
    display: inline;
    font: inherit;
    color: var(--text-muted);
    font-weight: 900;
    margin-left: 6px;
    white-space: nowrap;
  }

  [data-theme="light"] .achievement-hero-count {
    color: #475569;
  }

  .achievement-hero-title {
    margin: 4px 0 0;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.15;
  }

  .achievement-hero-title .achievement-hero-count {
    font-size: inherit;
  }

  .achievement-summary-panel {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    position: relative;
    overflow: visible;
  }

  .achievement-preview-header h3,
  .achievement-hero h2 {
    margin: 4px 0 0;
    font-size: 20px;
    font-weight: 900;
  }

  .achievement-mini-bar {
    display: grid;
    gap: 10px;
    margin: 10px 0 12px;
    padding: 14px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.09);
    background:
      radial-gradient(circle at top right, rgba(6,214,160,0.10), transparent 34%),
      radial-gradient(circle at bottom left, rgba(255,122,24,0.08), transparent 30%),
      linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  }

  [data-theme="light"] .achievement-mini-bar {
    background:
      radial-gradient(circle at top right, rgba(59,130,246,0.10), transparent 34%),
      radial-gradient(circle at bottom left, rgba(16,185,129,0.09), transparent 30%),
      linear-gradient(180deg, #ffffff, #f7fbff);
    border-color: rgba(0, 0, 0, 0.10);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  }

  .achievement-mini-bar-title {
    text-align: center;
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.1;
  }

  [data-theme="light"] .achievement-mini-bar-title {
    color: #0f172a;
  }

  .achievement-mini-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.01em;
  }

  .achievement-mini-bar-meta-row {
    width: 100%;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    text-align: center;
  }

  .achievement-mini-bar-count {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 800;
  }

  [data-theme="light"] .achievement-mini-bar-count {
    color: #475569;
  }

  .achievement-mini-bar-count strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
    margin-right: 0;
  }

  .achievement-mini-bar-text {
    margin-top: 0;
    font-size: 12px;
    color: var(--text-muted);
  }

  .post-login-choice-profile .avatar-preview-caption {
    font-size: 13px;
    letter-spacing: 0.01em;
  }

  .achievement-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 12px;
  }

  [data-theme="light"] .achievement-tabs {
    gap: 10px;
  }

  .achievement-tab-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
  }

  [data-theme="light"] .achievement-tab-btn {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    color: var(--text-muted);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  }

  .achievement-tab-btn strong {
    font-size: 14px;
    color: var(--text);
  }

  .achievement-tab-btn.active {
    color: var(--text);
    border-color: rgba(6,214,160,0.35);
    background: linear-gradient(180deg, rgba(6,214,160,0.14), rgba(255,255,255,0.05));
  }

  [data-theme="light"] .achievement-tab-btn.active {
    border-color: rgba(58, 134, 255, 0.28);
    background: linear-gradient(180deg, rgba(58, 134, 255, 0.14), rgba(16, 185, 129, 0.10));
    box-shadow: 0 8px 20px rgba(58, 134, 255, 0.10);
  }

  .achievement-tab-btn.active strong {
    color: var(--green);
  }

  .achievement-tab-btn:active {
    transform: scale(0.99);
  }

  .achievement-view-btn {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 13px;
    min-height: 42px;
    max-width: max-content;
    height: auto;
    font-size: 13px;
    line-height: 1.1;
    border-radius: 999px;
    white-space: nowrap;
    align-self: center;
    flex-shrink: 0;
  }

  [data-theme="light"] .achievement-view-btn {
    background: linear-gradient(180deg, #eef4ff, #e1ebff);
    color: #1d4ed8;
    border: 1px solid rgba(58, 134, 255, 0.22);
    box-shadow: 0 8px 18px rgba(58, 134, 255, 0.12);
  }

  [data-theme="light"] .achievement-view-btn:hover {
    background: linear-gradient(180deg, #e7f0ff, #dbeafe);
    color: #1d4ed8;
  }

  .achievement-mini-bar .achievement-view-btn:hover {
    transform: translateY(-1px);
  }

  .lb-name-btn:focus-visible,
  .achievement-view-btn:focus-visible,
  .student-profile-achievement:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .achievement-empty-state {
    margin-top: 4px;
  }

  .student-profile-modal-content {
    max-width: 760px;
    text-align: left;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    margin: 16px 0;
    border-width: 2px;
  }

  .student-profile-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
  }

  .student-profile-avatar {
    width: 74px;
    height: 74px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(6,214,160,0.14), rgba(58,134,255,0.08));
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 34px;
    flex-shrink: 0;
  }

  .student-profile-avatar .lb-avatar {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: transparent;
  }

  .student-profile-avatar .lb-avatar-image,
  .student-profile-avatar .avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
  }

  .student-profile-avatar .lb-avatar-fallback {
    width: 100%;
    height: 100%;
    font-size: 32px;
    border-radius: inherit;
  }

  [data-theme="light"] .student-profile-avatar {
    background: linear-gradient(180deg, rgba(59,130,246,0.10), rgba(16,185,129,0.08));
    border-color: rgba(15, 23, 42, 0.08);
  }

  .student-profile-head h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    color: var(--text);
  }

  .student-profile-head p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
  }

  .student-profile-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .student-profile-summary-chip {
    padding: 12px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    display: grid;
    gap: 4px;
  }

  [data-theme="light"] .student-profile-summary-chip {
    background: #ffffff;
    border: 2px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.03);
  }

  .student-profile-summary-chip strong {
    font-size: 18px;
    font-weight: 900;
    color: var(--text);
  }

  .student-profile-summary-chip span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
  }

  .student-profile-section {
    margin-top: 10px;
    display: grid;
    gap: 8px;
    position: relative;
  }

  .student-profile-section-title {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .student-profile-achievement-list {
    display: grid;
    gap: 7px;
  }

  .student-profile-achievement {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
  }

  [data-theme="light"] .student-profile-achievement {
    background: #ffffff;
    border: 2px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.03);
  }

  .student-profile-achievement.locked {
    opacity: 0.8;
  }

  .student-profile-achievement-badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 16px;
    flex-shrink: 0;
  }

  [data-theme="light"] .student-profile-achievement-badge {
    background: #f8fafc;
    border: 2px solid rgba(15, 23, 42, 0.10);
  }

  .student-profile-achievement-body {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .student-profile-achievement-body strong {
    font-size: 14px;
    font-weight: 900;
    color: var(--text);
  }

  .student-profile-achievement-body span {
    font-size: 12px;
    color: var(--text-muted);
  }

  .student-profile-achievement-state {
    text-align: right;
    display: grid;
    gap: 2px;
    min-width: 70px;
  }

  .student-profile-achievement-state span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
  }

  .student-profile-achievement-state strong {
    font-size: 14px;
    font-weight: 900;
    color: var(--green);
  }

  .student-profile-empty,
  .student-profile-summary-loading {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px dashed rgba(255,255,255,0.10);
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    text-align: center;
    font-size: 13px;
  }

  [data-theme="light"] .student-profile-empty,
  [data-theme="light"] .student-profile-summary-loading {
    border: 2px dashed rgba(15, 23, 42, 0.12);
    background: #f8fafc;
    color: #475569;
  }

  [data-theme="light"] .student-profile-achievement-state strong {
    color: #0f172a;
  }

  @media (max-width: 700px) {
    #student-profile-modal.info-modal {
      align-items: flex-start;
      padding-top: 8px;
    }

    .lb-item {
      gap: 10px;
      padding: 12px 12px;
    }

    .lb-name,
    .lb-name-btn {
      font-size: 14px;
    }

    .lb-badge-icon {
      width: 16px;
      height: 16px;
      font-size: 11px;
    }

    .student-profile-modal-content {
      padding: 30px 14px 18px 14px;
      width: calc(100% - 16px);
      max-height: calc(100dvh - 16px);
      margin: 8px 0;
    }

    .student-profile-top {
      align-items: flex-start;
      gap: 12px;
    }

    .student-profile-avatar {
      width: 58px;
      height: 58px;
      border-radius: 16px;
      font-size: 28px;
    }

    .student-profile-head h2 {
      font-size: 19px;
    }

    .student-profile-summary {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-profile-achievement {
      grid-template-columns: auto 1fr;
      align-items: start;
      padding: 8px 10px;
      gap: 8px;
    }

    .student-profile-achievement-state {
      grid-column: 2;
      text-align: left;
      min-width: 0;
      margin-top: 2px;
    }
  }

  .achievement-kicker {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
  }

  .achievement-summary-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    text-align: left;
    width: 100%;
  }

  [data-theme="light"] .achievement-summary-panel {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  }

  [data-theme="light"] .achievement-summary-value {
    color: #0f172a;
  }

  [data-theme="light"] .achievement-summary-label,
  [data-theme="light"] .achievement-summary-meta,
  [data-theme="light"] .achievement-preview-text,
  [data-theme="light"] .achievement-hero p {
    color: #475569;
  }

  [data-theme="light"] .achievement-progress-shell {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.08);
  }

  .achievement-summary-value {
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
  }

  .achievement-summary-label,
  .achievement-summary-meta,
  .achievement-preview-text,
  .achievement-hero p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
  }

  .achievement-progress-shell {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
  }

  .achievement-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff7a18 0%, #ff4d8d 50%, #7c3aed 100%);
    transition: width 220ms ease;
  }

  [data-theme="light"] .achievement-progress-fill {
    background: linear-gradient(90deg, #f97316 0%, #ec4899 45%, #8b5cf6 100%);
  }

  .achievement-badge-wall {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .achievement-badge-chip-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 12px;
    justify-content: center;
    position: relative;
    overflow: hidden;
    font-size: 0;
    box-shadow: none;
    border: 1px solid transparent;
    background: transparent;
    transition: transform 160ms ease, opacity 160ms ease, border-color 160ms ease, background 160ms ease;
  }

  .achievement-badge-chip-icon:hover {
    transform: translateY(-1px) scale(1.03);
  }

  .achievement-badge-chip-icon .emoji {
    font-size: 18px;
    line-height: 1;
  }

  .achievement-badge-chip-icon.unlocked {
    background: linear-gradient(180deg, rgba(6,214,160,0.20), rgba(59,130,246,0.10));
    border-color: rgba(6,214,160,0.28);
  }

  .achievement-badge-chip-icon.locked {
    background: transparent;
    border-color: rgba(255,255,255,0.08);
    opacity: 0.78;
  }

  .achievement-badge-chip-icon.locked .emoji {
    filter: grayscale(1) saturate(0) brightness(0.88) contrast(0.92);
    opacity: 0.58;
  }

  .achievement-badge-chip-icon.active {
    box-shadow: 0 0 0 2px rgba(6,214,160,0.28), 0 10px 24px rgba(0,0,0,0.16);
  }

  .achievement-badge-tooltip {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 160ms ease, transform 160ms ease;
    text-align: center;
    pointer-events: none;
    z-index: 2;
  }

  .achievement-badge-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -100%);
  }

  .achievement-badge-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: inherit;
    border-right: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transform: translateX(-50%) rotate(45deg);
  }

  [data-theme="light"] .achievement-badge-tooltip::after {
    border-right-color: rgba(15, 23, 42, 0.10);
    border-bottom-color: rgba(15, 23, 42, 0.10);
  }

  [data-theme="light"] .achievement-badge-chip-icon {
    background: transparent;
    border-color: rgba(15, 23, 42, 0.10);
    box-shadow: none;
  }

  [data-theme="light"] .achievement-badge-chip-icon.unlocked {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.18), rgba(59, 130, 246, 0.10));
    border-color: rgba(16, 185, 129, 0.22);
  }

  [data-theme="light"] .achievement-badge-chip-icon.locked {
    background: transparent;
    border-color: rgba(15, 23, 42, 0.10);
    opacity: 0.80;
  }

  [data-theme="light"] .achievement-badge-chip-icon.locked .emoji {
    filter: grayscale(1) saturate(0) brightness(0.85) contrast(0.95);
    opacity: 0.56;
  }

  [data-theme="light"] .achievement-badge-chip-icon.active {
    box-shadow: 0 0 0 2px rgba(58, 134, 255, 0.18), 0 10px 24px rgba(15, 23, 42, 0.08);
  }

  [data-theme="light"] .achievement-badge-tooltip {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.10);
    color: #0f172a;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }

  .achievement-badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.09);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
  }

  [data-theme="light"] .achievement-badge-chip {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.10);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    color: #0f172a;
  }

  .achievement-badge-chip .emoji {
    font-size: 14px;
  }

  .achievement-list {
    display: grid;
    gap: 10px;
  }

  .achievement-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
  }

  [data-theme="light"] .achievement-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.10);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  }

  .achievement-card.unlocked {
    background: linear-gradient(180deg, rgba(6,214,160,0.13), rgba(255,255,255,0.05));
    border-color: rgba(6,214,160,0.22);
  }

  [data-theme="light"] .achievement-card.unlocked {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.16), rgba(59, 130, 246, 0.06));
    border-color: rgba(16, 185, 129, 0.24);
  }

  .achievement-card.locked {
    opacity: 0.84;
  }

  [data-theme="light"] .achievement-card.locked {
    opacity: 1;
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  }

  .achievement-card-main {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 8px;
  }

  .achievement-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .achievement-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .achievement-card-title strong {
    font-size: 14px;
    font-weight: 900;
  }

  [data-theme="light"] .achievement-card-title strong {
    color: #0f172a;
  }

  .achievement-card-title .badge-emoji {
    font-size: 18px;
    flex-shrink: 0;
  }

  [data-theme="light"] .achievement-card-title .badge-emoji {
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.08));
  }

  .achievement-card-desc {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
  }

  [data-theme="light"] .achievement-card-desc {
    color: #475569;
  }

  .achievement-card-footer {
    display: grid;
    gap: 6px;
  }

  .achievement-card-meta {
    min-width: 0;
    text-align: right;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
  }

  [data-theme="light"] .achievement-card-meta {
    color: #475569;
  }

  .achievement-card-meta .pct {
    display: block;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 4px;
  }

  [data-theme="light"] .achievement-card-meta .pct {
    color: #0f172a;
  }

  .achievement-card-requirement {
    font-size: 11px;
    line-height: 1.35;
  }

  [data-theme="light"] .achievement-card-requirement {
    color: #334155;
  }

  .achievement-empty-state {
    padding: 18px 14px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 18px;
  }

  [data-theme="light"] .achievement-empty-state {
    color: #475569;
    border-color: rgba(15, 23, 42, 0.14);
    background: linear-gradient(180deg, #ffffff, #f8fafc);
  }

  @media (max-width: 700px) {
    .achievement-preview-header,
    .achievement-summary-panel,
    .achievement-card {
      flex-direction: column;
      align-items: stretch;
    }

    .achievement-card-meta {
      text-align: left;
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
    }

    .achievement-summary-progress-compact {
      align-items: center;
    }

    .achievement-badge-wall {
      gap: 8px;
    }

    .achievement-badge-chip-icon {
      width: 34px;
      height: 34px;
      border-radius: 11px;
    }

    .achievement-badge-chip-icon .emoji {
      font-size: 17px;
    }

    .achievement-badge-tooltip {
      font-size: 12px;
      min-height: 32px;
      padding: 7px 10px;
    }

    .achievement-hero-row {
      align-items: center;
    }

    .achievement-hero-count {
      margin-left: 5px;
    }
  }

  @media (max-width: 480px) {
    #screen-login .card,
    #screen-post-login-choice .card,
    #screen-achievements .card {
      max-height: calc(100dvh - 24px);
    }

    #screen-login .card {
      padding: 18px 14px;
    }

    #screen-post-login-choice .card,
    #screen-achievements .card {
      padding: 16px 12px;
    }

    .post-login-choice-profile {
      padding: 12px;
      margin: 8px 0 10px;
    }

    .post-login-choice-preview {
      width: 84px;
      height: 84px;
      border-radius: 22px;
    }

    .post-login-avatar-btn {
      height: 46px;
      min-height: 46px;
      font-size: 13px;
      border-radius: 14px;
    }

    .achievement-mini-bar {
      padding: 11px 12px;
      margin: 8px 0 10px;
      gap: 8px;
    }

    .achievement-mini-bar-meta {
      align-items: stretch;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: nowrap;
    }

    .achievement-mini-bar-title {
      font-size: 17px;
    }

    .achievement-mini-bar-count {
      font-size: 13px;
      flex: 0 1 auto;
      min-width: 0;
    }

    .achievement-mini-bar .achievement-view-btn {
      width: auto !important;
      flex: 0 0 auto;
      justify-content: center;
      min-height: 42px;
      font-size: 12px;
      padding-inline: 10px;
      max-width: max-content;
    }

    .achievement-tab-btn {
      padding: 9px 10px;
      font-size: 12px;
    }

    .achievement-card {
      padding: 11px 12px;
    }

    .achievement-card-main {
      gap: 6px;
    }

    .achievement-card-title strong {
      font-size: 13px;
    }

    .achievement-card-desc {
      font-size: 11px;
    }

    .achievement-card-meta .pct {
      font-size: 15px;
    }

    .achievement-card-requirement {
      font-size: 10px;
    }
  }

  @media (max-height: 760px) and (min-width: 481px) {
    #screen-login .card,
    #screen-post-login-choice .card,
    #screen-achievements .card {
      max-height: calc(100dvh - 20px);
    }

    .logo {
      margin-bottom: 18px;
    }

    .logo-icon {
      font-size: 46px;
      margin-bottom: 4px;
    }

    .logo h1 {
      font-size: 28px;
    }

    .nav-tabs {
      margin-bottom: 18px;
    }

    .form-group {
      margin-bottom: 12px;
    }

    .post-login-choice-profile {
      padding: 12px 12px 10px;
    }

    .achievement-mini-bar {
      padding: 10px 12px;
      gap: 8px;
    }

    .achievement-preview-text {
      font-size: 12px;
    }
  }
