/* Drafti visual refresh — July 2026
   Presentation-only overrides: game behavior and DOM contracts stay unchanged. */

:root {
  --bg: #06110d;
  --surface: #0d1d16;
  --panel: #10251c;
  --gold: #f6cf58;
  --gold-light: #ffe69a;
  --gold-dark: #bb8f25;
  --green: #167249;
  --green-light: #21a269;
  --text-primary: #f7f4e8;
  --text-muted: #9bafa4;
  --border: rgba(246, 207, 88, .16);
  --radius: 14px;
  --shadow-deep: 0 28px 80px rgba(0, 0, 0, .42);
  --shell-veil: rgba(3, 12, 8, .88);
}

body[data-appearance="light"] {
  --bg: #edf3ee;
  --surface: #ffffff;
  --panel: #f5f8f5;
  --gold: #a36f08;
  --gold-light: #c68b16;
  --gold-dark: #805405;
  --green: #14734a;
  --green-light: #1b9460;
  --text-primary: #17241d;
  --text-muted: #66796e;
  --border: rgba(27, 76, 50, .14);
  --shadow-deep: 0 28px 70px rgba(26, 60, 42, .14);
  --shell-veil: rgba(237, 243, 238, .92);
}

button, input { border-radius: 10px; }

/* Install banner */
.pwa-banner-inner {
  max-width: 1120px;
  margin: 10px auto 0;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-bottom-color: rgba(246, 207, 88, .45);
  border-radius: 14px;
  background: rgba(15, 86, 56, .96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
  backdrop-filter: blur(18px);
}

.pwa-install-btn {
  min-height: 40px;
  padding-inline: 18px;
  border-radius: 9px;
  background: var(--gold);
}

/* First-run profile */
#overlay-profile-setup {
  background:
    radial-gradient(circle at 18% 10%, rgba(33, 162, 105, .18), transparent 32rem),
    radial-gradient(circle at 84% 86%, rgba(246, 207, 88, .10), transparent 28rem),
    var(--shell-veil);
  backdrop-filter: blur(18px);
}

.profile-setup-dialog {
  width: min(92vw, 470px);
  max-width: 470px;
  padding: 34px;
  border: 1px solid rgba(246, 207, 88, .22);
  border-top: 1px solid rgba(246, 207, 88, .38);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.045), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255,255,255,.05);
}

.profile-setup-dialog::before,
.profile-setup-dialog::after,
.profile-setup-dialog .d-corner-br,
.profile-setup-dialog .d-corner-bl { display: none; }

.dialog-title {
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: clamp(1.55rem, 6vw, 2rem);
  letter-spacing: -.015em;
  text-transform: none;
}

.dialog-subtitle { margin-bottom: 22px; color: var(--text-muted); }

.profile-lang-row { justify-content: flex-start; }

.lang-toggle {
  padding: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,.16);
}

.lang-btn { min-height: 34px; border-radius: 999px; }

.lang-btn.selected {
  background: var(--gold);
  color: #182016;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}

.ps-label { margin-bottom: 9px; color: var(--text-muted); }

.ps-input {
  min-height: 50px;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(0,0,0,.16);
  font-size: .95rem;
}

.profile-avatar-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.avatar-btn {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  max-width: 54px;
  border-width: 1px;
  background: rgba(0,0,0,.15);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.avatar-btn:hover { transform: translateY(-2px); border-color: var(--gold-dark); }
.avatar-btn.selected { background: rgba(246, 207, 88, .13); box-shadow: 0 0 0 3px rgba(246,207,88,.08); }

.ps-badge-info {
  padding: 13px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,.13);
}

.assign-cancel-btn, .assign-confirm-btn { min-height: 48px; border-radius: 12px; }
.assign-confirm-btn { box-shadow: 0 10px 24px rgba(187, 143, 37, .18); }

/* Lobby shell */
#lobby-screen {
  padding: max(22px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 12% 8%, rgba(33, 162, 105, .16), transparent 28rem),
    radial-gradient(circle at 86% 92%, rgba(246, 207, 88, .08), transparent 30rem),
    linear-gradient(135deg, #06110d 0%, var(--bg) 55%, #071710 100%);
}

body[data-appearance="light"] #lobby-screen {
  background:
    radial-gradient(circle at 10% 10%, rgba(27, 148, 96, .10), transparent 28rem),
    radial-gradient(circle at 88% 90%, rgba(198, 139, 22, .10), transparent 30rem),
    var(--bg);
}

