body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #101414;
    color: white;
    margin: 0;
}
button {
  touch-action: manipulation;
}
#board {
    display: grid;
    grid-template-rows: repeat(var(--daily-row-count, 7), 1fr);
    gap: 8px;
    margin: 2px 0 20px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(18, 31, 29, 0.9), rgba(14, 18, 18, 0.72));
    border: 1px solid rgba(94, 132, 116, 0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 12px 24px rgba(0,0,0,0.18);
}

#resultGrid:not(:empty) {
    width: max-content;
    max-width: calc(100vw - 24px);
    margin: 0 auto;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(94, 132, 116, 0.18);
    box-sizing: border-box;
}

:root[data-daily-mode="5"] #board,
:root[data-daily-mode="5"] #resultGrid:not(:empty) {
    background: linear-gradient(160deg, rgba(20, 53, 50, 0.95), rgba(22, 30, 38, 0.82));
    border-color: rgba(88, 177, 159, 0.3);
}

:root[data-daily-mode="6"] #board,
:root[data-daily-mode="6"] #resultGrid:not(:empty) {
    background: linear-gradient(160deg, rgba(34, 35, 28, 0.95), rgba(17, 31, 37, 0.84));
    border-color: rgba(213, 178, 82, 0.24);
}

#board:empty {
    display: none;
}

#board.board--hidden {
    display: none;
}

.row--unused {
    display: none !important;
}

#keyboard.keyboard--finished {
    display: none;
}

#resultScreen {
    margin-top: 12px;
}

#resultScreen.result-screen--locked {
    margin-top: 6px;
}

#resultTitle {
    margin: 8px 12px 12px;
    font-size: 22px;
}

.played-status {
    color: #aaa !important;
    font-size: 13px;
    margin: 0 auto 8px !important;
    padding: 6px 12px;
    max-width: 340px;
}

.played-status h2 {
    display: none;
}

.played-status p {
    margin: 0;
}

.row {
    display: grid;
    grid-template-columns: repeat(var(--daily-word-length, 6), var(--daily-tile-size, 52px));
    gap: var(--daily-tile-gap, 6px);
    justify-content: center;
    perspective: 300px;
}

.play-launcher-grid {
    width: min(560px, calc(100% - 24px));
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(142px, 0.65fr);
    gap: 8px;
    align-items: stretch;
    margin: 8px 12px 12px;
}

.daily-mode-picker {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(83, 141, 78, 0.32);
    border-radius: 8px;
    background: linear-gradient(145deg, #151b1a, #121716);
}

.daily-mode-picker__text {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.daily-mode-picker__label {
    font-size: 12px;
    font-weight: 700;
    color: #d7ead2;
}

.daily-mode-picker__detail {
    font-size: 12px;
    color: #a9b5b2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.daily-mode-picker__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    width: 100%;
}

.daily-mode-picker__actions button {
    flex: 1 1 0;
    min-width: 36px;
    height: 34px;
    border: 1px solid #3f514c;
    border-radius: 6px;
    background: #202927;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.daily-mode-picker__actions button.active {
    background: #538d4e;
    border-color: #76b970;
}

.daily-mode-picker__actions button:disabled {
    opacity: 0.55;
    cursor: default;
}

:root[data-daily-mode="5"] .daily-mode-picker {
    border-color: rgba(88, 177, 159, 0.42);
    background: linear-gradient(145deg, #122522, #16212b);
}

:root[data-daily-mode="5"] .daily-mode-picker__actions button.active {
    background: #4f9b8d;
    border-color: #78cfc0;
}

:root[data-daily-mode="6"] .daily-mode-picker {
    border-color: rgba(213, 178, 82, 0.35);
    background: linear-gradient(145deg, #211f18, #13222a);
}

:root[data-daily-mode="6"] .daily-mode-picker__actions button.active {
    background: #b8943d;
    border-color: #e2c668;
}

.tile {
    width: var(--daily-tile-size, 52px);
    height: var(--daily-tile-height, 50px);
    border: 2px solid #3f514c;
    border-radius: 5px;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: 800;
    background: #1d2624;
    color: white;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.green {
    background: #4f8b67;
}

.orange {
    background: #b8943d;
}

.grey {
    background: #343c3d;
}
#shareImageBtn {
    margin-top: 20px;
    height: 40px;
    width: 200px;
    border-radius: 20px;
    outline: none;
    border: none;
    background: #ffffff;
}
#keyboard {
    display: flex;
    flex-wrap: wrap;
    max-width: 540px;
    justify-content: center;
    gap: 5px;
    padding: 0 8px;
    box-sizing: border-box;
}
.keyboard-row {
    display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 8px;
}
.keyboard-row:last-of-type {
    width: 100%;
}
.key {
    padding: 14px 16px;
    border: none;
    border-radius: 5px;
    background: #52605f;
    color: white;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    width: 44px;
    height: 44px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.key.used {
    background: #3d4847;
}
.key.wide {
  flex: 1 1 100%;
  padding: 10px 0;
  font-size: 20px;
  background: #4f8b67;
  height: 50px;
}
.key.wide:last-of-type {
   background: #653031;
}
#score {
    margin-top: 20px;
}

.key.green {
  background: linear-gradient(180deg, #6daa7c, #4f8b67) !important;
  color: white;
}

.key.orange {
  background: linear-gradient(180deg, #d2ad52, #a98231) !important;
  color: white;
}

.key.grey {
  background: linear-gradient(180deg, #3a4647, #2c3536) !important;
  color: white;
}
#showHintBtn {
width: 140px;
    height: 30px;
    outline: none;
    border-radius: 0;
    border: none;
}
  #resultGrid .row {
      pointer-events: none;
    }

    #hintText {
      color: #ccc;
      font-style: italic;
    }

    button {
      cursor: pointer;
    }
  #stats {
      margin-top: 30px;
     
      background: #1e1e1e;
      
      border-radius: 8px;
      max-width: 300px;
      margin-left: auto;
      margin-right: auto;
    }
    #stats h3 {
      margin-bottom: 10px;
      color: #eee;
    }
    #stats div {
      margin: 4px 0;
      font-size: 16px;
    }
    #stats div:last-child {
      font-weight: bold;
      color: #ccc;
    }
div#stats > * {
    padding: 5px 30px;
}

#showHintBtnModal {
 padding: 6px;
    border-radius: 27px;
    outline: none;
    border: none;
    margin-bottom: 5px;
    background: green;
    color: #fff;
    width: 150px;
    height: 40px;
    box-shadow: 0 0 10px 10px #00000026;
}
@keyframes pop {
  0%   { transform: scale(0); opacity: 0; }
  80%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

#hintIconBtn.pop-animate {
  animation: pop 0.4s ease-out;
}

