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

:root {
  --navy: #16324f;
  --navy-dark: #0e2238;
  --gray-100: #f4f6f8;
  --gray-200: #e4e8ed;
  --gray-300: #cfd7df;
  --gray-500: #627487;
  --text: #1b2430;
  --success: #4f8d40;
  --error: #bf3d3d;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(10, 21, 34, 0.1);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: none;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef2f6 0%, #f7f9fb 100%);
  min-height: 100vh;
  min-height: 100dvh;
  position: fixed;
  inset: 0;
  padding: 10px;
  touch-action: manipulation;
  overscroll-behavior: none;
}

.container {
  max-width: 980px;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
}

main {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: 100%;
  overflow: hidden;
  padding: 10px;
}

.game-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-menu.words-section.stats-minimal {
  border: 1px solid var(--gray-200);
  background: #fbfcfd;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.stats-minimal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.stats-minimal-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.stats-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--gray-500);
  letter-spacing: 0.6px;
}

.stats-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.stats-value.stats-date {
  color: #31455c;
}

.menu-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn,
.words-toggle {
  width: 35px;
  height: 35px;
  border: 1px solid var(--gray-300);
  background: white;
  color: var(--navy);
  border-radius: 10px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.icon-btn.has-indicator {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #bf3d3d;
  border: 1px solid #fff;
  pointer-events: none;
}

.icon-svg {
  width: 21px;
  height: 21px;
  display: block;
  margin: 0 auto;
  pointer-events: none;
}

.hints-btn {
  height: 35px;
  border: 1px solid #234364;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 0 12px;
  line-height: 1;
}

.words-toggle.collapsed {
  transform: rotate(-90deg);
}

.stats-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar.minimal {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--gray-200);
  overflow: hidden;
}