#lobby-screen::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.lobby-inner { width: 100%; max-width: 1120px; padding: 0; }

.lobby-main-grid {
  display: grid;
  grid-template-columns: minmax(310px, .82fr) minmax(470px, 1.18fr);
  gap: 18px;
  align-items: stretch;
}

.lobby-intro-panel,
.lobby-setup-panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(18px);
}

.lobby-intro-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 660px;
  padding: 42px 34px 34px;
  overflow: hidden;
}

.lobby-intro-panel::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  top: -150px;
  left: -90px;
  border-radius: 50%;
  background: rgba(33, 162, 105, .16);
  filter: blur(4px);
}

.lobby-setup-panel { padding: 32px; }

.lobby-setup-heading { margin-bottom: 22px; }
.setup-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--gold);
  font: 700 .72rem/1 'Barlow Condensed', sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.lobby-setup-heading h2 {
  color: var(--text-primary);
  font: 800 clamp(1.7rem, 4vw, 2.25rem)/1.05 'Barlow Condensed', sans-serif;
  letter-spacing: -.015em;
}
.lobby-setup-heading p { margin-top: 8px; color: var(--text-muted); font-size: .86rem; line-height: 1.55; }

.lobby-brand { position: relative; margin-bottom: 24px; text-align: left; }
.lobby-flag-strip { justify-content: flex-start; margin-bottom: 18px; }
.flag-stripe { width: 42px; height: 3px; box-shadow: none !important; }
.lobby-title {
  font-size: clamp(3.4rem, 8vw, 5.4rem);
  letter-spacing: .12em;
  line-height: .82;
  text-shadow: none;
}
.lobby-subtitle { justify-content: flex-start; margin-top: 16px; font-size: .8rem; letter-spacing: .22em; }
.lobby-tagline { margin-top: 10px; max-width: 280px; font-size: .8rem; line-height: 1.55; letter-spacing: .02em; }

.profile-badge-display {
  justify-content: flex-start;
  min-height: 54px;
  margin-bottom: 16px;
  padding: 12px 15px;
  border-radius: 14px;
  background: rgba(0,0,0,.13);
}
.profile-badge-display:hover { transform: none; background: rgba(246,207,88,.06); }
.profile-badge-icon { font-size: 1.25rem; }

.lobby-tool-bar { justify-content: flex-start; gap: 8px; margin: 0 0 14px; }
.lobby-tool-btn { width: 46px; height: 46px; border-radius: 12px; }
.lobby-tool-play { background: rgba(246,207,88,.10); color: var(--gold); }

.lobby-utility-row { justify-content: flex-start; gap: 8px; margin: 0; }
.lobby-utility-row .lang-toggle, .sound-toggle-btn { min-height: 42px; }
.sound-toggle-btn { padding-inline: 14px; border-radius: 999px; }

.lobby-intro-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
  color: var(--text-muted);
}
.intro-note-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--gold);
  background: rgba(246,207,88,.06);
  font-size: 1.2rem;
}
.lobby-intro-note strong, .lobby-intro-note span { display: block; }
.lobby-intro-note strong { color: var(--text-primary); font-size: .78rem; }
.lobby-intro-note span { margin-top: 3px; font-size: .68rem; line-height: 1.45; }

.lobby-ornament { display: none; }
.lobby-section { margin-bottom: 18px; }
.lobby-section-label { margin-bottom: 9px; color: var(--text-muted); font-size: .67rem; letter-spacing: .18em; }

.lobby-mode-grid { gap: 10px; }
.lobby-mode-btn {
  min-height: 94px;
  padding: 15px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,.12);
}
.lobby-mode-btn.selected,
.lobby-mode-btn:hover {
  border-color: rgba(246,207,88,.62);
  background: linear-gradient(145deg, rgba(246,207,88,.12), rgba(33,162,105,.06));
}
.lobby-mode-icon { font-size: 1.55rem; }
.lobby-mode-label { font-size: .9rem; }
.lobby-mode-desc { font-size: .68rem; }

.lobby-diff-row { gap: 8px; }
.lobby-diff-btn {
  min-height: 42px;
  border-radius: 11px;
  background: rgba(0,0,0,.12);
}
.lobby-diff-btn.selected { background: rgba(246,207,88,.10); }