#leaderboardContent {
    margin-top: 10px;
    text-align: left;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
        margin: auto;
    padding: 15px 25px;
    background: #333;
    box-sizing: border-box;
    border-radius: 20px;
    box-shadow: 0 0 10px 10px #0000003d;
        min-height: 300px;
}
@media only screen and (max-width: 768px) {
    #keyboard {
    flex-wrap: wrap;
    max-width: 100%;
    justify-content: center;
    gap: 2px;
}
    .keyboard-row {
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    width: 100%;
}
.key:not(.key.wide) {
    padding: 0px 0px;
    border: none;
    border-radius: 5px;
    background: #52605f;
    color: white;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    width: 100%;
        max-width: 30px;
    height: 40px;
}
    .keyboard-row:last-of-type {
    width: 100%;
    flex-wrap: nowrap;
    padding: 0 2px;
}
}

/* Add these animations to your CSS */
/* Option 1: Fade-in with slight drop */
@keyframes typeLetter {
  0% { transform: translateY(-10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Option 2: Bounce effect */
@keyframes typeLetter {
  0% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
  75% { transform: translateY(2px); }
  100% { transform: translateY(0); }
}

/* Option 3: Flip reveal */
@keyframes typeLetter {
  0% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

/* Option 4: Pulse with color change */
@keyframes typeLetter {
  0% { background-color: #3f514c; transform: scale(0.95); }
  50% { background-color: #52605f; transform: scale(1.05); }
  100% { background-color: #1d2624; transform: scale(1); }
}

/* Option 5: Slide in from right */
@keyframes typeLetter {
  0% { transform: translateX(10px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* Choose one of the above animations and use it with this class */
.tile-animate {
  animation: typeLetter 0.2s ease-out;
}

@keyframes deleteLetter {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

@keyframes success {
  0% { transform: scale(1); }
  50% { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.row-delete-animate {
  animation: deleteLetter 0.15s ease-in-out;
}

.success-animate {
  animation: success 0.5s ease-in-out;
}

/* Fireworks animation */
.firework {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 80%, rgba(0,0,0,0.6) 100%);
}

.firework-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  box-shadow: 0 0 6px 1px rgba(255,255,255,0.9);
  animation: firework-explode 1s ease-out forwards;
}

@keyframes firework-explode {
  0% {
    transform: translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty));
    opacity: 0;
  }
}

/* Toast notification */
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  white-space: nowrap;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Shake animation for invalid input */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.shake {
  animation: shake 0.4s ease-in-out;
}

/* Profile modal */
.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  margin: 0 auto 10px;
}
.profile-title {
  text-align: center;
  color: #f0c95a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: -1px 0 10px;
}
.profile-season-countdown {
  text-align: center;
  color: #9fbf8f;
  font-size: 12px;
  margin: -6px 0 10px;
}
.profile-trophies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 0 0 12px;
}
.profile-trophies span {
  background: #312812;
  border: 1px solid #f0c95a44;
  border-radius: 999px;
  color: #f4d879;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
}
.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.profile-stats-grid--career {
  grid-template-columns: 1fr 1fr;
}
.profile-stats-grid--season {
  grid-template-columns: 1fr 1fr;
}
.profile-stats-heading {
  color: #aaa;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin: 12px 0 -5px;
  text-transform: uppercase;
}
.profile-stat-item {
  background: #333;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 6px;
  text-align: center;
}
.profile-stat-item--points {
  background: linear-gradient(145deg, #3b3218, #2a261a);
  border-color: #b59f3b66;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 12px rgba(181,159,59,0.12);
}
.profile-stat-item--average {
  background: linear-gradient(145deg, #17301f, #202b21);
  border-color: #538d4e70;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 12px rgba(83,141,78,0.14);
}
.profile-stat-item--points .profile-stat-value {
  color: #f4d879;
}
.profile-stat-item--average .profile-stat-value {
  color: #9fd29a;
}
.profile-stat-item--points .profile-stat-label,
.profile-stat-item--average .profile-stat-label {
  color: #d6d0b8;
}
.profile-stat-value {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
}
.profile-stat-label {
  font-size: 10px;
  color: #888;
  margin-top: 3px;
}

/* Loading screen */
#loadingScreen {
  position: fixed;
  inset: 0;
  background: #121212;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
#loadingScreen.fade-out {
  opacity: 0;
  pointer-events: none;
}

@keyframes loadingTileIn {
  0%   { transform: scale(0) rotateX(90deg); opacity: 0; }
  65%  { transform: scale(1.18) rotateX(0deg); opacity: 1; }
  100% { transform: scale(1) rotateX(0deg); opacity: 1; }
}

.loading-tile {
  width: 50px;
  height: 50px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  opacity: 0;
  animation: loadingTileIn 0.5s ease forwards;
}

@keyframes loadingDotPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.75); }
  40%           { opacity: 1;    transform: scale(1); }
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #538d4e;
  animation: loadingDotPulse 1.2s ease-in-out infinite;
}

/* Tile flip animation */
@keyframes tileFlip {
  0%   { transform: rotateX(0deg) scale(1);     animation-timing-function: ease-in; }
  50%  { transform: rotateX(-90deg) scale(0.96); animation-timing-function: ease-out; }
  100% { transform: rotateX(0deg) scale(1); }
}

.tile.flipping {
  animation: tileFlip 0.42s linear forwards;
  border-color: #697b77;
}

.tile.green  { border-color: #4f8b67; }
.tile.orange { border-color: #b8943d; }
.tile.grey   { border-color: #343c3d; }

/* ── Day Hero ────────────────────────────────────────── */
#dayHeroSection { padding: 4px 12px 8px; width: 100%; box-sizing: border-box; max-width: 360px; margin: 0 auto; }
.day-hero-list { display: grid; gap: 8px; }

.day-hero-card {
  background: linear-gradient(135deg, #1f1800 0%, #2a2000 100%);
  border: 1px solid #ffd70033;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 0 12px rgba(255,215,0,0.08);
}
.day-hero-label {
  font-size: 11px;
  font-weight: bold;
  color: #ffd700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.day-hero-body {
  display: flex;
  align-items: center;
  gap: 10px;
}
.day-hero-info { flex: 1; min-width: 0; }
.day-hero-name { font-size: 15px; font-weight: bold; color: #fff; }
.day-hero-sub { font-size: 12px; color: #aaa; margin-top: 2px; }
.day-hero-streak { font-size: 11px; color: #ff9500; margin-top: 4px; font-weight: bold; }

/* ── Leaderboard ──────────────────────────────────────── */
.lb-tab { padding:6px 14px;border:none;border-radius:20px;cursor:pointer;font-size:13px;background:#333;color:#aaa;transition:background 0.15s,color 0.15s; }
.lb-tab.active { background:#538d4e;color:#fff;font-weight:bold; }
.lb-tab.hof-tab { background:#4a3200;color:#ffd700; }
.lb-tab.hof-tab.active { background:#7a5200;outline:1px solid #ffd70055; }

.lb-row { display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:8px;margin-bottom:4px;transition:background 0.1s; }
.lb-row:hover { background:#2a2a2a; }
.lb-you { background:#1a2e1a !important;outline:1px solid #538d4e44; }
.lb-top1 { background:#1f1a00; }
.lb-top2 { background:#181818; }
.lb-top3 { background:#141210; }
.lb-rank-num { width:30px;text-align:center;font-size:13px;color:#555;flex-shrink:0; }
.lb-avatar { width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:bold;color:#fff;flex-shrink:0; }
.lb-name { flex:1;font-size:14px;font-weight:bold;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.lb-name-you { color:#6abf69; }
.lb-score { font-size:12px;color:#888;text-align:right;flex-shrink:0;line-height:1.4; }
.lb-score strong { color:#fff;font-size:15px;display:block; }
.lb-score strong small { font-size:11px;color:#aaa;font-weight:normal; }
.lb-season-label { font-size:11px;color:#666;text-align:center;margin-bottom:12px;letter-spacing:0.5px;text-transform:uppercase; }
.lb-season-countdown { font-size:12px;color:#9fbf8f;text-align:center;margin:-6px 0 12px; }
.lb-your-rank { margin-top:12px;padding:8px;background:#1a2e1a;border-radius:8px;font-size:13px;color:#6abf69;text-align:center; }
.lb-hof-season { font-size:11px;font-weight:bold;color:#ffd700;letter-spacing:0.5px;padding:12px 0 6px;border-bottom:1px solid #333;margin-bottom:4px; }
.lb-hof-season:first-child { padding-top:0; }

/* ── Keyboard action buttons ──────────────────────────── */
.key-enter { background:#4f8b67 !important;color:#fff !important; }
.key-enter:active { background:#3e7654 !important; }
.key-delete { background:#653031 !important;color:#ffd1d1 !important; }
.key-delete:active { background:#4d2223 !important; }
.delete-key-icon {
  width: 30px;
  height: 22px;
  display: block;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.18));
}

/* ── Modal close button ───────────────────────────────── */
.modal-close { position:absolute;top:12px;right:12px;width:28px;height:28px;border-radius:50%;border:none;background:rgba(255,255,255,0.08);color:#bbb;font-size:13px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background 0.15s,color 0.15s; }
.modal-close:hover { background:rgba(255,255,255,0.2);color:#fff; }

/* ── Emoji avatar picker ──────────────────────────────── */
.emoji-picker-grid { display:flex;flex-wrap:wrap;gap:5px;justify-content:center;padding:8px 4px 4px; }
.emoji-opt { font-size:22px;padding:5px;border-radius:8px;cursor:pointer;border:2px solid transparent;transition:border-color 0.1s,background 0.1s;line-height:1; }
.emoji-opt:hover,.emoji-opt.selected { border-color:#538d4e;background:#1a2e1a; }
.profile-avatar { cursor:pointer; }

/* Weekly challenge */
.weekly-card {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #2f5f70;
  border-radius: 8px;
  background: linear-gradient(135deg, #14262c 0%, #221f16 100%);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 7px;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.weekly-card:hover,
.weekly-card:focus-visible {
  border-color: #f4d879;
  box-shadow: 0 10px 26px rgba(0,0,0,0.26), 0 0 0 1px rgba(244,216,121,0.25);
  transform: translateY(-1px);
}
.weekly-card:focus-visible {
  outline: 2px solid #f4d879;
  outline-offset: 3px;
}
.weekly-card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.weekly-card__body strong {
  font-size: 12px;
  line-height: 1.2;
}
.weekly-card__identity {
  gap: 6px;
}
.weekly-card__tiles {
  display: grid;
  grid-template-columns: repeat(4, 20px);
  gap: 3px;
}
.weekly-card__tiles > span {
  width: 20px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 5px;
  background: rgba(8, 14, 16, 0.48);
  color: #f7faf7;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.weekly-card__tiles > span:nth-child(1) {
  background: rgba(83, 141, 78, 0.86);
  border-color: rgba(118, 185, 112, 0.62);
}
.weekly-card__tiles > span:nth-child(2) {
  background: rgba(181, 159, 59, 0.88);
  border-color: rgba(226, 198, 104, 0.62);
}
.weekly-card__tiles > span:nth-child(3),
.weekly-card__tiles > span:nth-child(4) {
  background: rgba(58, 68, 66, 0.9);
}
.weekly-card__aside {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
}
.weekly-card__meta {
  color: #121212;
  background: #f4d879;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 700;
  margin: 0;
  text-align: left;
  white-space: nowrap;
}

.weekly-card__aside .weekly-card__meta {
  margin-top: 0;
}
.weekly-card--completed .weekly-card__aside {
  display: none;
}
.weekly-modal {
  position: fixed;
  inset: 0;
  z-index: 1002;
  background: rgba(0,0,0,0.72);
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.weekly-modal__panel {
  width: min(430px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: #1b1b1d;
  border: 1px solid #34383b;
  border-radius: 12px;
  color: #fff;
  padding: 20px 16px 18px;
  position: relative;
  box-shadow: 0 18px 50px rgba(0,0,0,0.48);
}
.weekly-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 32px;
  margin-bottom: 10px;
}
.weekly-modal__header h2 {
  margin: 0;
  color: #7fd3e6;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
}
.weekly-meta,
.weekly-status {
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
}
.weekly-meta {
  color: #9ba6aa;
  margin-bottom: 8px;
}
.weekly-status {
  color: #d5cfb8;
  min-height: 18px;
  margin-bottom: 12px;
}
.weekly-board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 7px;
  justify-content: center;
  margin: 0 auto 16px;
}
.weekly-row {
  display: grid;
  grid-template-columns: repeat(4, 54px);
  gap: 6px;
  justify-content: center;
  perspective: 300px;
}
.weekly-tile {
  width: 54px;
  height: 52px;
  border: 2px solid #44484c;
  background: #242629;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  font-weight: 800;
  text-transform: uppercase;
}
.weekly-tile.flipping {
  animation: tileFlip 0.42s linear forwards;
  border-color: #666;
}
.weekly-tile.green,
.weekly-key.green {
  background: #538d4e !important;
  border-color: #538d4e;
}
.weekly-tile.orange,
.weekly-key.orange {
  background: #b59f3b !important;
  border-color: #b59f3b;
}
.weekly-tile.grey,
.weekly-key.grey {
  background: #3a3a3c !important;
  border-color: #3a3a3c;
}
.weekly-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.weekly-keyboard--finished {
  display: none;
}
.weekly-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  width: 100%;
}
.weekly-key {
  width: 31px;
  height: 42px;
  border: none;
  border-radius: 4px;
  background: #5b6166;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 0;
}
.weekly-key-wide {
  width: 46%;
  font-size: 20px;
}
.weekly-key-enter {
  background: #2f7d6b;
}
.weekly-key-delete {
  background: #633030;
  color: #ffd1d1;
}
.weekly-result {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #2f5f70;
  border-radius: 8px;
  background: #14262c;
  text-align: center;
}
.weekly-result-title {
  font-size: 16px;
  font-weight: 800;
}
.weekly-result-subtitle {
  color: #d5cfb8;
  font-size: 13px;
  margin-top: 4px;
}
.weekly-primary-btn {
  margin-top: 12px;
  border: none;
  border-radius: 8px;
  background: #f4d879;
  color: #1b1b1d;
  font-weight: 800;
  padding: 10px 12px;
}
.profile-stats-grid--weekly {
  grid-template-columns: 1fr 1fr;
}
.profile-stat-item--weekly {
  background: linear-gradient(145deg, #132a31, #252419);
  border-color: #2f5f7070;
}
.profile-stat-item--weekly .profile-stat-value {
  color: #7fd3e6;
}

/* Shared popup refresh */
#statsModal,
#hintModal,
#loginModal,
#profileModal,
#leaderboardModal,
#helpModal {
  background: rgba(0, 0, 0, 0.74) !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  animation: modalOverlayIn 0.18s ease-out both;
}

#statsModal > div,
#hintModal > div,
#loginModal > div,
#profileModal > div,
#leaderboardModal > div,
#helpModal > div {
  background: linear-gradient(180deg, #1d2424 0%, #171919 100%) !important;
  border: 1px solid #344542 !important;
  border-radius: 12px !important;
  color: #fff !important;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04) !important;
  transform-origin: center 42%;
  animation: modalPanelIn 0.24s cubic-bezier(0.18, 0.86, 0.36, 1) both;
}

#statsModal > div,
#hintModal > div,
#loginModal > div {
  width: min(340px, 92vw) !important;
  padding: 24px 20px !important;
}

#profileModal > div {
  width: min(360px, 92vw) !important;
  padding: 24px 20px !important;
}

#leaderboardModal > div,
#helpModal > div {
  width: min(520px, 94vw) !important;
  padding: 24px 20px 26px !important;
}

#statsModal h3,
#loginModal h3,
#helpModal h2,
#leaderboardModal h2 {
  color: #fff !important;
  letter-spacing: 0;
}

#loginModal p,
#helpModal p,
#helpModal li,
#hintModalText,
#statsContent,
#leaderboardContent {
  color: #d5dbd8 !important;
}

:root[data-daily-mode="5"] .daily-hint-help {
  display: none;
}

#loginModal label {
  color: #9fb0ac !important;
  font-weight: 700 !important;
}

#loginEmail,
#loginUsername,
#otpCode,
#profileUsernameInput {
  background: #182221 !important;
  border: 1px solid #3f514c !important;
  border-radius: 8px !important;
  color: #fff !important;
  outline: none !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04) !important;
}

#loginEmail:focus,
#loginUsername:focus,
#otpCode:focus,
#profileUsernameInput:focus {
  border-color: #7fd3e6 !important;
  box-shadow: 0 0 0 2px rgba(127,211,230,0.14), inset 0 1px 0 rgba(255,255,255,0.04) !important;
}

#sendMagicLinkBtn,
#verifyOtpBtn,
#profileSaveBtn,
#showHintBtnModal {
  background: #4f8b67 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 800 !important;
  box-shadow: 0 8px 18px rgba(79,139,103,0.18) !important;
}

#resendCodeBtn {
  color: #8ea09c !important;
}

#profileSignOutBtn {
  background: #4d2223 !important;
  color: #ffd1d1 !important;
  border-radius: 8px !important;
  font-weight: 800 !important;
}

#shareImageBtn {
  background: #f4d879 !important;
  color: #191816 !important;
  border-radius: 8px !important;
  font-weight: 800 !important;
  box-shadow: 0 8px 18px rgba(244,216,121,0.14) !important;
}

#statsContent > div:first-child,
#leaderboardContent {
  background: #172120 !important;
  border: 1px solid #31443f !important;
  border-radius: 8px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035) !important;
}

#leaderboardContent {
  padding: 14px !important;
}

.lb-tab {
  background: #25302f !important;
  color: #b8c4c0 !important;
  border-radius: 8px !important;
}

.lb-tab.active {
  background: #4f8b67 !important;
  color: #fff !important;
}

.lb-tab.hof-tab {
  background: #332d18 !important;
  color: #f4d879 !important;
}

.lb-tab.hof-tab.active {
  background: #4a3d1e !important;
  outline: 1px solid rgba(244,216,121,0.32) !important;
}

.lb-row {
  border-radius: 8px !important;
}

.lb-row:hover {
  background: #202b2a !important;
}

.lb-you {
  background: #172b22 !important;
  outline: 1px solid rgba(79,139,103,0.34) !important;
}

.profile-avatar {
  border: 1px solid rgba(127,211,230,0.22);
  box-shadow: 0 0 0 4px rgba(127,211,230,0.05);
}

.profile-stat-item {
  background: #1f2928;
  border: 1px solid #31443f;
}

.emoji-opt:hover,
.emoji-opt.selected {
  border-color: #7fd3e6;
  background: #14262c;
}

.weekly-modal {
  animation: modalOverlayIn 0.18s ease-out both;
}

.weekly-modal__panel {
  transform-origin: center 42%;
  animation: modalPanelIn 0.24s cubic-bezier(0.18, 0.86, 0.36, 1) both;
}

@keyframes modalOverlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalPanelIn {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.006);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #statsModal,
  #hintModal,
  #loginModal,
  #profileModal,
  #leaderboardModal,
  #helpModal,
  .weekly-modal,
  #statsModal > div,
  #hintModal > div,
  #loginModal > div,
  #profileModal > div,
  #leaderboardModal > div,
  #helpModal > div,
  .weekly-modal__panel {
    animation: none !important;
  }
}

@media only screen and (max-width: 600px) {
  .play-launcher-grid {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 0.42fr);
    gap: 6px;
  }
  .daily-mode-picker {
    padding: 9px 10px;
    gap: 8px;
  }
  .daily-mode-picker__actions {
    gap: 5px;
  }
  .daily-mode-picker__actions button {
    min-width: 33px;
    height: 44px;
  }
  .daily-mode-picker__detail {
    font-size: 11px;
  }
  .weekly-card {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 9px 10px;
  }
  .weekly-card__aside {
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
  }
  .weekly-card__meta {
    white-space: nowrap;
    line-height: 1.1;
  }
}

@media only screen and (max-width: 420px) {
  :root {
    --daily-tile-size: min(48px, calc((100vw - 52px) / var(--daily-word-length, 6)));
    --daily-tile-height: var(--daily-tile-size);
    --daily-tile-gap: 5px;
  }
  .tile {
    font-size: 22px;
  }
  .play-launcher-grid {
    width: min(560px, calc(100% - 16px));
    margin: 8px 8px 12px;
    grid-template-columns: minmax(0, 1fr) minmax(104px, 0.36fr);
  }
  .daily-mode-picker__label,
  .weekly-card__body strong {
    font-size: 11px;
  }
  .daily-mode-picker__actions button {
    min-width: 30px;
    height: 42px;
    font-size: 13px;
  }
  .weekly-card__identity {
    gap: 5px;
  }
  .weekly-card__tiles {
    grid-template-columns: repeat(4, 17px);
    gap: 2px;
  }
  .weekly-card__tiles > span {
    width: 17px;
    height: 19px;
    border-radius: 4px;
    font-size: 9px;
  }
  .weekly-card__meta {
    font-size: 9px;
    padding: 4px 6px;
  }
  .weekly-row {
    grid-template-columns: repeat(4, 48px);
  }
  .weekly-tile {
    width: 48px;
    height: 46px;
    font-size: 22px;
  }
  .weekly-key {
    width: 28px;
    height: 40px;
  }
  .weekly-key-wide {
    width: 45%;
  }
}

@media only screen and (max-width: 480px) {
  #keyboard {
    --mobile-key-gap: 3px;
    width: 100%;
    max-width: 100%;
    padding: 0 6px 10px;
    overflow: hidden;
  }

  .keyboard-row {
    flex-wrap: nowrap !important;
    gap: var(--mobile-key-gap) !important;
    width: 100%;
    padding: 0 !important;
    box-sizing: border-box;
  }

  .key:not(.key.wide) {
    flex: 0 0 min(31px, calc((100vw - 54px) / 11)) !important;
    width: min(31px, calc((100vw - 54px) / 11)) !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 42px !important;
    padding: 0 !important;
    font-size: 15px;
  }

  .key.wide {
    min-width: 0;
  }
}

@media only screen and (max-width: 380px) {
  #keyboard {
    --mobile-key-gap: 2px;
    padding-inline: 5px;
  }

  .key:not(.key.wide) {
    flex-basis: min(29px, calc((100vw - 42px) / 11)) !important;
    width: min(29px, calc((100vw - 42px) / 11)) !important;
    height: 40px !important;
    font-size: 14px;
  }

  .profile-stats-grid--daily-modes {
    gap: 6px;
  }

  .profile-stats-grid--daily-modes .profile-stat-item {
    padding: 8px 3px;
  }

  .profile-stats-grid--daily-modes .profile-stat-label {
    font-size: 8px;
  }
}

/* Compact profile popup */
#profileModal {
  padding: 10px !important;
}

#profileModal > .profile-modal__panel {
  width: min(340px, 94vw) !important;
  max-height: calc(100svh - 20px) !important;
  padding: 14px 16px !important;
}

#profileModal .profile-avatar {
  width: 44px;
  height: 44px;
  margin: 0 auto 4px;
  font-size: 18px;
}

#profileModal .profile-avatar-hint {
  margin: -2px 0 4px !important;
  font-size: 9px !important;
}

#profileModal .profile-name-row {
  margin-bottom: 2px !important;
  line-height: 1.1;
}

#profileModal #profileUsernameDisplay {
  font-size: 16px !important;
}

#profileModal #profileEditBtn {
  min-width: 22px !important;
  height: 22px !important;
  margin-left: 3px !important;
  padding: 0 !important;
  font-size: 12px !important;
}

#profileModal .profile-title {
  margin: 0 0 5px;
  font-size: 10px;
  line-height: 1.1;
}

#profileModal #profileRank {
  margin-bottom: 6px !important;
  font-size: 11px !important;
  line-height: 1.1;
}

#profileModal .profile-season-countdown {
  margin: -3px 0 5px;
  font-size: 10px;
  line-height: 1.1;
}

#profileModal .profile-trophies {
  gap: 4px;
  margin-bottom: 6px;
}

#profileModal .profile-trophies span {
  padding: 3px 6px;
  font-size: 9px !important;
}

#profileModal .profile-stats-heading {
  margin: 7px 0 -2px;
  font-size: 9px;
  line-height: 1;
}

#profileModal .profile-stats-grid {
  gap: 5px;
  margin: 7px 0;
}

#profileModal .profile-stat-item {
  min-width: 0;
  padding: 5px 3px;
  border-radius: 7px;
}

#profileModal .profile-stat-value {
  font-size: 16px;
  line-height: 1;
}

#profileModal .profile-stat-label {
  margin-top: 2px;
  font-size: 8px;
  line-height: 1.1;
}

#profileModal .profile-stats-grid--weekly {
  gap: 5px;
  margin: 6px 0;
}

