:root {
  --bg-0: #0b1f16;
  --bg-1: #0f2a1d;
  --felt: #123524;
  --card: #16382a;
  --card-border: #24503b;
  --gold: #e8b923;
  --gold-dim: #b58e1c;
  --text: #f2f0e8;
  --text-dim: #a9b8ac;
  --danger: #e35d5d;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, var(--bg-1), var(--bg-0));
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: calc(14px + var(--safe-top)) 0 8px;
}

.progress-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card-border);
  transition: background 0.2s, transform 0.2s;
}

.progress-dots .dot.is-active {
  background: var(--gold);
  transform: scale(1.3);
}

.progress-dots .dot.is-done {
  background: var(--gold-dim);
}

.screen {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  animation: fadeIn 0.25s ease;
}

.screen[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

h1, h2 {
  margin: 0 0 6px;
  font-weight: 700;
}

h1.brand {
  text-align: center;
  font-size: 28px;
  color: var(--gold);
}

h2 {
  font-size: 22px;
}

.subtitle {
  margin: 0 0 20px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.4;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.field {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-dim);
  position: relative;
}

.field span:first-child {
  display: block;
  margin-bottom: 6px;
}

.field input,
.field select,
.search-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg-0);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.field input:focus,
.field select:focus,
.search-input:focus {
  border-color: var(--gold);
}

.char-count {
  position: absolute;
  right: 4px;
  top: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.search-input {
  margin-bottom: 12px;
}

.btn[hidden] {
  display: none;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

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

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gold);
  color: #241c04;
}

.btn-large {
  padding: 16px;
  font-size: 17px;
}

.btn-google {
  background: #fff;
  color: #1f1f1f;
  margin-bottom: 12px;
}

.btn-google .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4285f4;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--card-border);
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--text-dim);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  margin: 4px 0 4px;
  cursor: pointer;
}

.checkbox-row input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--gold);
}

/* Test-phase password screen (js/access-gate.js) — above everything else in the game. */
.access-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-0);
}

.access-gate[hidden] {
  display: none;
}

.access-gate-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px 20px;
}

.access-gate-logo {
  margin-bottom: 10px;
}

.access-gate-card h2 {
  margin: 0 0 6px;
  color: var(--gold);
}

.access-gate-card p {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 14px;
}

.access-gate-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg-0);
  color: var(--text);
  font-size: 16px;
  margin-bottom: 12px;
}

/* Account screen: deletion lives in its own card at the bottom, away from everyday buttons. */
.account-info .summary-row {
  font-size: 13px;
}

.card .btn + .btn {
  margin-top: 8px;
}

.danger-zone {
  border-color: rgba(227, 93, 93, 0.45);
}

.danger-zone h3 {
  margin: 0 0 6px;
  color: var(--danger);
  font-size: 15px;
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.home-disclaimer {
  margin-top: 22px;
  text-align: center;
}

#confirmOverlay,
#passwordOverlay {
  position: fixed;
  z-index: 45;
}

.confirm-message {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
}

#confirmOverlay .btn,
#passwordOverlay .btn {
  margin-top: 8px;
}

/* Ultimate World Champion celebration + identity check (js/champion.js). */
#championOverlay,
#championVerifyOverlay {
  position: fixed;
  z-index: 50;
}

.champion-overlay {
  background: rgba(3, 8, 5, 0.94);
}

/* Country won (js/celebrations.js): the country's flag as a round medal in a gold rim, hanging
   from a ribbon; it drops in, bounces and keeps swinging gently. */
#countryMedalOverlay {
  position: fixed;
  z-index: 50;
}

.country-medal-overlay {
  background: radial-gradient(circle at 50% 38%, rgba(60, 45, 8, 0.9), rgba(3, 8, 5, 0.95) 65%);
}

.country-medal-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 24px 20px;
}

.country-medal-card h2 {
  color: var(--gold);
  font-size: 24px;
  line-height: 1.3;
  margin: 18px 0 22px;
}

.country-medal {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 0;
}