.lobby-theme-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.lobby-theme-btn {
  gap: 8px;
  padding: 7px 7px 9px;
  border-radius: 12px;
  background: rgba(0,0,0,.12);
}
.lobby-theme-btn::after { display: none; }
.lobby-theme-btn.selected { background: rgba(246,207,88,.08); box-shadow: 0 0 0 1px var(--gold); }
.theme-preview { border-radius: 8px; }
.theme-name { font-size: .61rem; letter-spacing: .06em; }

.lobby-actions { margin-top: 6px; }
.lobby-play-btn {
  min-height: 58px;
  margin-bottom: 10px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #f6cf58, #e7b83d);
  color: #172016;
  box-shadow: 0 14px 30px rgba(187,143,37,.22), inset 0 1px 0 rgba(255,255,255,.5);
}
.lobby-play-btn:hover { background: linear-gradient(135deg, #ffe285, #f6cf58); color: #10180f; box-shadow: 0 16px 34px rgba(187,143,37,.30); }
.lobby-secondary-btn { min-height: 40px; border-radius: 10px; }

.lobby-custom-float {
  position: fixed;
  top: max(30px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

.lobby-rules-hint {
  max-width: 760px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: transparent;
}
.lobby-legal-row { margin-top: 4px; }

/* Game screen polish */
#app {
  background:
    radial-gradient(circle at 50% 0, rgba(33,162,105,.13), transparent 35rem),
    var(--bg);
}
body.pwa-banner-visible #app {
  padding-top: calc(var(--pwa-banner-height, 0px) + max(10px, env(safe-area-inset-top)));
}
#header { border-radius: 14px; }
.icon-btn { border-radius: 11px; }
.score-card, #status-bar { border-radius: 13px; }
#board-wrap { filter: drop-shadow(0 24px 34px rgba(0,0,0,.32)); }

@media (max-width: 840px) {
  #lobby-screen { padding-inline: 12px; }
  .lobby-main-grid { grid-template-columns: 1fr; max-width: 620px; margin: 0 auto; }
  .lobby-intro-panel { min-height: auto; padding: 30px 24px 24px; }
  .lobby-intro-note { padding-top: 20px; }
  .lobby-setup-panel { padding: 26px 24px; }
  .lobby-brand { text-align: center; }
  .lobby-flag-strip, .lobby-subtitle, .lobby-tool-bar, .lobby-utility-row { justify-content: center; }
  .lobby-tagline { margin-inline: auto; }
  .profile-badge-display { justify-content: center; }
  .lobby-custom-float { top: 18px; right: 18px; }
}

@media (max-width: 520px) {
  :root { --radius: 12px; }
  #lobby-screen { padding-top: max(10px, env(safe-area-inset-top)); }
  .lobby-main-grid { gap: 10px; }
  .lobby-intro-panel, .lobby-setup-panel { border-radius: 18px; }
  .lobby-intro-panel { padding: 25px 16px 18px; }
  .lobby-setup-panel { padding: 22px 16px 18px; }
  .lobby-title { font-size: 3rem; }
  .lobby-subtitle { gap: 6px; font-size: .68rem; letter-spacing: .14em; }
  .tz-map-icon { width: 15px; height: 15px; }
  .lobby-setup-heading { margin-bottom: 18px; }
  .lobby-theme-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
  .lobby-theme-btn { padding: 5px 5px 7px; }
  .theme-name { font-size: .52rem; }
  .lobby-mode-btn { min-height: 88px; }
  .lobby-custom-float { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; }
  .profile-setup-dialog { width: calc(100% - 20px); padding: 26px 20px 20px; border-radius: 20px; }
  .profile-avatar-grid { gap: 8px; }
  .pwa-banner-inner { margin: 6px 8px 0; border-radius: 12px; }
}

@media (max-height: 700px) and (min-width: 841px) {
  .lobby-intro-panel { min-height: 600px; padding-block: 28px; }
  .lobby-setup-panel { padding-block: 24px; }
  .lobby-setup-heading { margin-bottom: 14px; }
  .lobby-section { margin-bottom: 12px; }
  .lobby-mode-btn { min-height: 76px; padding-block: 10px; }
  .lobby-theme-btn { padding-top: 5px; }
  .lobby-play-btn { min-height: 52px; }
}

@media (prefers-reduced-motion: no-preference) {
  .lobby-main-grid { animation: drafti-enter .55s cubic-bezier(.2,.8,.2,1) both; }
  .lobby-mode-btn, .lobby-theme-btn, .lobby-diff-btn, .lobby-play-btn, .icon-btn, .avatar-btn { transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
  @keyframes drafti-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
}

/* Reference-directed refinement: ceremonial gold game cabinet. */
@media (min-width: 841px) {
  .pwa-banner-inner,
  .lobby-inner { max-width: 1320px; }

  .lobby-main-grid {
    grid-template-columns: minmax(400px, .76fr) minmax(620px, 1.24fr);
    gap: 14px;
  }
}

#lobby-screen {
  background:
    radial-gradient(circle at 22% 24%, rgba(16, 104, 67, .28), transparent 32rem),
    radial-gradient(circle at 82% 82%, rgba(246, 190, 45, .08), transparent 30rem),
    linear-gradient(120deg, #032218 0%, #051711 40%, #020b09 100%);
}

#lobby-screen::after {
  opacity: .25;
  background-image:
    linear-gradient(45deg, transparent 44%, rgba(19,108,72,.18) 45%, rgba(19,108,72,.18) 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, rgba(19,108,72,.13) 45%, rgba(19,108,72,.13) 55%, transparent 56%);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, black, transparent 32%, transparent 74%, black);
}

.pwa-banner-inner {
  min-height: 74px;
  padding: 12px 18px 12px 24px;
  border-color: rgba(246, 190, 45, .68);
  border-radius: 15px;
  background: linear-gradient(100deg, rgba(4,37,27,.96), rgba(3,21,17,.97));
  box-shadow: 0 0 26px rgba(238, 180, 34, .10), inset 0 1px 0 rgba(255,255,255,.035);
}

.pwa-banner-icon { color: var(--gold); font-size: 1.55rem; }
.pwa-banner-text strong { color: var(--gold); font-size: 1rem; }
.pwa-banner-text span { font-size: .82rem; }
.pwa-install-btn {
  min-width: 150px;
  min-height: 48px;
  border: 1px solid #ffe07a;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffe475 0%, #f5bd37 54%, #d9940d 100%);
  box-shadow: 0 0 20px rgba(250,190,48,.42), inset 0 2px 0 rgba(255,255,255,.48);
  font-size: .88rem;
}

.lobby-intro-panel,
.lobby-setup-panel {
  border-color: rgba(226, 177, 48, .58);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.028), transparent 30%),
    linear-gradient(120deg, rgba(8,48,34,.96), rgba(2,22,18,.97));
  box-shadow:
    0 30px 80px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,244,188,.08),
    0 0 24px rgba(223,170,34,.06);
}