.progress-bar.minimal .progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--navy);
  transition: width 0.3s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.progress-bar.minimal .progress-fill.progress-fill-complete {
  background: linear-gradient(90deg, #1d567d 0%, #2b8a7f 55%, #f2bf4b 100%);
  box-shadow: 0 0 18px rgba(72, 166, 145, 0.35);
}

.progress-text {
  font-size: 13px;
  color: var(--gray-500);
  white-space: nowrap;
}

.words-preview {
  display: none;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: #334a61;
}

.words-preview.collapsed {
  display: flex;
}

.preview-word {
  text-transform: lowercase;
}

.preview-word.all-letter {
  font-weight: 700;
}

.preview-sep {
  color: #8aa0b7;
  margin-right: 2px;
}

.words-content {
  display: block;
  max-height: 44vh;
  overflow-y: auto;
  transition: max-height 0.25s ease, opacity 0.25s ease;
  opacity: 1;
}

.words-content.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.words-list {
  column-count: 2;
  column-gap: 16px;
}

.word-item {
  display: block;
  padding: 3px 0;
  border-bottom: 1px solid #edf1f5;
  text-transform: lowercase;
  font-size: 13px;
  color: #2a3d51;
  break-inside: avoid;
}

.word-item.all-letter {
  color: var(--navy);
  font-weight: 700;
}

.word-item.guessed-yesterday {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.55;
}

.empty-message {
  font-size: 12px;
  color: var(--gray-500);
  font-style: italic;
  padding: 2px 0;
}

.game-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.message.success {
  background: #d9ead4;
  color: #2f6424;
}

.message.error {
  background: #f7d9d9;
  color: #8b2e2e;
}

.message.info {
  background: #dce9f7;
  color: #2b4f78;
}

.message.ceremonial {
  height: 40px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid #e7c76e;
  color: #5a3f05;
  background:
    radial-gradient(circle at 14% 30%, rgba(255, 255, 255, 0.72), transparent 38%),
    linear-gradient(135deg, #fff7d6 0%, #ffe594 52%, #ffd66a 100%);
  box-shadow:
    0 0 0 1px rgba(245, 205, 95, 0.35),
    0 7px 18px rgba(140, 98, 16, 0.2);
  animation: ceremonialPulse 620ms ease-out;
}

.message.ceremonial.daily-victory {
  height: 46px;
  border-color: rgba(58, 126, 129, 0.42);
  color: #123c43;
  background:
    radial-gradient(circle at 12% 30%, rgba(255, 255, 255, 0.82), transparent 34%),
    linear-gradient(135deg, #eefcf6 0%, #d6f6eb 48%, #ffe19c 100%);
  box-shadow:
    0 0 0 1px rgba(91, 178, 166, 0.18),
    0 10px 24px rgba(25, 86, 90, 0.16);
}

.message .ceremonial-prefix {
  font-weight: 800;
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@keyframes ceremonialPulse {
  0% {
    transform: translateY(6px) scale(0.97);
    filter: brightness(0.96) saturate(0.85);
  }
  45% {
    transform: translateY(0) scale(1.02);
    filter: brightness(1.06) saturate(1.15);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1) saturate(1);
  }
}

.letters-container {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 540px;
  padding: 16px;
  transition: transform 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
  --hex-size: 120px;
  --hex-gap: 12px;
  --hex-font: 46px;
  --hex-radius: calc(var(--hex-size) * 0.866 + var(--hex-gap));
  --action-size: var(--hex-size);
  --action-radius: calc(var(--hex-radius) * 1.74);
  --hive-shift: calc(var(--hex-size) * -0.62);
}

.letters-container.daily-victory-active {
  border-color: rgba(95, 175, 159, 0.55);
  box-shadow: 0 18px 44px rgba(25, 86, 90, 0.18);
  transform: translateY(-2px);
}

.letters-container.daily-victory-active .golden-letter,
.letters-container.daily-victory-active .letter-btn {
  animation: dailyVictoryHexPulse 1.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.letters-container.daily-victory-active .golden-letter {
  animation-delay: 70ms;
}

.letters-container.daily-victory-active .regular-letters .letter-btn:nth-child(1) { animation-delay: 140ms; }
.letters-container.daily-victory-active .regular-letters .letter-btn:nth-child(2) { animation-delay: 210ms; }
.letters-container.daily-victory-active .regular-letters .letter-btn:nth-child(3) { animation-delay: 280ms; }
.letters-container.daily-victory-active .regular-letters .letter-btn:nth-child(4) { animation-delay: 350ms; }
.letters-container.daily-victory-active .regular-letters .letter-btn:nth-child(5) { animation-delay: 420ms; }
.letters-container.daily-victory-active .regular-letters .letter-btn:nth-child(6) { animation-delay: 490ms; }

.daily-victory-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
  contain: layout paint;
}

.daily-victory-aurora {
  position: absolute;
  inset: -12% -10%;
  background:
    radial-gradient(circle at 50% 56%, rgba(255, 231, 162, 0.72), transparent 19%),
    radial-gradient(circle at 28% 28%, rgba(89, 196, 176, 0.2), transparent 32%),
    radial-gradient(circle at 74% 22%, rgba(34, 111, 145, 0.16), transparent 30%);
  opacity: 0;
  animation: dailyVictoryAurora 4.8s ease-out forwards;
}

.daily-victory-rings,
.daily-victory-rays {
  position: absolute;
  inset: 0;
}

.daily-victory-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140px;
  height: 140px;
  margin: -70px 0 0 -70px;
  border: 1.5px solid rgba(255, 223, 133, 0.62);
  border-radius: 50%;
  opacity: 0;
  animation: dailyVictoryRing 1.8s ease-out var(--ring-delay) forwards;
}

.daily-victory-ray {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 170px;
  margin: -150px 0 0 -4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 233, 177, 0), rgba(255, 226, 135, 0.9), rgba(255, 233, 177, 0));
  transform: rotate(var(--ray-angle)) scaleY(0.2);
  transform-origin: 50% 150px;
  opacity: 0;
  filter: blur(0.2px);
  animation: dailyVictoryRay 1.5s ease-out var(--ray-delay) forwards;
}