#profileModal .profile-stat-item--weekly {
  padding: 4px;
}

#profileModal .profile-stat-item--weekly .profile-stat-value {
  font-size: 15px;
}

#profileModal .profile-season-history__title {
  margin: 7px 0 3px;
  color: #aaa;
  font-size: 9px;
}

#profileModal .profile-season-history__row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px solid #333;
  font-size: 9px;
}

#profileModal #profileSignOutBtn {
  height: 30px !important;
  margin-top: 6px !important;
  padding: 6px !important;
  font-size: 12px !important;
}

/* Master visual polish */
:root {
  --app-bg: #0b1110;
  --panel: rgba(18, 27, 26, 0.88);
  --panel-strong: rgba(24, 35, 33, 0.94);
  --line: rgba(187, 216, 202, 0.14);
  --line-strong: rgba(187, 216, 202, 0.28);
  --text: #f2f6f3;
  --muted: #9eadab;
  --green: #5f9f72;
  --green-strong: #72bc86;
  --gold: #e0bd5a;
  --gold-strong: #f4d879;
  --teal: #6ec8b9;
  --red: #7c3537;
  --tile-grey: #303b3c;
  --shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.28);
  --shadow-tight: 0 10px 24px rgba(0, 0, 0, 0.24);
}

html {
  background: var(--app-bg);
}