.country-medal.is-dropping {
  animation: medal-drop 0.9s cubic-bezier(0.3, 1.4, 0.5, 1) both, medal-swing 3.2s ease-in-out 0.9s infinite;
}

.country-medal-ribbon {
  display: flex;
  gap: 4px;
  margin-bottom: -14px;
}

.country-medal-ribbon span {
  width: 30px;
  height: 64px;
  background: linear-gradient(90deg, #b3202e 0 33%, #f4f1e8 33% 66%, #1c4fa0 66%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.25);
}

.country-medal-ribbon span:first-child {
  transform: skewX(12deg);
}

.country-medal-ribbon span:last-child {
  transform: skewX(-12deg);
}

.country-medal-disc {
  position: relative;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  padding: 10px;
  background: conic-gradient(from 20deg, #fff3b0, #d4a017, #8a6508, #f6d365, #b8860b, #fff3b0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(246, 211, 101, 0.35);
}

.country-medal-disc img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.25);
}

/* Shine sweeping across the medal. */
.country-medal-disc::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0) 60%);
  background-size: 250% 100%;
  animation: medal-shine 2.6s ease-in-out 0.8s infinite;
  pointer-events: none;
}

/* Continent won (js/celebrations.js): lighter than the World Champion's screen. */
#continentWinOverlay {
  position: fixed;
  z-index: 50;
}

.continent-win-overlay {
  background: rgba(3, 8, 5, 0.92);
}

.continent-win-card {
  position: relative;
  max-width: 440px;
  width: 100%;
  text-align: center;
  padding: 24px 20px;
}

.continent-win-icon {
  font-size: 64px;
  line-height: 1;
  animation: champion-pop 0.9s ease-out;
}

.continent-win-congrats {
  margin: 14px 0 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}

.continent-win-card h2 {
  color: var(--gold);
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 14px;
}

.continent-win-next {
  font-size: 17px;
  margin: 0 0 22px;
}

/* Clapping hands along the bottom of the celebration screens, while the applause plays — so the
   applause can be seen even with the sound off. */
.clap-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: clamp(6px, 3vw, 22px);
  font-size: clamp(28px, 7vw, 44px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.clap-row.is-clapping {
  opacity: 1;
}

.clap-row span {
  display: inline-block;
}

.clap-row.is-clapping span {
  animation: clap 0.32s ease-in-out infinite;
}

.clap-row.is-clapping span:nth-child(2n) { animation-duration: 0.28s; animation-delay: 0.07s; }
.clap-row.is-clapping span:nth-child(3n) { animation-duration: 0.35s; animation-delay: 0.12s; }
.clap-row.is-clapping span:nth-child(4n) { animation-delay: 0.19s; }

@keyframes clap {
  0%, 100% { transform: scale(1) rotate(0); }
  50% { transform: scale(0.78) rotate(-8deg); }
}

@keyframes medal-drop {
  0% { transform: translateY(-120vh) rotate(-25deg); }
  100% { transform: translateY(0) rotate(0); }
}

@keyframes medal-swing {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
}

@keyframes medal-shine {
  0% { background-position: 120% 0; }
  60%, 100% { background-position: -120% 0; }
}

.fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.champion-card {
  position: relative;
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 24px 20px;
}

.champion-trophy {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 12px;
  animation: champion-pop 0.9s ease-out;
}

.champion-card h2 {
  color: var(--gold);
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 10px;
}

.champion-rank {
  font-size: 17px;
  margin: 0 0 22px;
}

@keyframes champion-pop {
  0% { transform: scale(0.2); opacity: 0; }
  70% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.verify-card {
  max-width: 460px;
  max-height: 90vh;
}

.verify-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  text-align: left;
}

.verify-body input[type="file"] {
  font-size: 13px;
  padding: 10px;
}

.champion-status h3 {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 15px;
}

/* Legal consent block (js/consent.js) and the Terms/Privacy reader (js/legal.js). */
.birthdate-field input {
  color-scheme: dark;
}

.legal-link {
  color: var(--gold);
  text-decoration: underline;
}

.no-real-money {
  color: var(--text-dim);
}

#legalOverlay {
  position: fixed;
  z-index: 40;
}