.daily-victory-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--spark-size);
  height: calc(var(--spark-size) * 1.9);
  margin: calc(var(--spark-size) * -0.5) 0 0 calc(var(--spark-size) * -0.5);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff1c8 0%, #ffd768 100%);
  opacity: 0;
  transform: translate3d(0, 0, 0) rotate(var(--spark-rotate)) scale(0.35);
  animation: dailyVictorySpark 1.7s cubic-bezier(0.18, 0.89, 0.28, 1) var(--spark-delay) forwards;
}

.daily-victory-headline {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  min-width: min(320px, calc(100% - 28px));
  padding: 14px 18px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(95, 175, 159, 0.22);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 32px rgba(20, 63, 68, 0.12);
  color: #153c41;
  display: grid;
  gap: 2px;
  text-align: center;
  opacity: 0;
  animation: dailyVictoryHeadline 4.4s cubic-bezier(0.18, 0.89, 0.28, 1) forwards;
}

.daily-victory-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #4c8078;
}

.daily-victory-title {
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.02;
}

.daily-victory-detail {
  font-size: 13px;
  color: #2d5b62;
}

@keyframes dailyVictoryAurora {
  0% { opacity: 0; transform: scale(0.94); }
  16% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.06); }
}

@keyframes dailyVictoryRing {
  0% { opacity: 0; transform: scale(0.26); }
  18% { opacity: 0.88; }
  100% { opacity: 0; transform: scale(2.8); }
}

@keyframes dailyVictoryRay {
  0% { opacity: 0; transform: rotate(var(--ray-angle)) scaleY(0.14); }
  24% { opacity: 0.9; }
  100% { opacity: 0; transform: rotate(var(--ray-angle)) scaleY(1.12); }
}

@keyframes dailyVictorySpark {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(var(--spark-rotate)) scale(0.3); }
  18% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate3d(var(--spark-x), var(--spark-y), 0) rotate(calc(var(--spark-rotate) + 120deg)) scale(1);
  }
}

@keyframes dailyVictoryHeadline {
  0% { opacity: 0; transform: translate(-50%, -16px) scale(0.92); }
  16% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  78% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, 8px) scale(0.98); }
}

@keyframes dailyVictoryHexPulse {
  0% {
    filter: saturate(1) brightness(1);
    box-shadow: 0 0 0 rgba(255, 224, 130, 0);
  }
  22% {
    filter: saturate(1.16) brightness(1.04);
    box-shadow: 0 0 0 8px rgba(255, 224, 130, 0.12);
  }
  50% {
    filter: saturate(1.08) brightness(1.01);
    box-shadow: 0 0 0 12px rgba(255, 224, 130, 0.08);
  }
  100% {
    filter: saturate(1) brightness(1);
    box-shadow: 0 0 0 rgba(255, 224, 130, 0);
  }
}

.pangram-confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
  opacity: 1;
  contain: layout paint;
}

.pangram-confetti-layer.fade-out {
  opacity: 0;
  transition: opacity 760ms ease-out;
}

.pangram-confetti-piece {
  position: absolute;
  top: 0;
  left: 0;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
}