.lobby-intro-panel::after,
.lobby-setup-panel::after {
  content: '';
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 0, rgba(255,220,100,.85), transparent 3px),
    radial-gradient(circle at 50% 100%, rgba(255,220,100,.65), transparent 3px);
  opacity: .75;
}

.lobby-intro-panel {
  min-height: 700px;
  padding: 38px 32px 32px;
  justify-content: flex-start;
}

.lobby-intro-panel::before {
  width: 100%;
  height: 300px;
  top: 0;
  left: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 32% 12%, rgba(31,135,84,.22), transparent 45%),
    linear-gradient(135deg, rgba(255,255,255,.025), transparent 48%);
}

.lobby-setup-panel { padding: 30px 32px 26px; }

.lobby-brand { margin: 0 0 24px; padding: 10px 0 0; text-align: center; }
.lobby-flag-strip { gap: 16px; justify-content: center; margin-bottom: 12px; }
.flag-stripe { width: 116px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)) !important; }
.flag-stripe.gold { background: linear-gradient(90deg, var(--gold), transparent) !important; }
.flag-star {
  position: relative;
  top: 2px;
  color: var(--gold);
  font-size: 2.25rem;
  line-height: 1;
  text-shadow: 0 0 18px rgba(246,207,88,.42);
}
.lobby-title {
  font-size: clamp(4rem, 6vw, 5.7rem);
  letter-spacing: .16em;
  line-height: .92;
  color: #f7c648;
  background: linear-gradient(180deg, #fff0a3 0%, #f8c950 45%, #d39116 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 5px 5px rgba(0,0,0,.4));
}
.lobby-subtitle { justify-content: center; margin-top: 17px; color: #57c78e; font-size: .94rem; }
.lobby-tagline { max-width: none; margin-top: 12px; color: #e4e5d9; font-size: .88rem; }

.profile-badge-display {
  justify-content: flex-start;
  min-height: 74px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border-color: rgba(226,177,48,.62);
  border-radius: 15px;
  background: linear-gradient(90deg, rgba(246,199,70,.075), rgba(0,0,0,.14));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.profile-badge-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-right: 7px;
  border: 1px solid rgba(226,177,48,.45);
  border-radius: 11px;
  background: rgba(246,199,70,.08);
  font-size: 1.5rem;
}
.profile-badge-name { font-size: .9rem; }
.profile-points { font-size: .9rem; }

.lobby-tool-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid rgba(226,177,48,.36);
  border-radius: 14px;
  background: rgba(0,0,0,.11);
}
.lobby-tool-btn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 86px;
  border-color: rgba(226,177,48,.34);
  border-radius: 12px;
  color: #e9eee9;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(0,0,0,.12));
}
.lobby-tool-btn svg { width: 25px; height: 25px; color: #f2f1df; }
.lobby-tool-play svg { color: var(--gold); }
.lobby-tool-label { display: block; color: var(--text-primary); font-size: .7rem; line-height: 1; }
.lobby-tool-label::before { content: attr(data-sw); }
html[lang="en"] .lobby-tool-label::before { content: attr(data-en); }

.lobby-utility-row {
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding-top: 13px;
  border-top: 1px solid rgba(226,177,48,.33);
}
.lobby-utility-row .lang-toggle,
.sound-toggle-btn {
  min-height: 48px;
  border-color: rgba(226,177,48,.42);
  background: rgba(1,17,13,.62);
}
.lobby-utility-row .lang-btn { min-width: 50px; }
.lobby-utility-row .lang-btn.selected { background: linear-gradient(180deg, rgba(236,187,54,.44), rgba(139,96,12,.35)); color: #fff4c1; }
.sound-toggle-btn { color: #60d59a; }
.lobby-intro-note { display: none; }
.lobby-custom-float { display: none; }

.setup-kicker { display: none; }
.lobby-setup-heading { margin-bottom: 20px; }
.lobby-setup-heading h2 { font-size: clamp(1.9rem, 3vw, 2.35rem); }
.lobby-setup-heading h2::before { content: '\2726'; margin-right: 10px; color: #4fc18a; font-size: .85em; }
.lobby-setup-heading p { margin-left: 34px; color: #d5d9d2; }
.copy-en { display: none; }
html[lang="en"] .copy-sw { display: none; }
html[lang="en"] .copy-en { display: inline; }
.lobby-section-label { color: #f0c74f; font-size: .7rem; letter-spacing: .2em; }

.lobby-mode-btn {
  min-height: 112px;
  border-color: rgba(226,177,48,.42);
  border-radius: 15px;
  background: rgba(2,20,16,.62);
}
.lobby-mode-btn.selected,
.lobby-mode-btn:hover {
  border-color: #edc34b;
  background: radial-gradient(circle at 35% 25%, rgba(237,195,75,.16), rgba(9,49,34,.68));
  box-shadow: 0 0 20px rgba(237,195,75,.22), inset 0 0 18px rgba(237,195,75,.06);
}
.lobby-mode-icon { font-size: 1.85rem; }
.lobby-mode-label { font-size: 1rem; color: #fff; }
.lobby-mode-desc { color: #d2d6d0; font-size: .72rem; }

.lobby-diff-btn {
  min-height: 44px;
  border-color: rgba(226,177,48,.35);
  background: rgba(2,20,16,.62);
}
.lobby-diff-btn.selected {
  border-color: #edc34b;
  background: linear-gradient(90deg, rgba(237,195,75,.18), rgba(7,48,33,.7));
  box-shadow: 0 0 14px rgba(237,195,75,.18);
}

.lobby-play-btn {
  min-height: 62px;
  border: 1px solid #ffe27c;
  background:
    linear-gradient(135deg, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(180deg, #ffd961 0%, #efb52f 58%, #d68a0a 100%);
  box-shadow: 0 0 24px rgba(242,181,39,.38), inset 0 2px 0 rgba(255,255,255,.40);
  color: #102016;
  font-size: 1.18rem;
}
.lobby-secondary-btn { border-color: rgba(226,177,48,.42); color: #e5d8aa; }

@media (max-width: 840px) {
  .lobby-intro-panel { min-height: auto; }
  .lobby-tool-btn { height: 76px; }
  .lobby-utility-row { justify-content: center; }
  .lobby-setup-heading p { margin-left: 0; }
}

@media (max-width: 520px) {
  .pwa-banner-inner { min-height: 0; padding: 9px 10px 9px 13px; }
  .pwa-install-btn { min-width: 90px; min-height: 40px; }
  .lobby-intro-panel { padding: 25px 16px 20px; }
  .lobby-flag-strip { gap: 9px; }
  .flag-stripe { width: 66px; }
  .flag-star { font-size: 1.7rem; }
  .lobby-title { font-size: 3.15rem; }
  .lobby-tool-bar { gap: 6px; padding: 6px; }
  .lobby-tool-btn { height: 68px; gap: 6px; }
  .lobby-tool-btn svg { width: 21px; height: 21px; }
  .lobby-tool-label { font-size: .59rem; }
  .lobby-utility-row { gap: 6px; }
  .lobby-utility-row .lang-btn { min-width: 39px; padding-inline: 7px; }
  .sound-toggle-btn { padding-inline: 9px; }
  .lobby-mode-btn { min-height: 96px; }
  .lobby-setup-heading h2 { font-size: 1.8rem; }
}

/* Light appearance: preserve Drafti's emerald-and-gold identity with readable
   ivory surfaces instead of inheriting the legacy blue utility palette. */
body[data-appearance="light"] {
  --bg: #f3f0e6;
  --surface: #fffdf7;
  --panel: #f8f4e8;
  --gold: #a66f0b;
  --gold-light: #d09a2a;
  --gold-dark: #76500c;
  --green: #11623f;
  --green-light: #17845a;
  --text-primary: #173329;
  --text-muted: #61756c;
  --border: rgba(128, 91, 20, .28);
  --shadow-deep: 0 24px 58px rgba(31, 66, 49, .13);
}

body[data-appearance="light"] #lobby-screen {
  background:
    radial-gradient(circle at 18% 14%, rgba(28, 132, 87, .10), transparent 30rem),
    radial-gradient(circle at 86% 86%, rgba(196, 139, 24, .12), transparent 30rem),
    linear-gradient(120deg, #eef5ef 0%, #faf8f0 48%, #f3eee0 100%);
}

body[data-appearance="light"] #lobby-screen::after {
  opacity: .32;
  background-image:
    linear-gradient(45deg, transparent 44%, rgba(26, 105, 70, .08) 45%, rgba(26, 105, 70, .08) 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, rgba(166, 111, 11, .06) 45%, rgba(166, 111, 11, .06) 55%, transparent 56%);
}

body[data-appearance="light"] .lobby-intro-panel,
body[data-appearance="light"] .lobby-setup-panel {
  border-color: rgba(151, 104, 17, .42);
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(247,243,231,.96)),
    #fffdf7;
  box-shadow: 0 24px 58px rgba(31,66,49,.13), inset 0 1px 0 #fff;
}

body[data-appearance="light"] .lobby-intro-panel::before {
  background:
    radial-gradient(circle at 32% 12%, rgba(31, 142, 92, .13), transparent 45%),
    linear-gradient(135deg, rgba(255,255,255,.50), transparent 48%);
}

body[data-appearance="light"] .flag-star,
body[data-appearance="light"] .profile-points,
body[data-appearance="light"] .lobby-section-label {
  color: #9a6708;
  text-shadow: none;
}

body[data-appearance="light"] .lobby-subtitle { color: #18764f; }
body[data-appearance="light"] .lobby-tagline { color: #334c42; }
body[data-appearance="light"] .lobby-setup-heading h2 { color: #153b2d; }
body[data-appearance="light"] .lobby-setup-heading h2::before { color: #1c9663; }
body[data-appearance="light"] .lobby-setup-heading p { color: #5c7067; }

body[data-appearance="light"] .profile-badge-display {
  border-color: rgba(151,104,17,.36);
  background: linear-gradient(90deg, rgba(198,149,43,.11), rgba(255,255,255,.72));
  box-shadow: inset 0 1px 0 #fff;
}

body[data-appearance="light"] .profile-badge-icon {
  border-color: rgba(151,104,17,.34);
  background: #fff8df;
}

body[data-appearance="light"] .profile-badge-name,
body[data-appearance="light"] .profile-next { color: #51685e; }

body[data-appearance="light"] .lobby-tool-bar {
  border-color: rgba(151,104,17,.28);
  background: rgba(240,236,221,.76);
}

body[data-appearance="light"] .lobby-tool-btn {
  border-color: rgba(74,111,91,.22);
  background: linear-gradient(145deg, #ffffff, #eeeade);
  color: #24483a;
  box-shadow: 0 7px 16px rgba(38,73,56,.07);
}

body[data-appearance="light"] .lobby-tool-btn svg { color: #2d5d4a; }
body[data-appearance="light"] .lobby-tool-play svg { color: #a66f0b; }
body[data-appearance="light"] .lobby-tool-label { color: #1e3c31; }

body[data-appearance="light"] .lobby-utility-row { border-top-color: rgba(151,104,17,.25); }
body[data-appearance="light"] .lobby-utility-row .lang-toggle,
body[data-appearance="light"] .sound-toggle-btn {
  border-color: rgba(91,111,98,.24);
  background: #f3efe3;
  box-shadow: inset 0 1px 0 #fff;
}

body[data-appearance="light"] .lobby-utility-row .lang-btn,
body[data-appearance="light"] .sound-toggle-btn { color: #3e5b50; }
body[data-appearance="light"] .lobby-utility-row .lang-btn.selected {
  background: linear-gradient(180deg, #f3d678, #d8a632);
  color: #26351d;
  box-shadow: 0 4px 12px rgba(142,96,10,.17);
}
body[data-appearance="light"] .sound-toggle-btn { color: #126a46; }

body[data-appearance="light"] .lobby-mode-btn,
body[data-appearance="light"] .lobby-diff-btn,
body[data-appearance="light"] .lobby-theme-btn {
  border-color: rgba(78,105,90,.23);
  background: rgba(255,255,255,.78);
  color: #24483a;
  box-shadow: 0 7px 18px rgba(39,70,54,.06);
}

body[data-appearance="light"] .lobby-mode-label { color: #173c2e; }
body[data-appearance="light"] .lobby-mode-desc,
body[data-appearance="light"] .lobby-mode-btn.selected .lobby-mode-desc,
body[data-appearance="light"] .theme-name { color: #587066; }

body[data-appearance="light"] .lobby-mode-btn.selected,
body[data-appearance="light"] .lobby-mode-btn:hover,
body[data-appearance="light"] .lobby-diff-btn.selected,
body[data-appearance="light"] .lobby-diff-btn:hover,
body[data-appearance="light"] .lobby-theme-btn.selected,
body[data-appearance="light"] .lobby-theme-btn:hover {
  border-color: #b47a11;
  background: linear-gradient(145deg, #fff8df, #edf5ee);
  color: #6e4a08;
  box-shadow: 0 0 0 1px rgba(180,122,17,.16), 0 8px 20px rgba(38,74,55,.08);
}

body[data-appearance="light"] .lobby-theme-btn.selected { box-shadow: 0 0 0 1px #b47a11, 0 8px 20px rgba(38,74,55,.08); }
body[data-appearance="light"] .lobby-theme-btn.selected .theme-preview { outline-color: #b47a11; }

body[data-appearance="light"] .lobby-play-btn,
body[data-appearance="light"] .lobby-play-btn:hover {
  border-color: #c58a16;
  background:
    linear-gradient(135deg, rgba(255,255,255,.25), transparent 30%),
    linear-gradient(180deg, #f8d96e 0%, #e9b73c 58%, #c8820d 100%);
  color: #173329;
  text-shadow: none;
  box-shadow: 0 10px 24px rgba(145,96,9,.20), inset 0 2px 0 rgba(255,255,255,.55);
}

body[data-appearance="light"] .lobby-secondary-btn {
  border-color: rgba(26,105,70,.30);
  color: #176744;
  background: rgba(255,255,255,.52);
}

body[data-appearance="light"] .pwa-banner-inner {
  border-color: rgba(190,139,32,.66);
  background: linear-gradient(100deg, #185d43, #0e4533);
  box-shadow: 0 12px 30px rgba(30,78,56,.20);
}

body[data-appearance="light"] .pwa-install-btn,
body[data-appearance="light"] .pwa-install-btn:hover {
  border-color: #f3d477;
  background: linear-gradient(180deg, #ffe582, #eab73a);
  color: #183226;
}