.legal-card {
  max-width: 560px;
  max-height: 88vh;
}

.legal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
  font-size: 13px;
  line-height: 1.6;
}

.legal-body h4 {
  color: var(--gold);
  margin: 16px 0 4px;
  font-size: 14px;
}

.legal-body p {
  margin: 0 0 8px;
}

.legal-meta {
  color: var(--text-dim);
  font-size: 12px;
}

.fine-print {
  margin: 4px 0 14px;
  font-size: 12px;
  color: var(--text-dim);
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin: 6px 0 0;
}

.nav-row {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.nav-row .btn {
  flex: 1;
}

.avatar-preview {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 20px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.emoji-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.emoji-btn.is-selected {
  background: rgba(232, 185, 35, 0.18);
  border-color: var(--gold);
}

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

.option-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.option-card.is-selected {
  border-color: var(--gold);
  background: rgba(232, 185, 35, 0.1);
}

.option-card.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.option-title {
  font-weight: 700;
  font-size: 15px;
}

.option-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.scroll-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
}

.list-item {
  padding: 13px 16px;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
  font-size: 15px;
}

.list-item:last-child {
  border-bottom: none;
}

/* Home screen */
.home-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

/* The badge count and the home screen's buttons (🏁 ✉️ ⚙️ 🚪) share the line under the greeting. */
.home-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.home-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.home-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex: none;
}

.home-id {
  flex: 1;
  min-width: 0;
}

.home-name {
  font-size: 19px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-total {
  font-size: 13px;
  color: var(--gold);
  min-width: 0;
}

.home-section-title {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 14px 0 8px;
}

.type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.type-tab {
  flex: 1;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.type-tab.is-active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(232, 185, 35, 0.12);
}

.home-modes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-card {
  text-align: left;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mode-card.has-save {
  border-color: rgba(232, 185, 35, 0.45);
}

.mode-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mode-title {
  font-size: 17px;
  font-weight: 700;
}

.mode-cta {
  font-size: 12px;
  font-weight: 700;
  color: #241c04;
  background: var(--gold);
  border-radius: 999px;
  padding: 3px 12px;
}

.mode-desc,
.mode-count {
  font-size: 12px;
  color: var(--text-dim);
}

.mode-challenge {
  font-size: 12px;
  font-style: italic;
  color: var(--gold);
}

.mode-tier {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

.mode-place {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.home-flag {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  flex: none;
}

.mode-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.mode-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #f3d365);
  border-radius: 999px;
}

.home-other {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.other-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.other-row span {
  color: var(--text-dim);
  font-size: 12px;
}

/* Country hero picture: landmark photo with flag + caption, used on country pickers, the
   welcome screen and the career hubs. */
.hero-slot {
  margin: 0 0 12px;
}

.hero-slot[hidden] {
  display: none;
}

.country-hero {
  position: relative;
  margin: 0;
  height: 150px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #1f6142, #0a2a1c);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.country-hero .hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.country-hero figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 12px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
  color: #fff;
}

.country-hero .hero-flag {
  width: 30px;
  height: 22px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  flex: none;
}

.country-hero .hero-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.country-hero .hero-name {
  font-size: 15px;
  font-weight: 700;
}

.country-hero .hero-caption {
  font-size: 12px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-hero .hero-credit {
  position: absolute;
  top: 6px;
  right: 8px;
  max-width: 70%;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-hero.no-photo {
  height: 64px;
}

.list-item .list-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.65;
}

#careerOptionList .search-input,
#mediumCareerOptionList .search-input,
#ultimateCareerOptionList .search-input {
  margin-bottom: 8px;
}

.list-item.is-selected {
  background: rgba(232, 185, 35, 0.14);
  color: var(--gold);
  font-weight: 600;
}

.list-empty {
  padding: 20px 16px;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
}

.welcome-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  margin: 0 auto 16px;
}

.welcome-name {
  text-align: center;
  color: var(--gold);
  font-size: 24px;
}

.welcome-message {
  text-align: center;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 20px;
}

.summary-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-dim);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--card-border);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row span:last-child {
  color: var(--text);
  font-weight: 600;
}

@media (min-width: 480px) {
  .screen-inner { max-width: 440px; }
}

.career-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.career-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
}