.pangram-confetti-piece.round {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

@keyframes pangramConfettiDrop {
  0% {
    opacity: 0;
    transform: translate3d(var(--from-x), var(--from-y), 0) rotate(var(--rot-from));
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(var(--to-x), var(--to-y), 0) rotate(var(--rot-to));
  }
}

@keyframes pangramConfettiBlow {
  0% {
    opacity: 1;
    transform: translate3d(var(--to-x), var(--to-y), 0) rotate(var(--rot-to)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(
        calc(var(--to-x) + var(--blow-x)),
        calc(var(--to-y) + var(--blow-y)),
        0
      )
      rotate(calc(var(--rot-to) + var(--blow-rotate))) scale(var(--blow-scale));
  }
}

.input-caret-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 40px;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 200;
  text-transform: uppercase;
  color: var(--text);
  width: 100%;
  padding: 2px 0;
}

.input-caret-display.is-complete {
  min-height: 72px;
  padding: 10px 14px;
}

.typed-display-complete {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
  text-transform: none;
  width: min(620px, 100%);
  padding: 12px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(238, 252, 246, 0.95) 0%, rgba(255, 241, 206, 0.92) 100%);
  border: 1px solid rgba(95, 175, 159, 0.28);
  box-shadow: 0 10px 28px rgba(25, 86, 90, 0.08);
}

.typed-display-complete .complete-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  color: #183e44;
  line-height: 1.02;
}

.typed-display-complete .complete-detail {
  font-size: 14px;
  font-weight: 500;
  color: #365d64;
  line-height: 1.35;
}

.typed-letter.invalid {
  color: #9eadbd;
}

.input-caret-display .caret {
  color: var(--navy);
  animation: caretBlink 1s steps(1) infinite;
}

.input-caret-display.is-complete .caret {
  display: none;
}

@keyframes caretBlink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.2;
  }
}

.golden-letter-container {
  position: absolute;
  top: calc(50% + var(--hive-shift));
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.regular-letters,
.hive-actions {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hive-actions {
  z-index: 2;
  pointer-events: none;
}

.golden-letter,
.letter-btn,
.hive-action {
  clip-path: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0% 50%);
}

.golden-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--hex-size);
  height: var(--hex-size);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  border: 1px solid #2b4b6e;
  color: white;
  font-size: var(--hex-font);
  font-weight: 300;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  box-shadow:
    0 0 0 2px rgba(22, 50, 79, 0.12),
    0 8px 18px rgba(14, 34, 56, 0.2);
}

.golden-letter.golden-letter-disabled {
  filter: saturate(0.88) brightness(0.95);
  pointer-events: none;
}

.letter-btn {
  position: absolute;
  top: calc(50.5% + var(--hive-shift));
  left: 50%;
  width: var(--hex-size);
  height: var(--hex-size);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e7e7e7;
  border: 1px solid #c6ced7;
  color: var(--navy);
  font-size: var(--hex-font);
  font-weight: 300;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  --scale: 1;
  --radius: var(--hex-radius);
  --angle: -90deg;
  box-shadow: 0 4px 10px rgba(15, 32, 52, 0.12);
  transform: translate(-50%, -53%) rotate(var(--angle)) translate(var(--radius))
    rotate(calc(-1 * var(--angle))) scale(var(--scale));
}

.letter-btn:active {
  --scale: 0.95;
}

.letter-btn:hover {
  background: #dde4ec;
}

.letter-btn:disabled,
.hive-action:disabled {
  cursor: default;
  opacity: 0.58;
  filter: saturate(0.82);
}

.letter-btn:disabled:hover {
  background: #e7e7e7;
}

/* iPad / touch-specific tweaks: prefer manipulation, reduce touch-callout, and avoid unexpected overscroll */
@supports (-webkit-touch-callout: none) {
  html, body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    overscroll-behavior: none;
  }

  /* ensure container doesn't allow accidental scroll on iPad desktop-mode */
  .container {
    overflow: hidden;
    -webkit-overflow-scrolling: auto;
  }
}

.regular-letters .letter-btn:nth-child(1) {
  --angle: -90deg;
}

.regular-letters .letter-btn:nth-child(2) {
  --angle: -30deg;
}

.regular-letters .letter-btn:nth-child(3) {
  --angle: 30deg;
}

.regular-letters .letter-btn:nth-child(4) {
  --angle: 90deg;
}

.regular-letters .letter-btn:nth-child(5) {
  --angle: 150deg;
}

.regular-letters .letter-btn:nth-child(6) {
  --angle: 210deg;
}