body {
  min-height: 100svh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(15, 26, 24, 0.94) 0%, rgba(8, 12, 13, 0.98) 48%, #080b0c 100%),
    linear-gradient(135deg, rgba(52, 37, 20, 0.28), rgba(15, 50, 53, 0.16) 48%, rgba(57, 19, 25, 0.16));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 72%);
  opacity: 0.35;
}

#topBar {
  width: min(560px, calc(100% - 24px)) !important;
  box-sizing: border-box !important;
  position: relative;
  z-index: 100;
  overflow: visible;
  margin: max(8px, env(safe-area-inset-top)) auto 10px !important;
  padding: 10px 10px !important;
  background: rgba(15, 20, 20, 0.82) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-tight), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(14px);
}

#topBar > div:first-child > div:first-child {
  gap: 8px !important;
  margin-right: 6px !important;
}

#topBar > div:first-child,
#topBar > div:last-child {
  gap: 10px !important;
}

#topBar span {
  font-size: 14px !important;
  letter-spacing: 1.2px !important;
}

#topBar button {
  width: auto !important;
  min-width: 28px !important;
  height: 32px !important;
  padding: 0 2px !important;
  border-radius: 0 !important;
  color: var(--text) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.16s ease, opacity 0.16s ease, filter 0.16s ease;
}