.career-header-info {
  flex: 1;
  min-width: 0;
}

.career-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.career-flag {
  font-size: 14px;
  flex-shrink: 0;
}

.career-name {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.career-badges {
  font-size: 12px;
  color: var(--text-dim);
}

/* The buttons (🏁 🔀 🏆 🔄 🚪) on their own row under the name, to the right — stacked next to it
   they made the header tall (2026-10-01). */
.career-header-actions {
  order: 2;
  flex-basis: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: -4px;
}

.icon-btn {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

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

.achievement-row {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.achievement-row.is-active {
  border-color: var(--gold);
}

.achievement-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.achievement-flag {
  font-size: 18px;
}

.achievement-name {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
}

.achievement-champion {
  font-size: 12px;
}

.achievement-stats {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

.achievement-countries {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.achievement-country {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
}

.achievement-country img {
  width: 16px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
}

.career-wallet {
  order: 1;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

#careerOptionList {
  margin-bottom: 14px;
}

#careerJoinBtn {
  margin-bottom: 10px;
}

.career-toast {
  background: rgba(232, 185, 35, 0.14);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--gold);
  text-align: center;
  font-weight: 600;
}

/* ---------- Start screen: players of this device (js/device-players.js) ---------- */
.device-players {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 18px;
}

.device-player {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.device-player-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.device-player-main:hover,
.device-player-main:focus-visible {
  background: rgba(255, 255, 255, 0.05);
}

.device-player-avatar {
  font-size: 34px;
  line-height: 1;
  flex-shrink: 0;
}

.device-player-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.device-player-name {
  font-size: 17px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-player-meta {
  font-size: 13px;
  color: var(--text-dim, #aaa);
  margin-top: 3px;
}

.device-player-remove {
  flex-shrink: 0;
  width: 44px;
  background: none;
  border: none;
  border-left: 1px solid var(--card-border);
  color: var(--text-dim, #aaa);
  font-size: 16px;
  cursor: pointer;
}

.device-player-remove:hover,
.device-player-remove:focus-visible {
  color: var(--danger);
}

.start-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 10px;
}

/* ---------- Studio splash (Garden Lantern Games) — shown first on every start ---------- */
.studio-splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  /* Matches the logo's own background so the picture blends in. */
  background: radial-gradient(circle at 50% 40%, #213429 0%, #192a24 55%, #14221d 100%);
  cursor: pointer;
  animation: studio-splash-out 0.5s ease 2.2s forwards;
}

.studio-splash img {
  width: min(78vw, 60vh, 420px);
  height: auto;
  /* Soft edges: the JPEG's square border disappears into the page background. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
  animation: studio-splash-in 0.6s ease both;
}

.studio-splash-url {
  color: #e8c66a;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-decoration: none;
  opacity: 0.9;
  animation: studio-splash-in 0.6s ease 0.3s both;
}

.studio-splash.is-done {
  animation: studio-splash-out 0.3s ease forwards;
}

@keyframes studio-splash-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes studio-splash-out {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .studio-splash img,
  .studio-splash-url {
    animation: none;
  }
}

/* ---------- Tutorial (js/tutorial.js) ---------- */
.tutorial-prompt {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-height: 70vh;
}

.tutorial-prompt-icon {
  font-size: 56px;
}

.tutorial-step {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 4px;
}

.tutorial-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0 4px;
}

.tutorial-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px;
}

.tutorial-visual {
  flex: 0 0 118px;
  display: flex;
  justify-content: center;
}

.tutorial-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.tutorial-note {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px;
}

.tutorial-fake {
  pointer-events: none;
  width: 100%;
  padding: 10px 6px;
  font-size: 14px;
  text-align: center;
}

.tutorial-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--card-border);
  color: var(--gold);
  font-weight: 700;
}

.tutorial-dealer {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-weight: 800;
}

.tutorial-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.tutorial-chip {
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
}

.tutorial-slider {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--gold) 45%, rgba(255, 255, 255, 0.2) 45%);
  position: relative;
}

.tutorial-slider::after {
  content: "";
  position: absolute;
  left: 45%;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  transform: translate(-50%, -50%);
}

.tutorial-hands {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tutorial-hand {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.tutorial-hand-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}

.tutorial-hand-rank {
  color: var(--gold);
  font-weight: 800;
}

.tutorial-hand-name {
  font-weight: 700;
}

.tutorial-cards {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.tutorial-cards .poker-card {
  width: 38px;
  height: 54px;
  flex: 0 0 auto;
}

.tutorial-skip {
  margin-top: 8px;
}

/* ---------- Account: actions, background sound ---------- */
.account-actions,
.sound-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sound-settings h3 {
  margin: 0;
}

.sound-range input[type="range"] {
  padding: 0;
  border: none;
  background: none;
  accent-color: var(--gold);
}

.sound-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ---------- Player statistics ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.stats-tile {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px;
}

.stats-tile-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
}

.stats-tile-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

.stats-subtitle {
  margin: 18px 0 8px;
  font-size: 16px;
}

.stats-table-wrap {
  overflow-x: auto;
  padding: 6px 10px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.stats-table th,
.stats-table td {
  padding: 7px 6px;
  text-align: right;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

.stats-table th:first-child,
.stats-table td:first-child {
  text-align: left;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.stats-table th {
  color: var(--text-dim);
  font-weight: 600;
}

/* Settings card on the account screen (js/app.js wireSettings). */
.settings-card h3 {
  margin: 0 0 10px;
}

.settings-card .field {
  display: block;
  margin-bottom: 12px;
}

.settings-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.settings-inline input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.settings-inline .btn {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.settings-avatar {
  font-size: 34px;
  line-height: 1;
}

.settings-card select {
  width: 100%;
  margin-top: 4px;
}

.settings-card .emoji-grid {
  margin-top: 8px;
}

.settings-saved {
  color: var(--gold);
  margin: 6px 0 0;
}

/* Tutorial quiz (js/tutorial.js): "which hand wins?" */
.tutorial-quiz-types {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.tutorial-quiz-hand {
  padding: 8px 10px;
  margin: 8px 0;
  border-radius: 10px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.04);
}

.tutorial-quiz-hand.is-board {
  background: rgba(0, 0, 0, 0.18);
}

.tutorial-quiz-hand.is-winner {
  border-color: #3ecf6b;
}

.tutorial-quiz-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--gold);
}

.tutorial-quiz-made {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
}

.tutorial-quiz-answers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.tutorial-quiz-answers .btn {
  width: auto;
  margin: 0;
  padding: 10px 6px;
  font-size: 14px;
}

.tutorial-quiz-answers .btn.is-correct {
  border-color: #3ecf6b;
  background: rgba(62, 207, 107, 0.18);
  opacity: 1;
}

.tutorial-quiz-answers .btn.is-wrong {
  border-color: #e0525f;
  background: rgba(224, 82, 95, 0.18);
  opacity: 1;
}

.tutorial-quiz-feedback {
  font-weight: 700;
  margin: 10px 0 0;
}

.tutorial-quiz-feedback.is-ok { color: #3ecf6b; }
.tutorial-quiz-feedback.is-bad { color: #ff7b86; }

.tutorial-quiz-score {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  text-align: center;
  margin: 16px 0;
}

/* Şeref listesi / hall of fame (js/hall-of-fame.js) */
.hall-modes {
  flex-wrap: wrap;
}

.hall-modes .type-tab {
  min-width: calc(50% - 4px);
}

.hall-size {
  margin: 0 0 8px;
}

.hall-table td:first-child,
.hall-table th:first-child {
  width: 40px;
  text-align: center;
}

.hall-message {
  margin: 14px 4px;
  text-align: center;
  color: var(--gold);
  font-weight: 600;
  line-height: 1.4;
}

/* Veri düzeltme + ✉️ box (js/data-report.js) */
.data-report-btn {
  margin-top: 14px;
  font-size: 13px;
  opacity: 0.85;
}

.report-card textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 130px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.report-intro {
  text-align: left;
  line-height: 1.45;
}

.report-count {
  text-align: right;
  margin: 4px 0 8px;
}

.report-status {
  color: #5bd37a;
  font-weight: 600;
}

.mail-btn.is-lit {
  box-shadow: 0 0 14px 4px rgba(255, 213, 74, 0.75);
  background: rgba(255, 213, 74, 0.18);
  animation: mail-blink 1.2s ease-in-out infinite;
}

/* An unread answer: the ✉️ box blinks. */
@keyframes mail-blink {
  0%, 100% { box-shadow: 0 0 14px 4px rgba(255, 213, 74, 0.8); background: rgba(255, 213, 74, 0.22); }
  50% { box-shadow: 0 0 2px 0 rgba(255, 213, 74, 0.1); background: rgba(255, 213, 74, 0.04); }
}

.mail-list {
  max-height: 60vh;
  overflow-y: auto;
  text-align: left;
  margin-bottom: 10px;
}

.mail-thread {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}

.mail-where {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.mail-msg {
  border-radius: 10px;
  padding: 8px 10px;
  margin: 6px 0;
}

.mail-msg.mine {
  background: rgba(255, 255, 255, 0.06);
}

.mail-msg.admin {
  background: rgba(255, 213, 74, 0.12);
  border: 1px solid rgba(255, 213, 74, 0.45);
}

.mail-head {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.mail-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.mail-wait {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

/* A flag that has no emoji (Northern Cyprus, Northern Ireland — js/geo-loader.js decorateFlag) */
.flag-inline {
  /* A fixed width: some flag files (Northern Ireland) have no size of their own and were drawn
     300px wide, stretched above the text (2026-10-01). */
  height: 0.95em;
  width: 1.4em;
  object-fit: cover;
  display: inline-block;
  vertical-align: -0.1em;
  margin-right: 0.3em;
  border-radius: 2px;
}

/* Birth date as day / month / year lists (js/consent.js) */
.birth-selects {
  display: grid;
  grid-template-columns: 1.05fr 1.55fr 1.2fr;
  gap: 8px;
}

.birth-selects select {
  width: 100%;
  min-width: 0;
  font-size: 14px;
  padding-left: 8px;
  padding-right: 4px;
}

/* Internet required (js/offline-guard.js) — above the game and the test gate, below the studio splash. */
.offline-guard {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 12, 8, 0.94);
}

.offline-guard[hidden] {
  display: none;
}

.offline-card {
  max-width: 360px;
  width: 100%;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.offline-icon {
  font-size: 40px;
  filter: grayscale(1);
}

.offline-card p {
  color: var(--text-dim);
  margin: 0;
}

/* Home screen on a phone held sideways (2026-10-03, the owner's choice "A", then refined): the player and
   the poker types (one per line) on the left; the four mode cards 2 x 2 on the right with the other
   types' progress under them, one under each column; the "entertainment only" note across the bottom —
   everything without scrolling down. */
@media (orientation: landscape) and (min-width: 640px) and (max-height: 500px) {
  .screen[data-screen="home"] {
    padding-top: calc(8px + var(--safe-top, 0px));
    padding-bottom: calc(8px + var(--safe-bottom, 0px));
  }

  [data-screen="home"] .screen-inner {
    max-width: 980px;
    display: grid;
    grid-template-columns: minmax(220px, 28%) minmax(0, 1fr);
    grid-template-areas:
      "header modes"
      "ptitle modes"
      "types  modes"
      "types  otitle"
      "types  other"
      "disc   disc";
    grid-template-rows: auto auto auto auto 1fr auto;
    column-gap: 18px;
    align-items: start;
  }

  [data-screen="home"] .home-header { grid-area: header; margin-bottom: 8px; }
  [data-screen="home"] .home-header + .home-section-title { grid-area: ptitle; margin: 0 0 6px; }
  [data-screen="home"] #homeTypes { grid-area: types; }
  [data-screen="home"] .home-modes + .home-section-title { grid-area: otitle; margin-top: 2px; }
  [data-screen="home"] .home-disclaimer { grid-area: disc; margin: 4px 0 0; }

  [data-screen="home"] .home-sub {
    flex-wrap: wrap;
  }

  [data-screen="home"] .type-tabs {
    flex-direction: column;
  }

  [data-screen="home"] .type-tab {
    padding: 8px 10px;
  }

  [data-screen="home"] .home-modes {
    grid-area: modes;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  [data-screen="home"] .mode-card {
    padding: 10px 14px;
    gap: 4px;
  }

  /* One other type under each column of mode cards. */
  [data-screen="home"] .home-other {
    grid-area: other;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 0;
  }
  /* Career hubs (all four modes): header on one row, the country picture left, the target card right. */
  .screen:is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) {
    padding-top: calc(8px + var(--safe-top, 0px));
    padding-bottom: calc(8px + var(--safe-bottom, 0px));
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .screen-inner {
    max-width: 980px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "header header"
      "hero   toast"
      "hero   card"
      "hero   rep";
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    height: calc(100vh - 24px - var(--safe-top, 0px) - var(--safe-bottom, 0px));
    max-height: 420px;
    column-gap: 16px;
    align-items: start;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .career-header {
    grid-area: header;
    flex-wrap: nowrap;
    margin-bottom: 10px;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .career-avatar {
    width: 42px;
    height: 42px;
    font-size: 21px;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .career-header-actions {
    order: 1;
    flex-basis: auto;
    margin-top: 0;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .career-wallet {
    order: 2;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .career-toast {
    grid-area: toast;
    margin-bottom: 8px;
    padding: 6px 10px;
    font-size: 12px;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .hero-slot {
    grid-area: hero;
    align-self: stretch;
    margin: 0;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .country-hero {
    height: 100%;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .screen-inner:has(> .hero-slot[hidden]) .career-toast,
  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .hero-slot[hidden] + .card,
  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .hero-slot[hidden] ~ .data-report-btn {
    grid-column: 1 / -1;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .card {
    grid-area: card;
    margin-bottom: 0;
    padding: 12px 16px;
    max-height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .data-report-btn {
    grid-area: rep;
    margin-top: 6px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .card h2 {
    font-size: 18px;
    margin-bottom: 2px;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .card .subtitle {
    margin-bottom: 4px;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .scroll-list {
    max-height: 150px;
  }

  :is([data-screen="career"], [data-screen="mediumCareer"], [data-screen="ultimateCareer"], [data-screen="shortCareer"]) .card .btn {
    padding-top: 9px;
    padding-bottom: 9px;
    margin-top: 6px;
  }
}


/* Member who arrived from the Garden Lantern portal: the sign-in controls give way to one button
   (js/app.js handlePortalArrival); the age/consent form below the card stays. */
.screen.portal-mode .card > :not(.portal-only) {
  display: none;
}
.portal-only[hidden] {
  display: none;
}
.portal-only p {
  margin: 0 0 12px;
  text-align: center;
}

/* A consent field the player still has to fill in (js/app.js validateAuthConsent). */
.consent-form .field-invalid {
  outline: 2px solid var(--danger);
  outline-offset: 4px;
  border-radius: 8px;
}

/* ---------- Achievements (js/achievements.js, 2026-10-06) ---------- */
.feat-toast {
  position: fixed;
  left: 50%;
  top: calc(10px + var(--safe-top, 0px));
  transform: translate(-50%, -140%);
  z-index: 1200;
  max-width: min(92vw, 440px);
  padding: 10px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2a2208, #4a3a0c);
  border: 1px solid var(--gold);
  color: #ffe9a6;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s ease;
  pointer-events: none;
}

.feat-toast.is-in {
  transform: translate(-50%, 0);
}

.feat-list {
  margin: 0 0 18px;
}

.feat-head {
  font-weight: 800;
  font-size: 17px;
  color: var(--gold);
  margin: 4px 0 10px;
}

.feat-group {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.feat-group > summary {
  cursor: pointer;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 14px;
}

.feat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--card-border);
  font-size: 13px;
  color: var(--text-dim);
}

.feat-row.is-done {
  color: var(--text);
  background: rgba(232, 185, 35, 0.08);
}

.feat-row .feat-reward {
  white-space: nowrap;
  color: var(--gold);
  font-weight: 700;
}

/* A reward waits (2026-10-06): the mode's 🏆 blinks with a gold glow and shows how many. */
.icon-btn.has-claim {
  position: relative;
  border-color: var(--gold);
  animation: claim-blink 1s ease-in-out infinite;
}

.icon-btn .claim-dot {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e0322b;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg, #111);
}

@keyframes claim-blink {
  0%,
  100% {
    background: var(--card);
    box-shadow: 0 0 0 rgba(255, 210, 60, 0);
    transform: scale(1);
  }
  50% {
    background: #5a4510;
    box-shadow: 0 0 14px 4px rgba(255, 210, 60, 0.85);
    transform: scale(1.12);
  }
}


.feat-row {
  align-items: center;
}

.feat-row.is-taken {
  opacity: 0.5;
}

.feat-row.is-taken .feat-reward {
  color: var(--text-dim);
  font-weight: 600;
}

.feat-row .feat-reward.is-new {
  animation: feat-reveal 1.4s ease-out;
}

@keyframes feat-reveal {
  0% { color: #ffe27a; transform: scale(1.35); text-shadow: 0 0 10px rgba(255, 213, 74, 0.9); }
  100% { transform: scale(1); }
}

/* "Open": locked (dim, 🔒) until reached, then bright gold like the coin amounts were. */
.feat-open {
  white-space: nowrap;
  background: none;
  border: 0;
  padding: 2px 0;
  font: inherit;
  font-weight: 700;
  color: var(--text-dim);
  opacity: 0.6;
}

.feat-row.is-ready .feat-open {
  color: var(--gold);
  opacity: 1;
  cursor: pointer;
}

.feat-waiting {
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(232, 185, 35, 0.08);
  padding: 10px 0;
  margin-bottom: 12px;
}

.feat-waiting-title {
  font-weight: 800;
  color: var(--gold);
  padding: 0 14px 8px;
}

.feat-open-all {
  display: block;
  width: calc(100% - 28px);
  margin: 10px 14px 0;
}

/* What a reward paid: a bubble over the button, 3 s, then a slow fade (js/achievements.js). */
.feat-gain {
  position: fixed;
  z-index: 1300;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3c2, #f1c63a);
  color: #3a2700;
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 16px rgba(255, 213, 74, 0.55);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.85);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.feat-gain::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  margin-left: -7px;
  border: 7px solid transparent;
  border-bottom: 0;
  border-top-color: #f1c63a;
}

.feat-gain.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.feat-gain.is-out {
  opacity: 0;
  transition: opacity 1.5s ease-in;
}

/* An opened reward waits for its bubble: "Open" dimmed, then the row fades away with the bubble. */
.feat-row.is-opened .feat-open,
.feat-waiting.is-opened .feat-open,
.feat-waiting.is-opened .feat-open-all {
  opacity: 0.35;
  cursor: default;
}

.feat-row.is-leaving,
.feat-waiting.is-leaving {
  opacity: 0;
  transition: opacity 1.5s ease-in;
}

.feat-group-dot {
  display: inline-block;
  margin-left: 8px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e0322b;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