.hive-action {
  pointer-events: auto;
  position: absolute;
  top: calc(50% + var(--hive-shift));
  left: 50%;
  width: var(--action-size);
  height: var(--action-size);
  border: none;
  color: white;
  font-weight: 700;
  font-size: calc(var(--hex-font) * 0.38);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  --action-scale: 1;
  transform: translate(-50%, -53%) rotate(var(--action-angle))
    translate(var(--action-radius)) rotate(calc(-1 * var(--action-angle)))
    scale(var(--action-scale));
}

.hive-action:active {
  --action-scale: 0.94;
}

.hive-action.btn-submit {
  --action-angle: 120deg;
  background: var(--success);
}

.hive-action.btn-delete {
  --action-angle: 60deg;
  background: var(--error);
}

.hive-action.btn-mix {
  --action-angle: 90deg;
  --action-radius: calc(var(--hex-radius) * 1.99);
  background: #274f7a;
  font-size: calc(var(--hex-font) * 0.5);
}

.word-input {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 28, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 1000;
}

.modal-backdrop.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.modal-card {
  width: min(460px, 96vw);
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  padding: 16px 14px 14px;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  color: var(--navy);
  font-weight: 700;
}

.modal-card h3 {
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 10px;
}

.modal-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.modal-list li {
  padding-left: 14px;
  position: relative;
  font-size: 14px;
  line-height: 1.35;
  color: #2b3f55;
}

.modal-list li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: #46658b;
}

.pair-btn {
  border: 1px solid var(--gray-300);
  background: white;
  color: var(--navy);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.pair-input {
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  width: 120px;
}

.pair-status {
  min-height: 16px;
  color: var(--gray-500);
  font-size: 12px;
}

.modal-divider {
  border: 0;
  border-top: 1px solid var(--gray-200);
  margin: 10px 0;
}

.auth-section {
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #f9fbfd 0%, #f4f8fc 100%);
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  padding: 12px;
}

.auth-current {
  font-size: 12px;
  color: #3f556d;
  min-height: 16px;
  line-height: 1.4;
  background: #ffffff;
  border: 1px solid #dde7f0;
  border-radius: 8px;
  padding: 7px 10px;
}

.auth-section #authStatus {
  order: -1;
  min-height: 0;
  background: #fff3cd;
  color: #7a4a00;
  border: 1px solid #f2d28a;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.auth-section #authStatus:empty {
  display: none;
}

.auth-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.auth-input {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #c9d6e4;
  padding: 10px 12px;
  background: #fff;
}

.auth-input:focus,
.pair-input:focus {
  outline: none;
  border-color: #2f628d;
  box-shadow: 0 0 0 3px rgba(47, 98, 141, 0.14);
}

#shareModal .modal-card {
  width: min(520px, 96vw);
  border-radius: 14px;
  padding: 18px 16px 14px;
}

#shareModal .modal-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

#authLoginBtn,
#authRegisterBtn,
#authLogoutBtn {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  font-size: 13px;
}

#authLoginBtn,
#authRegisterBtn {
  border-color: #1f4466;
  background: linear-gradient(180deg, #274f7a 0%, #1a395a 100%);
  color: #fff;
}

#authForgotBtn {
  border: 0;
  background: transparent;
  color: #1e4f7c;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  padding: 0;
  justify-self: start;
}

#authForgotBtn:hover {
  text-decoration: underline;
}

#authResetBtn {
  width: 100%;
  min-height: 38px;
}

.auth-reset-row {
  border: 1px solid #d8e3ef;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.auth-reset-row::before {
  content: "Palauta salasana";
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #55708b;
}

.leaderboard-winner {
  font-size: 12px;
  color: #2b3f55;
  background: #f3f7fb;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.leaderboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.leaderboard-col h4 {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.leaderboard-list {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  padding: 6px 8px;
  border-bottom: 1px solid #edf1f5;
}