#topBar button:hover,
#topBar button:focus-visible {
  transform: translateY(-1px);
  background: transparent !important;
  filter: brightness(1.12);
  outline: none;
}

.top-icon {
  width: 23px;
  height: 23px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #dce6e2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.22));
}

#helpBtn .top-icon,
#hintIconBtn .top-icon {
  color: #93d7e8;
}

#signInBtn .top-icon {
  color: #d9e2de;
}

.top-icon--trophy {
  color: #f4d879;
}

.top-icon--chart {
  color: #8ed1a0;
}

.games-menu {
  position: relative;
  display: inline-flex;
}

#gamesMenuBtn {
  color: #93d7e8 !important;
}

.games-menu__icon {
  width: 21px;
  height: 16px;
  position: relative;
  display: block;
}

.games-menu__icon > span {
  height: 2px;
  position: absolute;
  left: 1px;
  right: 1px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  transition: top 0.2s ease, bottom 0.2s ease, transform 0.2s ease;
}

.games-menu__icon > span:first-child {
  top: 4px;
}

.games-menu__icon > span:last-child {
  bottom: 4px;
}

#gamesMenuBtn[aria-expanded="true"] .games-menu__icon > span:first-child {
  top: 7px;
  transform: rotate(45deg);
}

#gamesMenuBtn[aria-expanded="true"] .games-menu__icon > span:last-child {
  bottom: 7px;
  transform: rotate(-45deg);
}

.games-menu__panel {
  width: 210px;
  box-sizing: border-box;
  position: absolute;
  z-index: 110;
  top: calc(100% + 10px);
  right: -4px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(18, 27, 26, 0.98);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.64), 0 0 0 1px rgba(143, 215, 202, 0.04);
  backdrop-filter: blur(16px);
  animation: games-menu-in 0.16s ease-out;
}

@keyframes games-menu-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.games-menu__panel[hidden] {
  display: none;
}

.games-menu__title {
  display: block;
  padding: 2px 4px 8px;
  color: var(--muted);
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
}

.games-menu__item {
  display: grid;
  gap: 2px;
  padding: 10px 11px;
  border: 1px solid rgba(110, 200, 185, 0.18);
  border-radius: 9px;
  color: var(--text);
  background: rgba(110, 200, 185, 0.08);
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.games-menu__item + .games-menu__item {
  margin-top: 8px;
}

.games-menu__item:hover,
.games-menu__item:focus-visible {
  border-color: rgba(143, 215, 202, 0.42);
  background: rgba(110, 200, 185, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.games-menu__item span {
  color: var(--muted);
  font-size: 10px !important;
  font-weight: 700;
  letter-spacing: 0.03em !important;
}

.games-menu__item strong {
  color: #8fd7ca;
  font-size: 14px;
  line-height: 1.2;
}

:root.daily-mode-loading #board,
:root.daily-mode-loading #keyboard,
:root.daily-mode-loading #resultScreen {
  display: none !important;
}

.daily-mode-loader {
  display: none;
  width: min(560px, calc(100% - 24px));
  min-height: clamp(260px, 46vh, 420px);
  margin: 8px auto 14px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 28%, rgba(83, 141, 78, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(20, 31, 30, 0.92), rgba(9, 14, 14, 0.92));
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

:root.daily-mode-loading .daily-mode-loader {
  display: flex;
}

.daily-mode-loader__logo,
.daily-mode-loader__dots {
  display: flex;
  align-items: center;
  justify-content: center;
}

.daily-mode-loader__logo {
  gap: 8px;
}

.daily-mode-loader__tile {
  width: 54px;
  height: 54px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 12px 26px rgba(0, 0, 0, 0.3);
  animation: dailyModeLogoTile 0.9s ease-in-out infinite;
}

.daily-mode-loader__tile--green {
  background: linear-gradient(180deg, #6aa56e, #538d4e);
}

.daily-mode-loader__tile--gold {
  background: linear-gradient(180deg, #d1b65c, #b59f3b);
  animation-delay: 0.12s;
}

.daily-mode-loader__tile--grey {
  background: linear-gradient(180deg, #4b5354, #303638);
  animation-delay: 0.24s;
}

.daily-mode-loader__dots {
  gap: 7px;
}

.daily-mode-loader__dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7db886;
  animation: dailyModeDotPulse 0.9s ease-in-out infinite;
}

.daily-mode-loader__dots span:nth-child(2) {
  animation-delay: 0.15s;
  background: #b59f3b;
}

.daily-mode-loader__dots span:nth-child(3) {
  animation-delay: 0.3s;
  background: #798384;
}

@keyframes dailyModeLogoTile {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: brightness(0.95);
  }
  45% {
    transform: translateY(-7px) scale(1.04);
    filter: brightness(1.16);
  }
}

@keyframes dailyModeDotPulse {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.72);
  }
  45% {
    opacity: 1;
    transform: scale(1);
  }
}

#guestBanner {
  width: min(560px, calc(100% - 24px)) !important;
  border: 1px solid rgba(244, 216, 121, 0.2) !important;
  border-radius: 10px !important;
  background: rgba(43, 35, 12, 0.55) !important;
  color: #f1d985 !important;
  margin: -2px auto 8px !important;
}

.play-launcher-grid {
  width: min(560px, calc(100% - 24px));
  gap: 10px;
  margin: 0 auto 14px;
}

.daily-mode-picker,
.weekly-card {
  min-height: 96px;
  border-radius: 14px;
  border-color: var(--line);
  box-shadow: var(--shadow-tight), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  overflow: hidden;
  position: relative;
}

.daily-mode-picker::after,
.weekly-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), transparent 42%);
  opacity: 0.55;
}