.leaderboard-item:last-child {
  border-bottom: 0;
}

.leaderboard-rank {
  color: var(--gray-500);
}

.leaderboard-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-score {
  font-weight: 700;
  color: var(--navy);
}

.hints-list {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: auto;
  max-height: 46dvh;
}

.hint-row {
  display: grid;
  grid-template-columns: 48px 70px 1fr;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid #edf1f5;
  font-size: 12px;
}

.hint-row:last-child {
  border-bottom: 0;
}

.hint-prefix {
  font-weight: 800;
  color: var(--navy);
}

.hint-total {
  color: #35587f;
  font-weight: 700;
}

.hint-lengths {
  color: #2b3f55;
}

.hint-row-complete .hint-prefix,
.hint-row-complete .hint-total,
.hint-row-complete .hint-lengths {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.6;
}

.updates-note-meta {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.updates-note-title {
  font-size: 14px;
  font-weight: 700;
  color: #274f7a;
  margin-bottom: 8px;
}

.updates-note-list {
  margin-bottom: 10px;
  max-height: 40dvh;
  overflow-y: auto;
}

.updates-dismiss-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border-color: #1f4466;
  background: linear-gradient(180deg, #274f7a 0%, #1a395a 100%);
  color: #fff;
  font-size: 13px;
}

@media (max-width: 768px) {
  body {
    padding: 4px;
    overflow: hidden;
  }

  body.modal-open {
    overflow: hidden;
  }

  .container,
  main {
    height: calc(100dvh - 8px);
  }

  main {
    padding: 8px;
  }

  .game-wrapper {
    height: 100%;
    gap: 8px;
  }

  .top-menu.words-section.stats-minimal {
    padding: 6px 8px;
  }

  .stats-minimal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .stats-minimal-line {
    gap: 6px;
    flex-wrap: wrap;
    white-space: normal;
    overflow: visible;
    line-height: 1.1;
  }

  .menu-actions {
    justify-content: flex-end;
    width: 100%;
    gap: 5px;
  }

  .stats-label {
    font-size: 11px;
  }

  .stats-value {
    font-size: 15px;
  }

  .progress-text {
    font-size: 12px;
  }

  .words-content {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 50;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 8px;
    box-shadow: var(--shadow);
    max-height: 40dvh;
  }

  .words-list {
    column-count: 2;
  }

  .game-section {
    flex: 1;
    min-height: 0;
  }

  .message {
    height: 30px;
    font-size: 12px;
    padding: 0 10px;
  }

  .letters-container {
    flex: 1;
    min-height: 0;
    --hex-size: 92px;
    --hex-gap: 8px;
    --hex-font: 34px;
    --hive-shift: calc(var(--hex-size) * -0.68);
    --action-radius: calc(var(--hex-radius) * 1.74);
  }

  .input-caret-display {
    min-height: 30px;
    font-size: clamp(20px, 6vw, 28px);
  }
}

@media (max-width: 420px) {
  .letters-container {
    --hex-size: 84px;
    --hex-gap: 7px;
    --hex-font: 30px;
  }

  .icon-btn,
  .words-toggle {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 16px;
  }

  .hints-btn {
    height: 32px;
    border-radius: 9px;
    font-size: 12px;
    padding: 0 10px;
  }

  .words-list {
    column-count: 1;
  }

  .leaderboard-columns {
    grid-template-columns: 1fr;
  }
}


@media (prefers-reduced-motion: reduce) {
  .message.ceremonial,
  .letters-container,
  .letters-container.daily-victory-active .golden-letter,
  .letters-container.daily-victory-active .letter-btn,
  .daily-victory-aurora,
  .daily-victory-ring,
  .daily-victory-ray,
  .daily-victory-spark,
  .daily-victory-headline,
  .pangram-confetti-piece {
    animation: none !important;
    transition: none !important;
  }

  .daily-victory-layer,
  .pangram-confetti-layer {
    display: none !important;
  }
}