.daily-mode-picker__label,
.weekly-card__body strong {
  color: #f7faf7;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.1;
}

.daily-mode-picker__detail {
  color: var(--muted);
}

.daily-mode-picker__actions {
  position: relative;
  z-index: 1;
}

.daily-mode-picker__actions button {
  height: 48px;
  border-radius: 12px;
  font-size: 16px;
  background: rgba(9, 14, 14, 0.42);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.055);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.daily-mode-picker__actions button:hover:not(:disabled),
.daily-mode-picker__actions button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
  outline: none;
}

.daily-mode-picker__actions button.is-rolling {
  animation: dailyDiceRoll 0.38s ease both;
}

@keyframes dailyDiceRoll {
  0% { transform: rotate(0deg) scale(1); }
  35% { transform: rotate(-12deg) scale(1.06); }
  70% { transform: rotate(12deg) scale(1.06); }
  100% { transform: rotate(0deg) scale(1); }
}

:root[data-daily-mode="5"] .daily-mode-picker {
  background:
    linear-gradient(145deg, rgba(15, 47, 43, 0.96), rgba(17, 28, 37, 0.96)),
    linear-gradient(90deg, rgba(110, 200, 185, 0.16), transparent);
  border-color: rgba(110, 200, 185, 0.34);
}

:root[data-daily-mode="6"] .daily-mode-picker {
  background:
    linear-gradient(145deg, rgba(39, 34, 23, 0.97), rgba(15, 31, 38, 0.96)),
    linear-gradient(90deg, rgba(181, 159, 59, 0.18), transparent);
  border-color: rgba(181, 159, 59, 0.36);
}

:root[data-daily-mode="5"] .daily-mode-picker__actions button.active {
  color: #071816;
  background: linear-gradient(180deg, #8ee0d3, #5fb8a9);
  border-color: rgba(142, 224, 211, 0.88);
  box-shadow: 0 8px 18px rgba(95, 184, 169, 0.22);
}

:root[data-daily-mode="6"] .daily-mode-picker__actions button.active {
  color: #171205;
  background: linear-gradient(180deg, #d1b65c, #b59f3b);
  border-color: rgba(181, 159, 59, 0.9);
  box-shadow: 0 8px 18px rgba(181, 159, 59, 0.24);
}

.weekly-card {
  background:
    linear-gradient(145deg, rgba(16, 37, 45, 0.96), rgba(42, 34, 18, 0.96)),
    linear-gradient(90deg, rgba(127, 211, 230, 0.12), rgba(244, 216, 121, 0.10));
  border-color: rgba(127, 211, 230, 0.24);
  padding-block: 8px;
}

.weekly-card:hover,
.weekly-card:focus-visible {
  border-color: rgba(244, 216, 121, 0.58);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(244, 216, 121, 0.18);
}

.weekly-card__meta {
  border-radius: 8px;
  color: #19170f;
  background: linear-gradient(180deg, #f8dd7f, #d9b354);
  box-shadow: 0 8px 16px rgba(244, 216, 121, 0.16);
}

#board,
#resultGrid:not(:empty) {
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,0.055);
}

:root[data-daily-mode="5"] #board,
:root[data-daily-mode="5"] #resultGrid:not(:empty) {
  background:
    linear-gradient(160deg, rgba(17, 58, 53, 0.92), rgba(14, 24, 32, 0.88)),
    linear-gradient(90deg, rgba(110, 200, 185, 0.12), transparent);
  border-color: rgba(110, 200, 185, 0.26);
}

:root[data-daily-mode="6"] #board,
:root[data-daily-mode="6"] #resultGrid:not(:empty) {
  background:
    linear-gradient(160deg, rgba(43, 37, 24, 0.93), rgba(13, 28, 35, 0.88)),
    linear-gradient(90deg, rgba(181, 159, 59, 0.13), transparent);
  border-color: rgba(181, 159, 59, 0.28);
}

.row {
  gap: var(--daily-tile-gap, 6px);
}

.tile {
  border-radius: 9px;
  border-color: rgba(211, 231, 221, 0.18);
  background: linear-gradient(180deg, #253231, #182120);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    inset 0 -8px 16px rgba(0, 0, 0, 0.14);
}

.tile.green {
  background: linear-gradient(180deg, #6daa7c, #4f8b67);
  border-color: rgba(157, 220, 170, 0.45);
}

.tile.orange {
  background: linear-gradient(180deg, #d2ad52, #a98231);
  border-color: rgba(244, 216, 121, 0.5);
}

.tile.grey {
  background: linear-gradient(180deg, #3a4647, #2c3536);
  border-color: rgba(185, 199, 197, 0.16);
}

#keyboard {
  width: min(560px, 100%);
  gap: 6px;
  padding: 0 10px 10px;
}

.keyboard-row {
  width: 100%;
  gap: 6px;
}

.key {
  height: 46px;
  border-radius: 9px;
  background: linear-gradient(180deg, #566765, #445150);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 5px 12px rgba(0,0,0,0.12);
  transition: transform 0.08s ease, filter 0.08s ease, background 0.14s ease;
}

.key:active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.95);
}

.key.wide {
  border-radius: 10px;
  background: linear-gradient(180deg, #639f72, #4c815e);
}

.key.wide:last-of-type {
  background: linear-gradient(180deg, #814245, #663032);
}

#resultScreen {
  width: min(560px, calc(100% - 24px));
  margin-inline: auto;
}

#resultTitle {
  color: var(--text);
  font-size: clamp(20px, 5.1vw, 28px);
  line-height: 1.2;
  text-wrap: balance;
}

#shareImageBtn {
  width: min(260px, 78vw) !important;
  height: 44px !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #f8dd7f, #d4aa48) !important;
  box-shadow: 0 12px 24px rgba(244, 216, 121, 0.18) !important;
}

#dailyStatsBar,
#yesterdaySection {
  color: var(--muted) !important;
}

#timer.daily-countdown {
  width: fit-content;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px auto 26px;
  padding: 8px 10px 8px 9px;
  border: 1px solid rgba(127, 211, 230, 0.18);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(18, 29, 32, 0.9), rgba(15, 20, 20, 0.82));
  color: #f7faf7;
  box-shadow: var(--shadow-tight), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.daily-countdown__intro {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.daily-countdown__clock {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: #8fd7ca;
  background: rgba(95, 184, 169, 0.11);
  border: 1px solid rgba(110, 200, 185, 0.18);
}

.daily-countdown__clock svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.daily-countdown__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.daily-countdown__time {
  display: inline-flex;
  align-items: flex-start;
  gap: 3px;
}

.daily-countdown__unit {
  min-width: 28px;
  display: grid;
  justify-items: center;
  gap: 1px;
}

.daily-countdown__unit strong {
  color: #f8dd7f;
  font-size: 15px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.daily-countdown__unit small {
  color: #7f8c89;
  font-size: 7px;
  font-weight: 750;
  line-height: 1;
  text-transform: uppercase;
}

.daily-countdown__separator {
  color: rgba(248, 221, 127, 0.54);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

#statsModal > div,
#hintModal > div,
#loginModal > div,
#profileModal > div,
#leaderboardModal > div,
#helpModal > div,
.weekly-modal__panel {
  background:
    linear-gradient(180deg, rgba(29, 39, 38, 0.98), rgba(17, 23, 23, 0.98)) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,0.055) !important;
}

.profile-stat-item,
#statsContent > div:first-child,
#leaderboardContent {
  background: rgba(20, 30, 29, 0.92) !important;
  border-color: var(--line) !important;
}

.profile-stats-grid--career,
.profile-stats-grid--season,
.profile-stats-grid--daily-modes {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.profile-stats-grid--career .profile-stat-item,
.profile-stats-grid--season .profile-stat-item,
.profile-stats-grid--daily-modes .profile-stat-item {
  min-width: 0;
  padding: 9px 4px;
}

.profile-stats-grid--career .profile-stat-value,
.profile-stats-grid--season .profile-stat-value,
.profile-stats-grid--daily-modes .profile-stat-value {
  font-size: 19px;
}

.profile-stats-grid--career .profile-stat-label,
.profile-stats-grid--season .profile-stat-label,
.profile-stats-grid--daily-modes .profile-stat-label {
  font-size: 9px;
  line-height: 1.15;
}

.lb-row {
  border: 1px solid transparent;
}

.lb-row:hover {
  border-color: var(--line);
}

@media only screen and (max-width: 600px) {
  #topBar,
  .play-launcher-grid,
  #resultScreen {
    width: min(560px, calc(100% - 16px)) !important;
  }

  .play-launcher-grid {
    grid-template-columns: minmax(0, 1fr) minmax(110px, 0.38fr);
    gap: 8px;
  }

  .daily-mode-picker,
  .weekly-card {
    min-height: 92px;
    border-radius: 12px;
  }

  #timer.daily-countdown {
    max-width: calc(100% - 16px);
  }

  #keyboard {
    padding-inline: 6px;
  }

  .keyboard-row {
    gap: 4px;
  }

  .key:not(.key.wide) {
    max-width: 32px;
    height: 42px;
    border-radius: 8px;
  }
}

@media only screen and (max-width: 420px) {
  :root {
    --daily-tile-size: min(47px, calc((100vw - 56px) / var(--daily-word-length, 6)));
    --daily-tile-gap: 4px;
  }

  #topBar {
    border-radius: 12px !important;
  }

  #topBar button {
    width: auto !important;
    min-width: 28px !important;
    height: 32px !important;
  }

  .play-launcher-grid {
    grid-template-columns: minmax(0, 1fr) minmax(102px, 0.36fr);
    margin-bottom: 12px;
  }

  .daily-mode-picker,
  .weekly-card {
    padding: 10px !important;
    min-height: 88px;
  }

  .daily-mode-picker__actions button {
    height: 42px;
    border-radius: 10px;
  }

  #board,
  #resultGrid:not(:empty) {
    padding: 9px;
  }
}

@media only screen and (max-width: 480px) {
  #keyboard {
    --mobile-key-gap: 3px;
    width: 100%;
    max-width: 100%;
    padding: 0 6px 10px;
    overflow: hidden;
  }

  .keyboard-row {
    flex-wrap: nowrap !important;
    gap: var(--mobile-key-gap) !important;
    width: 100%;
    padding: 0 !important;
    box-sizing: border-box;
  }

  .key:not(.key.wide) {
    flex: 0 0 min(31px, calc((100vw - 54px) / 11)) !important;
    width: min(31px, calc((100vw - 54px) / 11)) !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 42px !important;
    padding: 0 !important;
    font-size: 15px;
  }

  .key.wide {
    min-width: 0;
  }
}

@media only screen and (max-width: 380px) {
  #keyboard {
    --mobile-key-gap: 2px;
    padding-inline: 5px;
  }

  .key:not(.key.wide) {
    flex-basis: min(29px, calc((100vw - 42px) / 11)) !important;
    width: min(29px, calc((100vw - 42px) / 11)) !important;
    height: 40px !important;
    font-size: 14px;
  }

  .profile-stats-grid--career,
  .profile-stats-grid--season,
  .profile-stats-grid--daily-modes {
    gap: 6px;
  }

  .profile-stats-grid--career .profile-stat-item,
  .profile-stats-grid--season .profile-stat-item,
  .profile-stats-grid--daily-modes .profile-stat-item {
    padding: 8px 3px;
  }

  .profile-stats-grid--career .profile-stat-label,
  .profile-stats-grid--season .profile-stat-label,
  .profile-stats-grid--daily-modes .profile-stat-label {
    font-size: 8px;
  }
}
