#game-fruitmachine {
  align-items: center;
  justify-content: flex-start;
  padding: 88px 8px 20px;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#fruitmachine-wrap {
  width: min(980px, 100%);
  background: rgba(18, 12, 8, 0.9);
  border: 2px solid #8b5a2b;
  border-radius: 14px;
  padding: 12px 10px 14px;
  color: #e0c9a6;
  font-family: "Courier New", monospace;
  box-sizing: border-box;
}

#fruitmachine-layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.fruit-machine-rail {
  flex: 0 0 min(168px, 26vw);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 10px 12px;
  border-radius: 12px;
  border: 2px solid #6b4423;
  background: linear-gradient(180deg, #1a100a 0%, #0c0805 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 206, 140, 0.08);
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.35;
}

.fruit-machine-rail--right {
  flex-basis: min(200px, 30vw);
}

.fruit-topup-block {
  margin: 0 0 6px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(139, 90, 43, 0.45);
}

.fruit-topup-toggle {
  display: block;
  width: 100%;
  padding: 9px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  border: 2px solid #c9a227 !important;
  background: linear-gradient(180deg, #5c3d22 0%, #3d2818 100%) !important;
  color: #ffe8c8 !important;
  font-family: inherit;
}

.fruit-topup-toggle:active {
  filter: brightness(1.06);
}

.fruit-topup-panel {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.fruit-topup-label {
  font-size: 0.72rem;
  color: #c9a88a;
  text-align: left;
}

.fruit-topup-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 6px;
  font-size: 0.9rem;
  font-family: inherit;
  border-radius: 8px;
  border: 2px solid #6b4423;
  background: #120b07;
  color: #ffe8c8;
}

.fruit-topup-submit-btn {
  padding: 8px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  border: 2px solid #8b5a2b !important;
  background: #2b1b12 !important;
  color: #e0c9a6 !important;
  font-family: inherit;
}

.fruit-topup-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fruit-topup-hint {
  margin: 0;
  font-size: 0.65rem;
  line-height: 1.38;
  color: #a89078;
  text-align: left;
}

.fruit-rail-heading {
  margin: 0 0 2px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c9a227;
  text-align: center;
}

.fruit-machine-rail p {
  margin: 0;
}

.fruit-machine-center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 4px 0;
}

.fruit-machine-center h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: #ffe8c8;
}

#fruit-bet-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 10px 0 6px;
}

/* Force all Fruit Machine controls to pub theme (except the Back button). */
#game-fruitmachine button:not(.back-btn) {
  border: 2px solid #8b5a2b !important;
  background: #2b1b12 !important;
  color: #e0c9a6 !important;
  border-radius: 8px;
  font-family: inherit;
}

.fruit-bet-btn,
#fruit-spin-btn,
#fruit-reset-btn,
#fruit-collect-btn,
#fruit-gamble-btn,
#fruit-auto-10-btn,
#fruit-auto-25-btn,
#fruit-auto-50-btn,
#fruit-auto-until-win-btn,
#fruit-auto-stop-btn,
#fruit-reset-stats-btn {
  border: 2px solid #8b5a2b;
  background: #2b1b12;
  color: #e0c9a6;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.fruit-bet-btn.active {
  background: #8b5a2b !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 236, 186, 0.35);
}

#fruit-post-win-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0;
}

#fruit-nudges {
  margin: 6px 0 2px;
  font-size: 0.9rem;
}

.fruit-feature-banner {
  box-sizing: border-box;
  width: min(520px, 96%);
  margin: 6px auto 8px;
  padding: 13px 16px;
  border: 3px solid #ffd24d;
  border-radius: 12px;
  background: linear-gradient(180deg, #6b210f 0%, #321107 100%);
  color: #fff3b0;
  font-size: clamp(1rem, 4.2vw, 1.35rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
  box-shadow:
    0 0 0 2px rgba(255, 210, 77, 0.28),
    0 0 22px rgba(255, 190, 45, 0.46),
    inset 0 0 16px rgba(255, 210, 77, 0.18);
  animation: fruitFeaturePulse 1.05s ease-in-out infinite;
}

.fruit-feature-banner[hidden] {
  display: none !important;
}

.fruit-feature-banner--hold {
  border-color: #73e4ff;
  background: linear-gradient(180deg, #174762 0%, #092131 100%);
  color: #d9f8ff;
  box-shadow:
    0 0 0 2px rgba(115, 228, 255, 0.25),
    0 0 22px rgba(73, 199, 255, 0.42),
    inset 0 0 16px rgba(115, 228, 255, 0.16);
}

#fruit-nudge-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2px 0 10px;
}

.fruit-nudge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 86px;
}

.fruit-nudge-col-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

#fruit-nudge-controls button {
  min-width: 56px;
  padding: 7px 10px;
  font-size: 1rem;
  line-height: 1;
}

#fruit-nudges,
#fruit-nudge-controls button,
.fruit-hold-btn {
  transition: filter 0.16s ease, opacity 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

#fruitmachine-wrap.fruit-feature-nudge-ready #fruit-nudges {
  color: #ffe46b;
  font-size: 1.05rem;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(255, 210, 77, 0.72);
}

#fruit-nudge-controls.fruit-feature-available button:not(:disabled) {
  border-color: #ffd24d !important;
  background: linear-gradient(180deg, #a96317 0%, #5f2609 100%) !important;
  color: #fff6bd !important;
  box-shadow:
    0 0 0 2px rgba(255, 210, 77, 0.26),
    0 0 15px rgba(255, 190, 45, 0.46) !important;
  transform: translateY(-1px);
  animation: fruitControlGlow 1s ease-in-out infinite;
}

#fruit-volume-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 10px;
}

#fruit-volume-slider {
  width: 170px;
}

/* Vertical volume in left rail (desktop / wide layout) */
.fruit-volume-vertical {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 4px 0 6px;
  flex: 0 0 auto;
}

.fruit-volume-vertical label {
  font-size: 0.75rem;
  color: #c9a88a;
}

.fruit-volume-slider-wrap {
  height: 110px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  margin: 4px 0;
}

.fruit-volume-slider-wrap #fruit-volume-slider {
  width: 100px;
  height: 28px;
  margin: 0;
  transform: rotate(-90deg);
  transform-origin: center center;
  cursor: pointer;
}

.fruit-volume-vertical #fruit-volume-value {
  font-size: 0.8rem;
  color: #e8d4bc;
}

#fruit-side-info #fruit-stats {
  margin: 4px 0 6px;
  padding: 8px 6px;
  border: 1px dashed rgba(224, 201, 166, 0.4);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

#fruit-side-info #fruit-stats p {
  margin: 3px 0;
  font-size: 0.78rem;
}

#fruit-side-info #fruit-reset-stats-btn {
  margin-top: auto;
  padding: 8px 6px;
  font-size: 0.75rem;
}

#fruit-side-info #fruit-balance {
  font-weight: 700;
  color: #ffe8c8;
  font-size: 0.88rem;
}

.fruit-bonus-overlay {
  position: fixed;
  inset: 0;
  z-index: 25000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.72);
}

.fruit-bonus-overlay.hidden {
  display: none !important;
}

.fruit-bonus-panel {
  width: min(720px, 100%);
  background: linear-gradient(180deg, #2d1a10 0%, #140d09 100%);
  border: 3px solid #8b5a2b;
  border-radius: 14px;
  padding: 20px 16px 18px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.fruit-bonus-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  color: #ffe8c8;
}

.fruit-bonus-line {
  margin: 0 0 16px;
  font-size: 0.98rem;
  line-height: 1.35;
  color: #e0c9a6;
}

.fruit-lockin-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.fruit-lockin-status span {
  padding: 8px 6px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 8px;
  background: rgba(20, 13, 9, 0.72);
  color: #ffe8c8;
  font-size: 0.86rem;
  font-weight: 700;
}

.fruit-lockin-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 auto 12px;
}

.fruit-lockin-cell {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px 8px;
  border: 2px solid #65401f;
  border-radius: 10px;
  background: linear-gradient(180deg, #27180f 0%, #120b07 100%);
  color: #d9c1a0;
  font-size: 0.78rem;
  line-height: 1.15;
  box-shadow: inset 0 0 0 1px rgba(255, 206, 140, 0.08);
}

.fruit-lockin-cell.active {
  color: #fff3cf;
  border-color: #f3c638;
  background: radial-gradient(circle at center, rgba(243, 198, 56, 0.26), rgba(54, 31, 15, 0.94));
  box-shadow: 0 0 16px rgba(243, 198, 56, 0.52), inset 0 0 0 1px rgba(255, 235, 150, 0.38);
  transform: scale(1.03);
}

.fruit-lockin-cell-num {
  position: absolute;
  top: 4px;
  left: 6px;
  opacity: 0.72;
  font-size: 0.65rem;
}

.fruit-lockin-cash,
.fruit-lockin-jackpot,
.fruit-lockin-red-george {
  border-color: #a7841b;
}

.fruit-lockin-last-orders {
  border-color: #8d2f22;
  color: #ffb09d;
}

.fruit-lockin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.fruit-lockin-actions button {
  min-width: 92px;
  padding: 10px 14px;
  font-weight: 800;
  border: 2px solid #c9a227;
  border-radius: 10px;
  background: linear-gradient(180deg, #4c3018 0%, #211109 100%);
  color: #ffe8c8;
  cursor: pointer;
}

.fruit-lockin-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fruit-bonus-result {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: 1rem;
  color: #ffe8c8;
}

#fruit-auto-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}

#fruit-auto-status {
  margin: 6px 0;
  opacity: 0.9;
}


#fruit-collect-btn:disabled,
#fruit-gamble-btn:disabled,
#fruit-spin-btn:disabled,
#fruit-auto-stop-btn:disabled,
#fruit-lockin-move-btn:disabled,
#fruit-lockin-hi-btn:disabled,
#fruit-lockin-lo-btn:disabled,
#fruit-lockin-collect-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#fruit-max-win-note {
  opacity: 0.85;
  font-size: 0.95rem;
  margin: 6px 0 10px;
}

#fruit-lockin-resume-btn {
  margin: 6px auto 10px;
  padding: 10px 14px;
  border: 2px solid #f3c638;
  border-radius: 10px;
  background: linear-gradient(180deg, #5a3718 0%, #211109 100%);
  color: #fff3cf;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(243, 198, 56, 0.28);
}

#fruit-reels-wrap {
  margin: 6px 0 4px;
  width: 100%;
  max-width: 420px;
}

#fruit-reels {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 0;
}

.fruit-winline-legend {
  margin: 0 auto 4px;
  max-width: 420px;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #d4b896;
  opacity: 0.95;
}

.fruit-hold-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 6px;
}

.fruit-hold-btn {
  min-width: 76px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 2px solid #6b4423;
  border-radius: 8px;
  background: linear-gradient(180deg, #2a1810 0%, #120b07 100%);
  color: #c9a88a;
  cursor: pointer;
}

.fruit-hold-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#game-fruitmachine .fruit-hold-btn.fruit-feature-available:not(:disabled) {
  border-color: #73e4ff !important;
  background: linear-gradient(180deg, #16617c 0%, #0a3244 100%) !important;
  color: #e8fbff !important;
  box-shadow:
    0 0 0 2px rgba(115, 228, 255, 0.24),
    0 0 15px rgba(73, 199, 255, 0.44) !important;
  transform: translateY(-1px);
  animation: fruitControlGlow 1s ease-in-out infinite;
}

#game-fruitmachine .fruit-hold-btn.active {
  border-color: #f8f06b !important;
  color: #101010 !important;
  background: linear-gradient(180deg, #fff26a 0%, #f2b833 100%) !important;
  box-shadow:
    0 0 0 2px rgba(255, 242, 106, 0.3),
    0 0 18px rgba(255, 242, 106, 0.5) !important;
}

.fruit-hold-hint {
  margin: 2px auto 4px;
  max-width: 420px;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #a89078;
}

.fruit-reel-column.fruit-column-held .fruit-reel-cell {
  border-color: #8a7020;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.25), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.fruit-reel-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  transition: filter 0.12s ease;
}

.fruit-reel-cell {
  width: 88px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #6b4423;
  border-radius: 8px;
  background: linear-gradient(180deg, #25160e 0%, #100a07 100%);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 206, 140, 0.12), 0 2px 6px rgba(0, 0, 0, 0.4);
  opacity: 0.82;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.fruit-reel-cell.fruit-reel-winline {
  min-height: 72px;
  width: 96px;
  font-size: 2.1rem;
  border-color: #c9a227;
  border-width: 2px;
  background: linear-gradient(180deg, #2d1a10 0%, #140d09 100%);
  box-shadow:
    inset 0 0 0 2px rgba(201, 162, 39, 0.35),
    0 0 0 1px rgba(255, 220, 140, 0.25),
    0 3px 10px rgba(0, 0, 0, 0.5);
  opacity: 1;
}

.fruit-reel-column.spinning .fruit-reel-cell {
  animation: fruitReelShake 0.12s linear infinite;
  filter: blur(1px) brightness(1.08);
  opacity: 1;
}

#fruit-side-rules .fruit-paytable {
  max-width: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.fruit-paytable-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #ffe8c8;
  text-align: center;
}

.fruit-paytable-intro {
  margin: 0 0 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #c9a88a;
  text-align: left;
}

.fruit-paytable-list {
  margin: 0;
  padding: 0 0 0 1.05em;
  font-size: 0.8rem;
  line-height: 1.42;
  color: #e8d4bc;
}

.fruit-paytable-list li {
  margin-bottom: 4px;
}

.fruit-pay-emoji {
  display: inline-block;
  min-width: 1.5em;
}

.fruit-paytable-foot {
  margin: 10px 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #a89078;
  text-align: left;
}

@media (max-width: 700px) {
  #fruitmachine-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .fruit-machine-rail {
    flex: 1 1 auto;
    max-width: none;
  }

  .fruit-machine-rail--right {
    flex-basis: auto;
    order: 3;
  }

  .fruit-machine-center {
    order: 1;
  }

  .fruit-lockin-status,
  .fruit-lockin-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #fruit-side-info {
    order: 2;
  }

  .fruit-volume-vertical {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 8px 0;
  }

  .fruit-volume-slider-wrap {
    height: auto;
    width: auto;
    margin: 0;
  }

  .fruit-volume-slider-wrap #fruit-volume-slider {
    width: min(200px, 55vw);
    height: 28px;
    transform: none;
  }

  #fruit-side-info #fruit-reset-stats-btn {
    margin-top: 4px;
  }
}

@keyframes fruitReelShake {
  0% { transform: translateY(-1px); }
  50% { transform: translateY(1px); }
  100% { transform: translateY(-1px); }
}

@keyframes fruitFeaturePulse {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.18); transform: scale(1.015); }
}

@keyframes fruitControlGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.22); }
}
:root {
  --dauber-color: #4caf50;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  background: #2b1b12;
  color: #e0c9a6;
}

/* Views */
.view {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease;
}
.view.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

/* Outside landing — classic: centred artwork, controls ~15% from bottom */
#view-outside.view.active {
  display: block;
  padding: 0;
  overflow: hidden;
}

/* Classic backgrounds: full image visible (contain + centre), never cropped cover */
.bg {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
}
#view-outside .bg {
  background-color: #2b1b12;
}
/* Landscape / desktop: wide hero; portrait phones: vertical crop */
#view-outside .pub-outside-bg {
  background-image: url('/outside-pub-wide.jpg');
}
@media (orientation: portrait) {
  #view-outside .pub-outside-bg {
    background-image: url('/outside-pub-portrait.jpg');
  }
}
#view-inside .pub-inside-bg {
  background-color: #000;
}

.outside-door-panel {
  position: absolute;
  left: 50%;
  bottom: max(12%, env(safe-area-inset-bottom, 0px) + 48px);
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: min(92%, 360px);
  padding: 0 12px;
  box-sizing: border-box;
  pointer-events: none;
}

.outside-door-panel > * {
  pointer-events: auto;
}

body.web-browser-mode .outside-door-panel {
  bottom: max(env(safe-area-inset-bottom, 0px) + 14px, 2.5%);
  width: min(94%, 380px);
  gap: 14px;
}

.outside-door-panel .outside-footer {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}

.outside-footer {
  position: absolute;
  left: 50%;
  bottom: max(12%, env(safe-area-inset-bottom, 0px) + 48px);
  transform: translateX(-50%);
  z-index: 10;
  width: auto;
  max-width: min(92%, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  box-sizing: border-box;
  background: transparent;
}
@media (min-width: 600px) {
  .outside-footer {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: min(94%, 560px);
    gap: 12px;
  }
  .outside-footer .outside-actions {
    width: auto;
    flex: 0 0 auto;
  }
  .outside-footer #enter-btn {
    width: auto;
    flex: 0 0 auto;
  }
}
@media (min-width: 901px) {
  .outside-footer {
    bottom: max(2%, env(safe-area-inset-bottom, 0px) + 10px);
  }
}
.outside-footer .outside-actions {
  margin: 0;
  justify-content: center;
}
.outside-footer #enter-btn {
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

/* Top-right: Demo + ambience mute (shared bar, no overlap) */
.pub-top-right-bar[hidden] { display: none !important; }
.pub-top-right-bar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 50010;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: none;
}

.pub-top-right-bar > * {
  pointer-events: auto;
}

.pub-lang-chip {
  appearance: none;
  border: 1px solid rgba(201, 162, 39, 0.65);
  background: rgba(28, 18, 10, 0.9);
  color: #f5e6c8;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 0.02em;
  padding: 0 10px;
  height: 44px;
  box-sizing: border-box;
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.pub-lang-chip:hover,
.pub-lang-chip:focus-visible {
  background: rgba(139, 90, 43, 0.95);
  outline: none;
}

.pub-ambience-toggle {
  appearance: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(201, 162, 39, 0.65);
  border-radius: 12px;
  background: rgba(28, 18, 10, 0.9);
  color: #f5e6c8;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.pub-ambience-toggle[aria-pressed='true'] {
  opacity: 0.72;
  border-color: rgba(160, 140, 120, 0.5);
}

.pub-ambience-toggle:focus-visible {
  outline: 2px solid #c9a227;
  outline-offset: 2px;
}

/* Outside door: compact chips (connect, rules, enter) — same pub brown */
.pub-outside-chip {
  display: inline-block;
  padding: 12px 22px;
  font-size: 1em;
  font-family: 'Courier New', monospace;
  background: #8b5a2b;
  color: #fff;
  border: 3px solid #5c3a1f;
  border-radius: 12px;
  cursor: pointer;
  z-index: 10;
  box-sizing: border-box;
  text-align: center;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.15);
}

.pub-outside-chip--enter {
  font-size: 1em;
  padding: 12px 22px;
}

.pub-outside-chip--demo {
  background: #2a1a10;
  border-color: #c9a227;
  color: #f5e6c8;
  font-size: 0.92em;
  padding: 10px 18px;
}

.web-browser-login {
  position: static;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  box-sizing: border-box;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.web-login-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.web-login-tab {
  appearance: none;
  flex: 1 1 auto;
  min-width: 7rem;
  padding: 10px 16px;
  border-radius: 12px;
  border: 3px solid #5c3a1f;
  background: #8b5a2b;
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center;
}

.web-login-tab--active {
  background: #5c3a1f;
  border-color: #c9a227;
  color: #f5e6c8;
}

@media (min-width: 901px) {
  body.web-browser-mode .outside-door-panel {
    bottom: max(2%, env(safe-area-inset-bottom, 0px) + 10px);
  }
}

/* Door login: Telegram + guest on direct webapp URL only (hidden in Telegram Mini App). */
body:not(.web-browser-mode) .web-login-tabs,
body:not(.web-browser-mode) #web-login-pane-guest,
body:not(.web-browser-mode) #web-browser-login {
  display: none !important;
}

.web-login-pane {
  text-align: center;
}

.web-login-pane[hidden] {
  display: none !important;
}

.web-login-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: rgba(26, 18, 12, 0.92);
  border: 3px solid #5c3a1f;
  border-radius: 12px;
  color: #e0c9a6;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
}

.telegram-login-widget-host {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  width: 100%;
}

.telegram-login-widget-host[hidden] {
  display: none !important;
}

.telegram-login-widget-host iframe {
  max-width: 100%;
}

.door-signed-in-label {
  margin: 0;
  padding: 10px 14px;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: #d4f5e2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.door-signed-in-label[hidden] {
  display: none !important;
}

#pub-demo-banner {
  display: none;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 25000;
  width: min(96%, 520px);
  padding: 10px 12px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.92);
  border: 2px solid #c9a227;
  border-radius: 10px;
  color: #f5e6c8;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

#pub-demo-banner:not([hidden]) {
  display: block;
}

#pub-demo-banner .pub-demo-banner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

#pub-demo-banner button {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid #8b5a2b;
  background: #5c3a1f;
  color: #e0c9a6;
  cursor: pointer;
}

#pub-demo-banner #pub-demo-connect-btn {
  border-color: #c9a227;
  background: #8b5a2b;
  color: #fff;
}

body.pub-demo-active #view-inside,
body.pub-demo-active .game-screen.visible {
  padding-top: calc(env(safe-area-inset-top, 0px) + 52px);
}

.pub-demo-pay-hint {
  opacity: 0.55;
  pointer-events: none;
}

.outside-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

#wallet-setup-panel {
  align-self: center;
  width: min(520px, calc(100% - 32px));
  z-index: 10;
  display: none;
  text-align: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}

body.pub-ton-only #wallet-setup-panel {
  display: none !important;
}

body.pub-ton-only #network-pick-row,
body.pub-ton-only #pick-shido-btn,
body.pub-ton-only #pick-ton-btn,
body.pub-ton-only #shido-setup-block,
body.pub-ton-only #create-wallet-btn,
body.pub-ton-only #wallet-recheck-btn,
body.pub-ton-only #pub-menu-create-wallet,
body.pub-ton-only #pub-menu-restore-wallet,
body.pub-ton-only .pub-menu-network,
body.pub-ton-only .pub-menu-sep {
  display: none !important;
}

.ton-setup-hint {
  font-family: 'Courier New', monospace;
  color: #d4b88a;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0 0 12px;
}

/* Ton Connect SDK anchor (hidden; we use the compact Connect wallet chip) */
.ton-connect-button-root {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

#enter-btn {
  flex-shrink: 0;
}

#ton-connect-bind-btn.outside-connect-hidden {
  display: none !important;
}

.network-pick-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.network-pick-label {
  font-family: 'Courier New', monospace;
  color: #e0c9a6;
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.25;
}

.network-pick-pair {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
}

.network-pick-btn {
  flex: 1;
  padding: 12px 10px;
  font-size: 1.05em;
  font-family: 'Courier New', monospace;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  min-height: 48px;
  box-sizing: border-box;
  margin: 0;
}

.network-pick-shido {
  background: #4a3728;
  border: 3px solid #5c3a1f;
}

.network-pick-ton {
  background: #059669;
  border: 3px solid #047857;
}

.network-pick-btn.network-pick-active {
  box-shadow: 0 0 0 2px #ffd700, 0 0 16px rgba(255, 215, 0, 0.35);
}

#wallet-setup-panel button:not(.network-pick-btn) {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 12px;
  padding: 18px 40px;
  font-size: 1.15em;
  font-family: 'Courier New', monospace;
  background: #8b5a2b;
  color: white;
  border: 3px solid #5c3a1f;
  border-radius: 12px;
  cursor: pointer;
}

#wallet-setup-panel button:not(.network-pick-btn):last-child {
  margin-bottom: 0;
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
#loading-content {
  text-align: center;
  color: #e0c9a6;
  font-family: 'Courier New', monospace;
  max-width: 80%;
}
#loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #5c3a1f;
  border-top: 5px solid #8b5a2b;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
#loading-message {
  font-size: 1.2em;
  line-height: 1.5;
  text-shadow: 2px 2px 0 #2b1b12;
}

/* Inside pub — original overlay: art full screen, tabs on bottom (scroll menu if needed) */
#view-inside.view {
  background: #000;
}
#view-inside.view.active {
  display: block !important;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: #000;
  height: 100dvh;
  max-height: 100dvh;
  box-sizing: border-box;
}

#view-inside.view.active #games-menu {
  display: flex !important;
  visibility: visible;
  opacity: 1;
}

.pub-3d-canvas {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  touch-action: none;
}
#view-inside.pub-3d-on .pub-3d-canvas {
  display: block;
}
#view-inside.pub-3d-on .pub-inside-bg,
#view-inside.pub-3d-on .inside-scroll-sizer {
  opacity: 0;
  pointer-events: none;
}
#view-inside.pub-3d-on {
  overflow: hidden !important;
  touch-action: none;
}
.pub-3d-hint {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  margin: 0;
  padding: 8px 14px;
  max-width: 90vw;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: #f5e6c8;
  background: rgba(20, 12, 8, 0.75);
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 8px;
  pointer-events: none;
}
.pub-3d-hint:empty,
.pub-3d-hint[hidden] {
  display: none;
}
.pub-3d-hint--fade {
  opacity: 0;
  transition: opacity 0.8s ease;
}

#view-inside .inside-scroll-sizer {
  display: none;
  pointer-events: none;
  background: #000;
}

.pub-game-rules {
  position: relative;
  background: rgba(0, 0, 0, 0.65);
  color: #e0c9a6;
  padding: 16px 20px;
  margin: 70px 16px 12px;
  border-radius: 10px;
  border: 2px solid #8b5a2b;
  font-size: 1em;
  line-height: 1.4;
  z-index: 10;
}
.pub-game-meta {
  margin: 0 16px 12px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #6b4423;
  border-radius: 8px;
  color: #e0c9a6;
  font-size: 0.95em;
  line-height: 1.4;
}
.pub-game-status {
  margin: 12px 16px;
  color: #c9b08a;
  text-align: center;
}
/* World Cup — full-screen scroll (24 fixtures on mobile) */
#game-worldcup {
  background: #2b1b12;
  color: #e0c9a6;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  align-items: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  box-sizing: border-box;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
}
#worldcup-rules,
.pub-game-rules--compact {
  position: relative;
  margin: 0 auto 10px;
  width: min(920px, calc(100% - 24px));
  flex-shrink: 0;
  box-sizing: border-box;
  font-size: 0.92rem;
  line-height: 1.35;
  padding: 12px 14px;
}
#worldcup-pots p {
  margin: 0;
  font-size: 0.9rem;
}
#worldcup-meta,
#worldcup-pots,
.worldcup-round-winners {
  width: min(920px, calc(100% - 24px));
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
#worldcup-fixtures {
  margin: 0 auto 12px;
  width: min(920px, calc(100% - 24px));
  flex-shrink: 0;
  box-sizing: border-box;
}
#worldcup-form {
  display: grid;
  gap: 10px;
  padding-bottom: 8px;
}
#worldcup-submit {
  display: block !important;
  width: min(920px, calc(100% - 24px));
  margin: 12px auto 8px !important;
  padding: 12px;
  background: #8b5a2b !important;
  color: white !important;
  border: 2px solid #5c3a1f !important;
  border-radius: 8px;
  cursor: pointer !important;
  font-size: 1.1em !important;
  font-family: 'Courier New', monospace;
  flex-shrink: 0;
}
#worldcup-status {
  width: min(920px, calc(100% - 24px));
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
  padding-bottom: 8px;
}
.worldcup-day-select {
  display: block;
  width: min(520px, calc(100% - 32px));
  margin: 0 auto 12px;
  padding: 10px 12px;
  font-family: 'Courier New', monospace;
  background: #1a1008;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  box-sizing: border-box;
}
#worldcup-pots {
  text-align: center;
}
.worldcup-round-winners {
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(26, 16, 8, 0.85);
  border: 1px solid #6b4423;
  border-radius: 8px;
  color: #e0c9a6;
}
.worldcup-round-winners h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  text-align: center;
}
.worldcup-round-winners .round-winner-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.95em;
}
#donate-amount {
  display: block;
  width: min(520px, calc(100% - 32px));
  margin: 0 auto 12px;
  padding: 10px 12px;
  font-family: 'Courier New', monospace;
  background: #1a1008;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  box-sizing: border-box;
}
#worldcup-submit,
#donate-submit {
  display: block;
  width: min(520px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 12px 18px;
  background: #5c3a1f;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  cursor: pointer;
}
.pub-label {
  display: block;
  text-align: center;
  color: #c9b08a;
  margin: 8px 16px 6px;
}

/* Roast bubble — classic placement */
#roast-bubble {
  position: absolute;
  top: 10%;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px 18px;
  border-radius: 16px;
  border: 2px solid #8b5a2b;
  font-size: 1em;
  line-height: 1.35;
  max-width: 80%;
  text-align: center;
  z-index: 12;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
#roast-bubble:empty {
  display: none;
}

/*
 * Chill’s cat — tap zone on the black cat (new inside-pub artwork).
 */
#view-inside #chill-cat {
  position: absolute;
  z-index: 8;
  left: 18%;
  bottom: 26%;
  width: min(20vw, 130px);
  height: min(26vh, 160px);
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(139, 90, 43, 0.35);
  border-radius: 45%;
  box-sizing: border-box;
  touch-action: manipulation;
  background: transparent;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

#view-inside #chill-cat:hover,
#view-inside #chill-cat:focus-visible {
  background: rgba(139, 90, 43, 0.12);
  box-shadow: 0 0 0 2px rgba(139, 90, 43, 0.65);
  outline: none;
}

#view-inside #chill-cat::after {
  content: "Chill's TG";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  color: #e0c9a6;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid #8b5a2b;
  border-radius: 8px;
  padding: 4px 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#view-inside #chill-cat:hover::after,
#view-inside #chill-cat:focus-visible::after {
  opacity: 1;
}

@media (min-aspect-ratio: 4/3) {
  #view-inside #chill-cat {
    left: 23%;
    bottom: 28%;
    width: min(14vw, 120px);
    height: min(24vh, 150px);
  }
}

/* Games menu — classic flex-wrap pills at bottom (not tiny grid) */
#games-menu {
  position: absolute;
  bottom: max(1.5%, env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-end;
  gap: 10px;
  padding: 8px 10px 12px;
  z-index: 10;
  box-sizing: border-box;
  pointer-events: none;
  max-height: min(48vh, 320px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#games-menu .games-menu-row {
  display: contents;
}
#games-menu .pub-game-btn,
#games-menu button.pub-game-btn {
  pointer-events: auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: min(44vw, 168px);
  max-width: 100%;
  padding: 12px 18px;
  margin: 0;
  font-size: clamp(0.8rem, 2.6vw, 1.05em);
  font-weight: 700;
  background: #5c3a1f;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
  font-family: 'Courier New', monospace;
}
#games-menu .pub-game-btn__icon {
  font-size: 1em;
  line-height: 1;
}
#games-menu .pub-game-btn__label {
  line-height: 1.15;
  text-align: center;
}
#games-menu .pub-game-btn:active {
  transform: translateY(1px);
}

@media (max-width: 720px) {
  #view-inside.view.active {
    display: block !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    height: 100dvh;
    max-height: 100dvh;
  }
  #view-inside .inside-scroll-sizer {
    display: block;
    min-height: 100dvh;
    height: auto;
    box-sizing: border-box;
    /* portrait fallback before JS measures tab strip */
    padding-bottom: min(46vh, 300px);
    background: transparent;
    pointer-events: none;
  }
  #view-inside.view.active {
    background: #000;
  }
  /* Pin tabs below the contained bar art on portrait phones (3:2 image, letterboxed). */
  #games-menu {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 25;
    transform: none;
    align-content: flex-start;
    justify-content: center;
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.72) 0%,
      rgba(0, 0, 0, 0.88) 100%
    );
  }
  @media (orientation: portrait) {
    #games-menu {
      /* 50vh + 50vw/1.5 = bottom of contain-fit art; +58px ≈ one tab row lower */
      top: calc(50vh + 50vw / 1.5 + 58px);
      bottom: auto;
      max-height: calc(100dvh - 50vh - 50vw / 1.5 - 58px - env(safe-area-inset-bottom, 0px));
      padding: 10px 10px max(10px, env(safe-area-inset-bottom, 0px));
    }
    #view-inside .inside-scroll-sizer {
      min-height: calc(50vh + 50vw / 1.5 + 58px + min(46vh, 300px) + 24px);
    }
  }
  @media (orientation: landscape) {
    #games-menu {
      top: auto;
      bottom: 0;
      max-height: min(46vh, 300px);
      padding: 8px 10px max(10px, env(safe-area-inset-bottom, 0px));
    }
  }
}
@media (max-width: 720px) {
  body.web-browser-mode .outside-door-panel {
    bottom: max(env(safe-area-inset-bottom, 0px) + 10px, 1.5%);
    width: min(96%, 400px);
    gap: 10px;
  }

  body.web-browser-mode .outside-footer {
    gap: 8px;
    width: 100%;
  }

  body.web-browser-mode .outside-footer #enter-btn,
  body.web-browser-mode .outside-footer .pub-outside-chip {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  .outside-door-panel {
    bottom: max(env(safe-area-inset-bottom, 0px) + 12px, 2%);
    gap: 12px;
  }
  .outside-footer {
    bottom: auto;
  }
  #games-menu .pub-game-btn,
  #games-menu button.pub-game-btn {
    min-width: min(46vw, 160px);
    padding: 11px 14px;
    font-size: clamp(0.78rem, 3.2vw, 0.95em);
  }
}

/* Game screens */
.game-screen {
  position: absolute;
  inset: 0;
  display: none;
  background: #2b1b12;
  z-index: 20;
  pointer-events: none;
}
.game-screen:not(.visible) {
  display: none !important;
  pointer-events: none !important;
  opacity: 0;
}
.game-screen.visible {
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  opacity: 1;
}
.back-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: max(12px, env(safe-area-inset-left, 0px));
  padding: 12px 24px;
  font-size: 1.2em;
  background: #8b5a2b;
  color: white;
  border: 3px solid #5c3a1f;
  border-radius: 10px;
  cursor: pointer;
  z-index: 30;
}

/* Football card */
#football-rules {
  position: relative;
  background: rgba(0,0,0,0.65);
  color: #e0c9a6;
  padding: 16px 20px;
  margin: 70px 20px 12px;
  border-radius: 10px;
  border: 2px solid #8b5a2b;
  font-size: 1em;
  line-height: 1.4;
  z-index: 10;
  max-height: 30vh;
  overflow-y: auto;
  flex-shrink: 0;
}
#football-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  padding: 15px 20px;
  max-height: 60vh;
  overflow-y: auto;
  flex-grow: 1;
}
.team-slot {
  background: rgba(255,255,255,0.08);
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  color: white;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.3s;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.team-slot.claimed {
  background: rgba(139,90,43,0.7);
  cursor: default;
}
.username {
  font-size: 0.8em;
  margin-top: 4px;
  color: #e0c9a6;
}
.winner-box {
  position: absolute;
  background: #000;
  border: 1px solid #8b5a2b;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 0.8em;
  color: #ffd700;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 20;
  max-width: 120px;
}
#last-winner-box { top: 5px; right: 5px; }

/* Grumpy's Six */
#game-grumpys-six {
  background: #2b1b12;
  color: #e0c9a6;
  padding-top: 8px;
  overflow-y: auto;
  align-items: center;
}
#grumpys-six-rules {
  margin: 70px auto 12px;
  padding: 10px;
  background: rgba(0,0,0,0.65);
  border: 2px solid #8b5a2b;
  border-radius: 10px;
  font-size: 1em;
  line-height: 1.4;
  z-index: 10;
  flex-shrink: 0;
  display: block !important;
  font-size: 1.05rem !important;
  width: min(920px, calc(100% - 24px));
  box-sizing: border-box;
}
#grumpys-six-fixtures {
  margin: 15px auto;
  padding: 10px;
  background: rgba(0,0,0,0.5);
  border-radius: 10px;
  max-height: 60vh;
  overflow-y: auto;
  width: min(920px, calc(100% - 24px));
  box-sizing: border-box;
  display: block;
}
.fixture-bubble h3,
#grumpys-six-fixtures h3 {
  text-align: center;
  color: #ffd700;
  margin: 4px 0 12px;
}
#grumpys-six-form {
  display: grid;
  gap: 12px;
}
.fixture-bubble .teams { font-size: 1.02rem; margin-bottom: 4px; }
.fixture-bubble .time { color: #d4b88a; font-size: 0.95rem; }
.fixture-bubble {
  background: rgba(255,255,255,0.08);
  border: 2px solid #8b5a2b;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  color: #e0c9a6;
}
.fixture-bubble .crest-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.fixture-bubble .team-badge {
  width: 40px;
  height: 40px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  background-color: #8b5a2b;
  flex-shrink: 0;
}
.fixture-bubble .score-input {
  width: 50px;
  padding: 8px;
  text-align: center;
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  background: #2b1b12;
  color: #e0c9a6;
  font-size: 1.2em;
  font-weight: bold;
}
.fixture-bubble .dash {
  font-size: 1.5em;
  color: #8b5a2b;
  font-weight: bold;
}
.fixture-bubble .info-row {
  text-align: center;
  font-size: 0.9em;
  border-top: 1px solid #8b5a2b;
  padding-top: 8px;
}
#grumpys-six-submit,
#super6-submit {
  display: block !important;
  width: min(920px, calc(100% - 24px));
  margin: 20px auto !important;
  padding: 12px;
  background: #8b5a2b !important;
  color: white !important;
  border: 2px solid #5c3a1f !important;
  border-radius: 8px;
  cursor: pointer !important;
  font-size: 1.1em !important;
  font-family: 'Courier New', monospace;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  box-shadow: 0 2px 0 #3f2815;
}

/* Bingo */
#game-bingo {
  background: #000;
  color: #e0c9a6;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  align-items: center;
  /* Clear fixed "Back to Bar" (~52px) + spacing; safe-area for Telegram title / notches */
  padding-top: calc(env(safe-area-inset-top, 0px) + 76px);
  padding-bottom: 20px;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
}
#bingo-schedule-countdown {
  width: min(920px, calc(100% - 24px));
  margin: 8px auto 8px;
  text-align: center;
  color: #ffd700;
  background: rgba(0,0,0,0.45);
  border: 1px solid #8b5a2b;
  border-radius: 8px;
  padding: 6px 10px;
  box-sizing: border-box;
}
#bingo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px auto 10px;
  width: min(920px, calc(100% - 24px));
  box-sizing: border-box;
  font-size: 1.5em;
}
#bingo-title { font-size: 1.45rem; color: #ffd700; }
#bingo-ball {
  width: 60px;
  height: 60px;
  background: #8b5a2b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8em;
  font-weight: bold;
  border: 3px solid #5c3a1f;
  box-shadow: 0 4px 0 #5c3a1f;
}
#bingo-status {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto 8px;
  padding: 8px 10px;
  text-align: center;
  background: rgba(0,0,0,0.35);
  border: 1px solid #8b5a2b;
  border-radius: 8px;
  box-sizing: border-box;
}
#bingo-rules.pub-game-rules--compact,
#quiz-rules.pub-game-rules--compact {
  flex-shrink: 0;
  z-index: 12;
  margin-top: 0;
  margin-bottom: 10px;
}
.bingo-rules-bubble {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto 10px;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.35;
  color: #e0c9a6;
  text-align: left;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid #8b5a2b;
  border-radius: 10px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.bingo-rules-bubble[hidden] {
  display: none !important;
}
#bingo-idle-purchase {
  width: min(920px, calc(100% - 24px));
  margin: 8px auto 10px;
  text-align: center;
}
#bingo-purchase-line {
  margin: 0 0 8px;
}
#bingo-card-count,
#bingo-buy-cards-btn,
#bingo-claim,
#bingo-buy-pint {
  background: #5c3a1f !important;
  color: #e0c9a6 !important;
  border: 2px solid #8b5a2b !important;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Courier New', monospace !important;
  font-size: 1rem !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  color-scheme: dark;
  min-height: 40px;
  box-sizing: border-box;
}
#bingo-buy-cards-btn,
#bingo-claim,
#bingo-buy-pint {
  cursor: pointer;
}
#bingo-card-count { margin-right: 8px; }

.bingo-dauber-picker {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #8b5a2b;
  border-radius: 8px;
  box-sizing: border-box;
}
.bingo-dauber-label {
  font-size: 0.95rem;
  color: #e0c9a6;
  margin-right: 4px;
}
.dauber-swatch {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  border: 3px solid #5c3a1f;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 0 #3f2815;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}
.dauber-swatch.active {
  outline: 2px solid #ffd700;
  outline-offset: 3px;
  border-color: #ffd700;
}

#bingo-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  width: min(920px, calc(100% - 24px));
  padding: 12px;
  margin: 0 auto;
  background: rgba(0,0,0,0.45);
  border-radius: 15px;
  border: 2px solid #8b5a2b;
  box-sizing: border-box;
}
#bingo-card .bingo-card-grid {
  display: inline-block;
  padding: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid #8b5a2b;
  border-radius: 10px;
}
#bingo-card .bingo-row {
  display: flex;
}
#bingo-card .bingo-cell {
  width: 44px;
  height: 44px;
  background: #5c3a1f;
  border: 1px solid #8b5a2b;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  color: #e0c9a6;
  transition: background 0.2s;
  margin: 2px;
}
#bingo-card .bingo-cell.called-number {
  color: #fffef5;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(255, 235, 150, 0.55), 0 1px 2px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 213, 128, 0.65);
  background: #6d4528;
}
#bingo-card .bingo-cell.daubed,
#bingo-card .bingo-cell.marked {
  background: var(--dauber-color, #4caf50);
  color: #fff;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 0, 0, 0.4);
}
#bingo-card .bingo-cell.free {
  background: var(--dauber-color, #4caf50);
  color: #fff;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 0, 0, 0.4);
  cursor: default;
}
#bingo-controls {
  width: min(920px, calc(100% - 24px));
  margin: 12px auto 14px;
  text-align: center;
}
#bingo-drawn {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  padding: 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  box-sizing: border-box;
}
.drawn-number {
  width: 40px;
  height: 40px;
  background: #8b5a2b;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 5px;
  color: white;
  font-weight: bold;
  border: 2px solid #5c3a1f;
}

/* Quiz */
#game-quiz {
  background: #000;
  color: #e0c9a6;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  align-items: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 76px);
  padding-bottom: 24px;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
}
#quiz-schedule-countdown {
  width: min(920px, calc(100% - 24px));
  margin: 8px auto 8px;
  text-align: center;
  color: #ffd700;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #8b5a2b;
  border-radius: 8px;
  padding: 6px 10px;
  box-sizing: border-box;
}
#quiz-live-meta {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto 8px;
  padding: 8px 10px;
  text-align: center;
  font-size: 0.82em;
  color: #e0c9a6;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #8b5a2b;
  border-radius: 8px;
  box-sizing: border-box;
  line-height: 1.35;
  word-break: break-word;
}
#quiz-idle-entry {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto 12px;
  padding: 0 8px;
  text-align: center;
  box-sizing: border-box;
}
.session-picker {
  margin: 0 auto 12px;
  text-align: center;
}
.session-picker-label {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #c9b08a;
}
.session-picker-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.session-slot-btn {
  background: #3d2814;
  color: #e0c9a6;
  border: 2px solid #6b4423;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
}
.session-slot-btn.active {
  border-color: #c9a227;
  background: #4a3018;
  box-shadow: 0 0 0 1px #c9a227;
}
.session-slot-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#quiz-entry-line {
  margin: 0 0 10px;
  color: #e0c9a6;
  line-height: 1.45;
}
#quiz-enter-btn,
#quiz-buy-pint {
  background: #5c3a1f !important;
  color: #e0c9a6 !important;
  border: 2px solid #8b5a2b !important;
  border-radius: 8px;
  padding: 12px 18px;
  font-family: 'Courier New', monospace !important;
  font-size: 1rem !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  color-scheme: dark;
  cursor: pointer;
  min-height: 44px;
  box-sizing: border-box;
  box-shadow: 0 2px 0 #3f2815;
}
#quiz-enter-btn:disabled {
  opacity: 0.65;
  cursor: default;
}
#quiz-buy-pint {
  display: block;
  width: min(920px, calc(100% - 24px));
  margin: 16px auto 8px;
  text-align: center;
}
#quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: min(920px, calc(100% - 24px));
  margin: 12px auto 10px;
  padding: 0 4px;
  font-size: 1.05em;
  color: #e0c9a6;
  box-sizing: border-box;
}
#quiz-question {
  width: min(920px, calc(100% - 24px));
  margin: 12px auto;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #8b5a2b;
  border-radius: 10px;
  font-size: 1.1em;
  line-height: 1.4;
  color: #e0c9a6;
  box-sizing: border-box;
}
#quiz-options {
  width: min(920px, calc(100% - 24px));
  margin: 10px auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}
.quiz-option {
  padding: 12px 15px;
  background: #5c3a1f;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  font-size: 1em;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Courier New', monospace;
}
.quiz-option:hover {
  background: #8b5a2b;
}
#quiz-feedback {
  width: min(920px, calc(100% - 24px));
  margin: 10px auto;
  text-align: center;
  font-size: 1.1em;
  color: #4caf50;
  min-height: 30px;
  box-sizing: border-box;
}
#quiz-final-panel {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto 12px;
  padding: 0 8px;
  box-sizing: border-box;
}
#quiz-final-summary,
#quiz-final-board {
  color: #e0c9a6;
  line-height: 1.45;
}

/* Leaderboards */
#game-leaderboards {
  background: #2b1b12;
  color: #e0c9a6;
}
#leaderboards-header {
  text-align: center;
  margin: 70px 20px 10px;
  font-size: 1.2em;
  color: #ffd700;
  text-shadow: 2px 2px 0 #5c3a1f;
}
#leaderboards-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 10px 20px;
}
.leaderboard-tab {
  padding: 8px 16px;
  background: #5c3a1f;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.2s;
}
.leaderboard-tab.active {
  background: #8b5a2b;
  color: white;
  border-color: #ffd700;
}
#leaderboards-content {
  margin: 0 20px 20px;
  padding: 15px;
  background: rgba(0,0,0,0.5);
  border: 2px solid #8b5a2b;
  border-radius: 10px;
  max-height: 60vh;
  overflow-y: auto;
}
.leaderboard-entry {
  display: flex;
  align-items: center;
  padding: 8px;
  margin: 5px 0;
  background: rgba(255,255,255,0.05);
  border-radius: 5px;
  font-size: 1em;
}
.leaderboard-rank {
  width: 40px;
  font-weight: bold;
  color: #ffd700;
}
.leaderboard-name {
  flex: 1;
  margin-left: 10px;
}
.leaderboard-points {
  font-weight: bold;
  color: #ffd700;
}

/* Pub inside: hamburger menu (network + balances) — fixed top-left, never clipped by inside scroll */
.pub-inside-header {
  position: fixed;
  top: calc(var(--tg-safe-top, env(safe-area-inset-top, 0px)) + 8px);
  left: max(10px, var(--tg-safe-left, env(safe-area-inset-left, 0px)));
  z-index: 50020;
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  pointer-events: none;
}

body.pub-inside-active .pub-inside-header {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.pub-inside-header[hidden] {
  display: none !important;
}

.pub-inside-header > * {
  pointer-events: auto;
}

.pub-demo-replay-btn {
  appearance: none;
  border: 1px solid rgba(201, 162, 39, 0.65);
  background: rgba(28, 18, 10, 0.88);
  color: #f5e6c8;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  font-weight: bold;
  padding: 8px 14px;
  height: 44px;
  box-sizing: border-box;
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.pub-demo-replay-btn[hidden] {
  display: none;
}

.pub-demo-replay-btn:not([hidden]):hover {
  background: rgba(139, 90, 43, 0.95);
}

#pub-demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 28000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.88);
  pointer-events: auto;
}

#pub-demo-overlay[hidden],
#pub-demo-overlay.pub-demo-overlay--hidden {
  display: none !important;
}

.pub-demo-panel {
  width: min(100%, 480px);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  background: #2b1b12;
  border: 3px solid #c9a227;
  border-radius: 14px;
  padding: 18px 16px 14px;
  color: #e0c9a6;
  font-family: 'Courier New', monospace;
  line-height: 1.45;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
}

.pub-demo-panel h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: #ffd700;
  padding-right: 72px;
}

.pub-demo-skip {
  float: right;
  margin: 0 0 8px 8px;
  padding: 6px 10px;
  border: 1px solid #8b5a2b;
  border-radius: 8px;
  background: transparent;
  color: #b89f7c;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.pub-demo-step-kicker {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: #c9a227;
}

.pub-demo-intro-text {
  margin: 0 0 12px;
}

.pub-demo-voice-btn,
.pub-demo-peek-btn {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  border: 2px solid #8b5a2b;
  border-radius: 10px;
  background: #5c3a1f;
  color: #fff;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

.pub-demo-game-list {
  margin: 0;
  padding-left: 1.1rem;
}

.pub-demo-game-list li {
  margin-bottom: 8px;
}

.pub-demo-quiz-q {
  font-weight: bold;
  margin: 0 0 10px;
}

.pub-demo-quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pub-demo-quiz-opt {
  text-align: left;
  padding: 10px 12px;
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  background: #1a120c;
  color: #e0c9a6;
  font-family: inherit;
  cursor: pointer;
}

.pub-demo-quiz-opt.correct {
  border-color: #3d8b3d;
  background: #1a2e1a;
}

.pub-demo-quiz-opt.wrong {
  border-color: #8b3a3a;
  opacity: 0.85;
}

.pub-demo-quiz-hint {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: #c9b08a;
}

.pub-demo-quiz-next-q {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed #c9a227;
  border-radius: 8px;
  background: transparent;
  color: #f5e6c8;
  font-family: inherit;
  cursor: pointer;
}

.pub-demo-bingo-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
}

.pub-demo-bingo-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.pub-demo-bingo-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #5c4030;
  border-radius: 6px;
  background: #1a120c;
  font-size: 0.85rem;
  min-height: 36px;
}

.pub-demo-bingo-cell.called {
  border-color: #c9a227;
  cursor: pointer;
}

.pub-demo-bingo-cell.daubed {
  background: #3d5c2a;
  color: #fff;
}

.pub-demo-bingo-cell.free {
  background: #5c3a1f;
  font-weight: bold;
  font-size: 0.7rem;
}

.pub-demo-bingo-called {
  font-size: 0.85rem;
  color: #c9b08a;
}

.pub-demo-peek-note {
  font-size: 0.88rem;
  color: #c9b08a;
}

.pub-demo-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 10px;
}

.pub-demo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5c4030;
}

.pub-demo-dot.active {
  background: #ffd700;
}

.pub-demo-nav {
  display: flex;
  gap: 10px;
}

.pub-demo-nav button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid #8b5a2b;
  background: #5c3a1f;
  color: #fff;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

.pub-demo-nav #pub-demo-next {
  border-color: #c9a227;
  background: #8b5a2b;
}

#pub-demo-peek-bar {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 27000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.92);
  border: 2px solid #c9a227;
  border-radius: 10px;
  color: #f5e6c8;
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
}

#pub-demo-peek-bar[hidden] {
  display: none !important;
}

#pub-demo-peek-bar button {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: #8b5a2b;
  color: #fff;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

body.pub-demo-tour-active .pub-demo-replay-btn {
  opacity: 0.4;
  pointer-events: none;
}

.pub-menu-btn {
  appearance: none;
  border: 1px solid rgba(255, 215, 120, 0.45);
  background: rgba(28, 18, 10, 0.82);
  color: #ffe8c4;
  font-size: 1.35rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: rgba(255, 210, 120, 0.25);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.pub-menu-btn:focus-visible {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

.pub-menu-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: min(280px, calc(100vw - 32px));
  padding: 8px 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 210, 120, 0.35);
  background: rgba(22, 14, 8, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.pub-menu-dropdown.hidden {
  display: none !important;
}

.pub-menu-wallet-status {
  padding: 10px 16px 8px;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #c9b08a;
  border-bottom: 1px solid rgba(255, 210, 120, 0.18);
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pub-menu-wallet-status.connected {
  color: #86efac;
}

.pub-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #f5ead0;
  font-size: 0.95rem;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 210, 120, 0.2);
}

.pub-menu-item:hover,
.pub-menu-item:focus-visible {
  background: rgba(255, 210, 120, 0.12);
}

.pub-menu-item--active {
  color: #ffd76a;
  font-weight: 600;
}

.pub-menu-item--danger {
  color: #f0a8a8;
}

.pub-menu-sep {
  height: 1px;
  margin: 6px 12px;
  background: rgba(255, 210, 120, 0.22);
}

/* Legacy strip removed from DOM; wallet screen still uses #wallet-screen styles below */

/* Pub top: balance strip (tap opens full wallet) — Shido / custodial rail only */
.pub-wallet-strip {
  position: relative;
  top: auto;
  left: auto;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: max-content;
  max-width: min(360px, calc(100vw - 24px));
  box-sizing: border-box;
  margin: calc(env(safe-area-inset-top, 0px) + 6px) max(10px, env(safe-area-inset-left, 0px)) 8px
    max(10px, env(safe-area-inset-left, 0px));
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 210, 120, 0.25);
  flex-shrink: 0;
}

.pub-wallet-strip:focus-visible {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
  border-radius: 10px;
}

.pub-wallet-strip-hint {
  font-size: 0.82rem;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: #f5ead0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  padding: 0 4px 0 6px;
  opacity: 0.95;
  user-select: none;
  white-space: nowrap;
}

/* Wallet widget (pill inside strip) */
#wallet-widget {
  position: relative;
  top: auto;
  left: auto;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid #8b5a2b;
  font-size: 0.74rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

#wallet-widget-text {
  display: inline;
  white-space: nowrap;
}

/* Full-screen wallet: JS sets display:flex — must be column (row was breaking layout). */
#wallet-screen {
  position: fixed;
  inset: 0;
  background: #2b1b12;
  color: #e0c9a6;
  z-index: 100;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) max(14px, env(safe-area-inset-right, 0px))
    max(20px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-family: 'Courier New', monospace;
}

#wallet-screen > * {
  width: min(920px, 100%);
  max-width: 100%;
  box-sizing: border-box;
}

/* Reference layout: back | centred title | edit */
.wallet-header-ref {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #8b5a2b;
  width: 100%;
}

.wallet-back-ref,
#wallet-back-btn.wallet-back-ref {
  background: #5c3a1f;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 10px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}

.wallet-title-ref,
#wallet-screen-title.wallet-title-ref {
  margin: 0;
  font-size: 1.12rem;
  font-weight: bold;
  color: #ffd700;
  text-align: center;
  line-height: 1.25;
  justify-self: center;
  max-width: 100%;
  padding: 0 4px;
}

.wallet-header-ref-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 42px;
}

.wallet-icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #5c3a1f !important;
  border: 2px solid #8b5a2b !important;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: none !important;
}

#wallet-screen .wallet-panel {
  border: 1px solid #8b5a2b;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: rgba(20, 12, 8, 0.72);
  box-sizing: border-box;
}

.wallet-field-label {
  display: block;
  margin-bottom: 8px;
  color: #ffd700;
  font-size: 0.82rem;
}

.wallet-viewing-panel select#wallet-context-select {
  width: 100%;
}

.wallet-viewing-hint {
  margin: 12px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #e8d4a8;
}

.wallet-viewing-hint strong {
  color: #ffd700;
}

.wallet-address-box {
  margin-top: 14px;
  padding: 12px 14px;
  border: 2px dashed #8b5a2b;
  border-radius: 12px;
  text-align: center;
  font-size: 0.88rem;
  color: #f5ead2;
  word-break: break-all;
  line-height: 1.35;
}

.wallet-copy-address-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: transparent !important;
  border: none !important;
  color: #e0c9a6 !important;
  font-family: inherit !important;
  font-size: 0.88rem !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  box-shadow: none !important;
}

.wallet-balance-card .wallet-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(139, 90, 43, 0.45);
}

.wallet-balance-card .wallet-balance-row:last-child {
  border-bottom: none;
}

.wallet-balance-label {
  color: #ffd700;
  font-weight: bold;
  font-size: 1rem;
}

.wallet-balance-value {
  color: #f0e6d4;
  font-size: 0.98rem;
  text-align: right;
  word-break: break-all;
}

.wallet-security-title {
  font-weight: bold;
  color: #ffd700;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.wallet-security-list {
  margin: 0;
  padding-left: 1.15rem;
  color: #e8d4a8;
  font-size: 0.84rem;
  line-height: 1.5;
}

.wallet-external-intro {
  margin: 0 0 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #e8d4a8;
}

.wallet-secondary-btn {
  background: #5c3a1f !important;
  color: #e0c9a6 !important;
  border: 2px solid #8b5a2b !important;
  border-radius: 10px;
  padding: 8px 14px !important;
  cursor: pointer;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  color-scheme: dark;
  box-shadow: none;
}

.wallet-primary-btn {
  background: #8b5a2b !important;
  color: #fff !important;
  border: 2px solid #5c3a1f !important;
  border-radius: 10px;
  padding: 12px 20px !important;
  cursor: pointer;
  font-family: inherit !important;
  font-size: 1rem !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: none;
  width: 100%;
  max-width: 100%;
}

.wallet-row-btn {
  flex: 0 0 auto;
  background: #5c3a1f !important;
  color: #e0c9a6 !important;
  border: 2px solid #8b5a2b !important;
  border-radius: 10px;
  padding: 10px 16px !important;
  cursor: pointer;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  white-space: nowrap;
}

#wallet-external-sweep select,
#wallet-send-panel > select {
  width: 100%;
  max-width: 100%;
}

.wallet-action-bubble {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wallet-action-title {
  margin: 0 0 2px;
  font-size: 1.02rem;
  color: #ffd700;
  font-weight: bold;
}

.wallet-paste-hint {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: #c9a86a;
}

.wallet-paste-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  margin: 0 1px;
  font-family: inherit;
  font-size: 0.72rem;
  color: #e0c9a6;
  background: #3d2818;
  border: 1px solid #8b5a2b;
  border-radius: 4px;
}

#wallet-send-panel,
#wallet-swap-panel,
#wallet-external-sweep {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.wallet-inline-row .wallet-input {
  flex: 1 1 140px;
  min-width: 0;
}

.wallet-swap-pair-row select {
  flex: 1 1 120px;
  min-width: 0;
}

#wallet-screen input.wallet-input,
#wallet-screen input:not([type="checkbox"]),
#wallet-screen select,
#wallet-screen textarea {
  background: #2a1a10 !important;
  color: #f0e6d4 !important;
  border: 2px solid #8b5a2b !important;
  border-radius: 10px;
  padding: 10px 12px !important;
  font-family: 'Courier New', monospace !important;
  font-size: 0.95rem !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  color-scheme: dark;
  box-sizing: border-box;
}

#wallet-screen input.wallet-input--focused,
#wallet-screen input:focus {
  outline: none;
  border-color: #c4a574 !important;
  box-shadow: 0 0 0 1px rgba(139, 90, 43, 0.45);
}

#wallet-swap-estimate {
  font-size: 0.88rem;
  color: #c9b896;
  min-height: 1.2em;
}

#wallet-swap-estimate .wallet-swap-gas-est {
  display: inline-block;
  margin-top: 6px;
  color: #a89878;
  font-size: 0.92em;
}

#wallet-transactions.wallet-tx-panel {
  margin-bottom: 12px;
}

.wallet-section-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: #ffd700;
}

#wallet-refresh-tx-btn {
  margin-bottom: 12px;
}

.wallet-tx-empty {
  color: #c9b896;
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 8px 0;
}

.wallet-tx-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #8b5a2b;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.wallet-tx-item-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.wallet-tx-badge {
  font-weight: bold;
  text-transform: capitalize;
}

.wallet-tx-badge.receive {
  color: #81c784;
}

.wallet-tx-badge.send {
  color: #e0c9a6;
}

.wallet-tx-meta {
  color: #c9b896;
  font-size: 0.88rem;
  line-height: 1.4;
}

a.wallet-tx-hash-link {
  color: #ffd48a !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
  font-size: 0.88rem;
}

a.wallet-tx-hash-link:visited {
  color: #e8c97a !important;
}

#wallet-external-list {
  margin: 12px 0;
}

.wallet-external-empty,
.wallet-external-summary {
  color: #c9b896;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 8px 0;
}

.wallet-external-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #8b5a2b;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.wallet-external-card-title {
  font-weight: bold;
  color: #ffd700;
  margin-bottom: 6px;
}

.wallet-external-card-addr {
  font-size: 0.82rem;
  word-break: break-all;
  color: #e0c9a6;
  margin-bottom: 10px;
}

.wallet-external-delete-btn {
  background: #5c3a1f !important;
  color: #e0c9a6 !important;
  border: 2px solid #8b5a2b !important;
  border-radius: 10px;
  padding: 8px 12px !important;
  cursor: pointer;
  font-family: inherit !important;
  font-size: 0.88rem !important;
}

#wallet-external-import {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #8b5a2b;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#wallet-external-import label {
  color: #e0c9a6;
  font-size: 0.9rem;
}

#wallet-external-import-btn {
  background: #8b5a2b !important;
  color: #fff !important;
  border: 2px solid #5c3a1f !important;
  border-radius: 10px;
  padding: 10px !important;
  cursor: pointer;
  font-family: inherit !important;
}

#wallet-external-import-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Send confirmation modal */
#wallet-send-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

#wallet-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

#wallet-send-modal > div:last-child {
  position: relative;
  z-index: 1;
  background: #2b1b12;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 12px;
  padding: 20px;
  max-width: min(420px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
}

#wallet-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  color: #e0c9a6;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

#wallet-modal-summary {
  margin: 24px 0 12px;
  line-height: 1.45;
  font-size: 0.95rem;
}

#wallet-modal-tx-link,
#wallet-modal-fee-link {
  display: block;
  margin-top: 10px;
  color: #ffd48a !important;
  word-break: break-all;
  font-size: 0.9rem;
}

#wallet-transactions ul {
  list-style: none;
  padding: 0;
}

#wallet-transactions li {
  background: rgba(0, 0, 0, 0.3);
  margin: 5px 0;
  padding: 8px;
  border-radius: 5px;
  font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
  #football-grid { grid-template-columns: repeat(4, 1fr); }
  .team-slot { font-size: 0.85em; min-height: 70px; }
}
@media (max-width: 480px) {
  #football-grid { grid-template-columns: repeat(2, 1fr); }
  .team-slot { font-size: 0.8em; min-height: 80px; }
}

/* TON pay — fallback sheet when Telegram showPopup is unavailable */
.ton-pay-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}
.ton-pay-sheet-panel {
  width: min(420px, 100%);
  max-height: min(78vh, 520px);
  overflow: auto;
  background: linear-gradient(180deg, #2a1810 0%, #120c08 100%);
  border: 2px solid #8b5a2b;
  border-radius: 16px 16px 12px 12px;
  padding: 16px 16px 14px;
  color: #e8d4b0;
  font-family: "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.55);
}
.ton-pay-sheet-panel h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: #f0dcc4;
}
.ton-pay-sheet-panel .ton-pay-sheet-note {
  font-size: 0.82rem;
  color: #c4a882;
  margin: 0 0 12px;
}
.ton-pay-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: stretch;
}
.ton-pay-sheet-actions button {
  flex: 1;
  font-family: inherit;
  font-weight: 700;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid #5c3a1f;
  font-size: 0.88rem;
}
.ton-pay-sheet-actions .ton-pay-sheet-cancel {
  background: transparent;
  color: #d4b88a;
}
.ton-pay-sheet-actions .ton-pay-sheet-confirm {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  color: #fff;
  border-color: #047857;
}

/* Pub Predictions */
#game-pub-predictions {
  padding: calc(env(safe-area-inset-top, 0px) + 70px) 14px max(20px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: #e0c9a6;
  font-family: 'Courier New', Courier, monospace;
}
#pp-shell {
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
#pp-rules {
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid #8b5a2b;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  line-height: 1.45;
  font-size: 0.92rem;
}
#pp-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pp-tab {
  flex: 1;
  min-width: 90px;
  padding: 10px 8px;
  background: #3d2817;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}
.pp-tab.active {
  background: #8b5a2b;
  color: #fff;
}
.pp-panel.hidden {
  display: none;
}
.pp-label {
  display: block;
  margin: 10px 0 4px;
  font-size: 0.82rem;
  color: #c9a87a;
}
#pp-question,
#pp-notes,
#pp-yes-hint,
#pp-no-hint {
  width: 100%;
  box-sizing: border-box;
  background: #1a120c;
  color: #f5e6d3;
  border: 2px solid #5c3a1f;
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 0.9rem;
}
.pp-hint {
  font-size: 0.78rem;
  color: #a89070;
  margin: 8px 0;
  line-height: 1.35;
}
.pp-primary-btn {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  background: #2d6a4f;
  color: #fff;
  border: 2px solid #1b4332;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
}
.pp-list-block {
  margin-top: 14px;
}
.pp-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #6b4423;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}
.pp-card h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  line-height: 1.35;
}
.pp-card-meta {
  font-size: 0.75rem;
  color: #a89070;
  margin-bottom: 8px;
}
.pp-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pp-card-actions button {
  flex: 1;
  min-width: 100px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 2px solid #5c3a1f;
  cursor: pointer;
  font-size: 0.82rem;
}
.pp-btn-approve {
  background: #2d6a4f;
  color: #fff;
}
.pp-btn-reject {
  background: #5c1a1a;
  color: #ffe8e8;
}
#pp-status {
  margin-top: 12px;
  font-size: 0.85rem;
  min-height: 1.2em;
}
#pp-status.pp-ok {
  color: #8fd4a8;
}
#pp-status.pp-err {
  color: #f0a0a0;
}

/* George's 180 — darts */
#game-darts {
  background: linear-gradient(180deg, #1f140d 0%, #2b1b12 45%, #1a1008 100%);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  align-items: stretch;
  height: 100%;
  max-height: 100dvh;
}
#darts-rules {
  flex-shrink: 0;
  width: min(920px, calc(100% - 24px));
  margin: calc(env(safe-area-inset-top, 0px) + 56px) auto 12px;
  box-sizing: border-box;
}
#game-darts .darts-screen-inner {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: auto;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 28px);
  box-sizing: border-box;
}
#game-darts .darts-layout {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  gap: 10px;
  align-items: start;
  min-height: auto;
}
#game-darts .darts-play-column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: auto;
  min-width: 0;
  width: 100%;
  height: auto;
  padding: 0 4px;
  box-sizing: border-box;
  gap: 12px;
}
#game-darts .darts-board-stack {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: auto;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
#game-darts .darts-board-wrap {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(100%, 75vmin, 484px);
  padding: 0;
  background: transparent;
}
/* Chalk scoreboard — readable, left side */
#game-darts .darts-score-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: auto;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  height: auto;
}
#game-darts .darts-score-frame {
  flex: 0 0 auto;
  min-height: auto;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(145deg, #6b4a2a 0%, #3d2814 40%, #2a1a0c 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 220, 160, 0.12),
    0 6px 18px rgba(0, 0, 0, 0.55);
  border: 3px solid #4a3218;
}
#game-darts .darts-score-surface {
  flex: 0 0 auto;
  min-height: auto;
  display: flex;
  flex-direction: column;
  padding: 10px 8px 8px;
  border-radius: 8px;
  background:
    radial-gradient(ellipse 120% 80% at 30% 20%, rgba(90, 62, 36, 0.5) 0%, transparent 55%),
    radial-gradient(ellipse 100% 70% at 70% 80%, rgba(40, 28, 16, 0.6) 0%, transparent 50%),
    linear-gradient(165deg, #4a3420 0%, #2e2014 35%, #24180f 100%);
  border: 2px solid #1a1008;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
}
#game-darts .darts-score-banner {
  margin: 0 0 8px;
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(0.85rem, 3.4vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #e8c86a;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
#game-darts .darts-score-names {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: end;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(232, 200, 106, 0.35);
  margin-bottom: 8px;
}
#game-darts .darts-score-names--solo {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}
#game-darts .darts-score-name-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
#game-darts .darts-score-slot-label {
  font-family: Georgia, serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #c9a84a;
  opacity: 0.9;
}
#game-darts .darts-score-game {
  font-family: Georgia, serif;
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  font-weight: 700;
  color: #e8c86a;
  padding: 0 4px 2px;
  white-space: nowrap;
}
#game-darts .darts-chalk-text {
  color: #f6f6f0;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.5),
    1px 2px 3px rgba(0, 0, 0, 0.35);
}
#game-darts .darts-chalk-player {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(0.75rem, 3.2vw, 0.95rem);
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
#game-darts .darts-score-body {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  min-height: auto;
  padding: 4px 0;
}
#game-darts.darts-mode--vs .darts-score-body {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
#game-darts.darts-mode--vs .darts-score-throws--home {
  border-right: 1px solid rgba(232, 200, 106, 0.2);
}
#game-darts.darts-mode--vs .darts-score-throws--away {
  border-left: none;
}
#game-darts.darts-mode--vs .darts-throw-line--away {
  font-size: clamp(0.72rem, 2.8vw, 0.9rem);
}
#game-darts .darts-marks-layer .darts-landing-cross--george line,
#game-darts .darts-marks-layer .darts-landing-cross--george circle {
  stroke: #e8a040;
  fill: #e8a040;
}
#game-darts .darts-chalk-muted {
  font-size: 1.25rem;
  opacity: 0.35;
}
#game-darts .darts-score-throws {
  list-style: none;
  margin: 0;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 6px;
  border-left: 1px solid rgba(232, 200, 106, 0.2);
  border-right: 1px solid rgba(232, 200, 106, 0.2);
}
#game-darts .darts-throw-line {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(0.78rem, 3vw, 0.95rem);
  font-weight: 700;
  text-align: center;
  min-height: 1.15em;
  opacity: 0.25;
}
#game-darts .darts-throw-line.filled {
  opacity: 1;
}
#game-darts .darts-score-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 2px solid rgba(232, 200, 106, 0.35);
}
#game-darts .darts-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border: 2px solid rgba(232, 200, 106, 0.45);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}
#game-darts .darts-score-box-label {
  font-family: Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: #c9a84a;
}
#game-darts .darts-chalk-score {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(1rem, 4vw, 1.35rem);
  font-weight: 800;
  line-height: 1;
}
#game-darts .darts-roast-line {
  margin: 0;
  line-height: 1.35;
  font-size: 0.72rem;
  color: #d4b896;
  text-align: center;
  flex-shrink: 0;
}
#game-darts .darts-new-leg-btn {
  width: 100%;
  padding: 10px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  background: #5c3a1f;
  color: #e0c9a6;
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: auto;
  box-sizing: border-box;
}
#game-darts .darts-new-leg-btn:active {
  transform: translateY(1px);
}
#game-darts .darts-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  background: transparent;
}
#game-darts .darts-board-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  user-select: none;
  -webkit-user-drag: none;
}
#game-darts .darts-marks-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
#game-darts .darts-landing-cross line,
#game-darts .darts-landing-cross circle {
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
}
#game-darts .darts-crosshair {
  position: absolute;
  width: 5.5%;
  aspect-ratio: 1;
  z-index: 5;
  pointer-events: none;
  color: #f4f8fc;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 6px rgba(0, 0, 0, 0.65));
  transition: opacity 0.15s ease;
  user-select: none;
}
#game-darts .darts-crosshair svg {
  display: block;
  width: 100%;
  height: 100%;
}
#game-darts .darts-crosshair[hidden] {
  display: none !important;
}
#game-darts .darts-crosshair.darts-crosshair--george {
  color: #f0c060;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 8px rgba(232, 160, 64, 0.75));
}
#game-darts .darts-dart-sprite {
  position: absolute;
  width: 13%;
  height: auto;
  max-height: 42%;
  z-index: 4;
  pointer-events: none;
  transform-origin: 50% 92%;
  filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.5));
  transition: opacity 0.2s ease;
  user-select: none;
  -webkit-user-drag: none;
}
#game-darts .darts-dart-sprite[hidden] {
  display: none !important;
}
#game-darts .darts-throw-btn {
  flex-shrink: 0;
  margin-top: 0;
  width: 100%;
  max-width: min(100%, 75vmin, 484px);
  align-self: center;
  box-sizing: border-box;
  padding: 10px 8px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  font-family: 'Courier New', monospace;
  background: linear-gradient(180deg, #3d6ea8 0%, #2a5080 100%);
  color: #fff;
  border: 2px solid #5a8ec4;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
}
#game-darts .darts-throw-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
#game-darts .darts-throw-btn:not(:disabled):active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}


/* Rotate tip — in scroll flow, not blocking */
.darts-rotate-hint {
  flex-shrink: 0;
  width: min(920px, calc(100% - 24px));
  margin: calc(env(safe-area-inset-top, 0px) + 52px) auto 0;
  padding: 0 12px;
  box-sizing: border-box;
  z-index: 12;
}
.darts-rotate-hint[hidden] {
  display: none !important;
}
.darts-rotate-hint__card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #c9a227;
  background: linear-gradient(165deg, #3d2814 0%, #24180f 100%);
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.darts-rotate-hint__title {
  margin: 0 0 6px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e8c86a;
}
.darts-rotate-hint__sub {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #d4b896;
}

/* Desktop — unchanged layout (fill viewport, original sizes) */
@media (min-width: 901px) {
  #darts-rules {
    margin-top: calc(env(safe-area-inset-top, 0px) + 76px);
    margin-bottom: 14px;
  }
  #game-darts .darts-screen-inner {
    flex: 1;
    min-height: 0;
  }
  #game-darts .darts-layout {
    flex: 1;
    min-height: 0;
    align-items: stretch;
  }
  #game-darts .darts-play-column {
    height: 100%;
    min-height: 0;
  }
  #game-darts .darts-board-stack {
    flex: 1;
    min-height: 0;
    justify-content: center;
  }
  #game-darts .darts-score-column {
    height: 100%;
  }
  #game-darts .darts-score-frame {
    flex: 1;
    min-height: 0;
  }
  #game-darts .darts-score-surface {
    flex: 1;
    min-height: min(32vh, 240px);
  }
  #game-darts .darts-score-body {
    flex: 1;
    min-height: 0;
  }
  #game-darts .darts-throw-btn {
    margin-top: auto;
  }
}

/* Mobile / tablet — ~30% smaller, scoreboard beside board */
@media (max-width: 900px) {
  .darts-rotate-hint {
    margin-top: calc(env(safe-area-inset-top, 0px) + 72px);
    margin-left: max(12px, env(safe-area-inset-left, 0px));
    margin-right: max(12px, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: calc(100% - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px)));
    padding-left: 0;
    padding-right: 0;
  }
  #darts-rules {
    margin-top: calc(env(safe-area-inset-top, 0px) + 72px);
    margin-bottom: 3vh;
    margin-left: max(12px, env(safe-area-inset-left, 0px));
    margin-right: max(12px, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: calc(100% - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px)));
    font-size: 0.72rem;
    line-height: 1.35;
    padding: 6px 10px;
  }
  .darts-rotate-hint:not([hidden]) ~ #darts-rules {
    margin-top: 10px;
  }
  #game-darts .darts-screen-inner {
    width: 100%;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
  }
  #game-darts .darts-layout {
    --darts-board-size: 236px; /* +2% from 231px */
    --darts-score-min-h: calc(var(--darts-board-size) * 1.1); /* chalk +10% vs board */
    display: grid;
    grid-template-columns: minmax(100px, 34%) minmax(0, 66%);
    gap: 8px;
    align-items: stretch;
    width: min(96vw, 720px);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }
  #game-darts .darts-score-column,
  #game-darts .darts-play-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
  }
  #game-darts .darts-score-column {
    gap: 4px;
  }
  #game-darts .darts-play-column {
    padding: 0;
    gap: 0;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
  }
  /* Grow chalkboard down to just above New leg; top stays put */
  #game-darts .darts-score-frame {
    flex: 1 1 auto;
    min-height: var(--darts-score-min-h);
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    padding: 4px;
    border-width: 2px;
    border-radius: 8px;
  }
  #game-darts .darts-score-surface {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 4px 4px 3px;
  }
  #game-darts .darts-score-body {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
  }
  #game-darts .darts-score-throws {
    flex: 1 1 auto;
    justify-content: space-evenly;
    min-height: 0;
  }
  #game-darts .darts-score-banner {
    margin-bottom: 2px;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
  }
  #game-darts .darts-chalk-player {
    font-size: 0.58rem;
  }
  #game-darts .darts-score-body {
    padding: 2px 0;
  }
  #game-darts .darts-throw-line {
    font-size: 0.54rem;
    min-height: 0.95em;
    line-height: 1.15;
  }
  #game-darts .darts-score-throws {
    padding: 1px 3px;
    gap: 2px;
  }
  #game-darts .darts-score-bottom {
    gap: 4px;
    padding-top: 4px;
    margin-top: 0;
  }
  #game-darts .darts-score-box {
    padding: 3px 2px;
    gap: 2px;
  }
  #game-darts .darts-score-box-label {
    font-size: 0.5rem;
  }
  #game-darts .darts-chalk-score {
    font-size: 0.65rem;
  }
  #game-darts .darts-chalk-muted {
    font-size: 0.75rem;
  }
  /* Board centred in gap between rules toast (above) and START (below) */
  #game-darts .darts-board-stack {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
  }
  #game-darts .darts-board-wrap {
    flex: 0 0 auto;
    width: min(100%, var(--darts-board-size));
    max-width: var(--darts-board-size);
    margin: 0 auto;
    pointer-events: none;
  }
  #game-darts .darts-stage {
    width: 100%;
    max-width: var(--darts-board-size);
    margin: 0 auto;
    aspect-ratio: 1;
    height: auto;
    pointer-events: none;
  }
  #game-darts .darts-roast-line {
    flex: 0 0 auto;
    margin: 0 0 2px;
    font-size: 0.54rem;
    line-height: 1.25;
    padding: 0 2px;
    text-align: center;
    overflow: hidden;
    max-height: 2.6em;
  }
  #game-darts .darts-new-leg-btn,
  #game-darts .darts-throw-btn {
    flex-shrink: 0;
    min-height: 34px;
    padding: 8px 6px;
    font-size: 0.68rem;
    line-height: 1.2;
    box-sizing: border-box;
  }
  #game-darts .darts-new-leg-btn,
  #game-darts .darts-throw-btn {
    margin-top: auto;
    margin-bottom: 0;
    box-sizing: border-box;
  }
  #game-darts .darts-throw-btn {
    width: min(100%, var(--darts-board-size));
    max-width: var(--darts-board-size);
    margin-left: auto;
    margin-right: auto;
    align-self: center;
    position: relative;
    z-index: 12;
    pointer-events: auto;
    touch-action: manipulation;
    cursor: pointer;
  }
  #game-darts .darts-new-leg-btn {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
  }
  #game-darts .darts-crosshair {
    width: 6%;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  #darts-rules {
    max-width: calc(100% - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px)));
  }
  #game-darts .darts-layout {
    --darts-board-size: min(68dvh, 52vw, 286px);
  }
  /* Hint lives under the board on the right — hide duplicate under scoreboard */
  #game-darts .darts-roast-line {
    display: none;
  }
  #game-darts .darts-board-wrap,
  #game-darts .darts-stage {
    width: var(--darts-board-size) !important;
    max-width: var(--darts-board-size) !important;
  }
}

/* Smaller screens — shrink board only, score min follows via variables */
@media (max-width: 900px) and (max-height: 420px) {
  #game-darts .darts-layout {
    --darts-board-size: 209px; /* 205px +2% */
  }
}

@media (max-width: 380px) {
  #game-darts .darts-layout {
    --darts-board-size: 188px; /* 184px +2% */
  }
}

/* Darts — 180 celebration */
#game-darts .darts-celebration {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(8, 5, 2, 0.72);
  pointer-events: auto;
  animation: darts-celebration-fade-in 0.35s ease-out;
}
#game-darts .darts-celebration[hidden] {
  display: none !important;
}
#game-darts .darts-celebration__dismiss {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(232, 200, 106, 0.5);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #e8c86a;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
#game-darts .darts-celebration__card {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 28px 22px 24px;
  border-radius: 16px;
  border: 3px solid #e8c86a;
  background: linear-gradient(165deg, #4a3018 0%, #1a1008 55%, #2a1a0c 100%);
  box-shadow:
    0 0 40px rgba(232, 160, 64, 0.45),
    0 16px 48px rgba(0, 0, 0, 0.65);
  animation: darts-celebration-pop 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
  max-width: min(92vw, 340px);
}
#game-darts .darts-celebration__eyebrow {
  margin: 0 0 6px;
  font-family: Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: #c9a84a;
}
#game-darts .darts-celebration__score {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(4.5rem, 22vw, 6.5rem);
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 20px rgba(255, 220, 120, 0.9),
    0 0 48px rgba(232, 160, 64, 0.75),
    0 4px 0 #5c3a14;
  animation: darts-celebration-glow 1.2s ease-in-out infinite alternate;
}
#game-darts .darts-celebration__sub {
  margin: 12px 0 0;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #e0c9a6;
}
#game-darts .darts-celebration__sparks {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
#game-darts .darts-celebration__sparks span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8c86a;
  opacity: 0;
  animation: darts-celebration-spark 1.4s ease-out infinite;
}
#game-darts .darts-celebration__sparks span:nth-child(1) { left: 12%; top: 18%; animation-delay: 0s; background: #f0d060; }
#game-darts .darts-celebration__sparks span:nth-child(2) { left: 78%; top: 14%; animation-delay: 0.12s; background: #fff; }
#game-darts .darts-celebration__sparks span:nth-child(3) { left: 88%; top: 42%; animation-delay: 0.25s; }
#game-darts .darts-celebration__sparks span:nth-child(4) { left: 22%; top: 72%; animation-delay: 0.08s; background: #fff; }
#game-darts .darts-celebration__sparks span:nth-child(5) { left: 55%; top: 8%; animation-delay: 0.35s; }
#game-darts .darts-celebration__sparks span:nth-child(6) { left: 8%; top: 48%; animation-delay: 0.18s; }
#game-darts .darts-celebration__sparks span:nth-child(7) { left: 65%; top: 78%; animation-delay: 0.05s; background: #fff; }
#game-darts .darts-celebration__sparks span:nth-child(8) { left: 42%; top: 85%; animation-delay: 0.28s; }
#game-darts .darts-celebration__sparks span:nth-child(9) { left: 92%; top: 68%; animation-delay: 0.15s; }
#game-darts .darts-celebration__sparks span:nth-child(10) { left: 32%; top: 28%; animation-delay: 0.4s; background: #fff; }
#game-darts .darts-celebration__sparks span:nth-child(11) { left: 72%; top: 55%; animation-delay: 0.22s; }
#game-darts .darts-celebration__sparks span:nth-child(12) { left: 48%; top: 38%; animation-delay: 0.32s; }
@keyframes darts-celebration-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes darts-celebration-pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes darts-celebration-glow {
  from { filter: brightness(1); }
  to { filter: brightness(1.15); }
}
@keyframes darts-celebration-spark {
  0% { opacity: 0; transform: scale(0) translateY(0); }
  15% { opacity: 1; transform: scale(1.2) translateY(-8px); }
  100% { opacity: 0; transform: scale(0.4) translateY(-48px); }
}
@media (prefers-reduced-motion: reduce) {
  #game-darts .darts-celebration,
  #game-darts .darts-celebration__card,
  #game-darts .darts-celebration__score,
  #game-darts .darts-celebration__sparks span {
    animation: none;
  }
}

/* Darts — solo vs George mode picker */
.darts-mode-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: rgba(12, 8, 5, 0.9);
  pointer-events: auto;
}
.darts-mode-overlay[hidden] {
  display: none !important;
}
.darts-mode-panel {
  width: min(100%, 360px);
  padding: 18px 16px 14px;
  border-radius: 14px;
  border: 3px solid #c9a227;
  background: linear-gradient(165deg, #3d2814 0%, #24180f 100%);
  color: #e0c9a6;
  font-family: 'Courier New', monospace;
  text-align: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}
.darts-mode-title {
  margin: 0 0 8px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
  color: #e8c86a;
  letter-spacing: 0.06em;
}
.darts-mode-sub {
  margin: 0 0 16px;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #d4b896;
}
.darts-mode-btn {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
}
.darts-mode-btn--solo {
  background: linear-gradient(180deg, #5c3a1f 0%, #3d2814 100%);
  color: #fff;
  border: 2px solid #8b5a2b;
}
.darts-vs-format-label {
  margin: 14px 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #c9a84a;
}
.darts-vs-format {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.darts-format-btn {
  background: linear-gradient(180deg, #3d6ea8 0%, #2a5080 100%);
  color: #fff;
  border: 2px solid #5a8ec4;
  margin-bottom: 0;
}
.darts-mode-note {
  margin: 12px 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: #a89070;
}
#game-darts .darts-screen-inner.darts-play-blocked {
  opacity: 0.35;
  pointer-events: none;
  filter: blur(1px);
}
#game-darts .darts-score-names--versus .darts-chalk-player--away {
  color: #f0d090;
}

/* Language picker (first open / menu / always-visible chip) — above header chrome */
.pub-lang-overlay {
  position: fixed;
  inset: 0;
  z-index: 60000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 6, 4, 0.82);
  backdrop-filter: blur(4px);
}
.pub-lang-overlay.hidden {
  display: none;
}
.pub-lang-card {
  width: min(420px, 100%);
  padding: 1.5rem 1.25rem 1.35rem;
  border-radius: 14px;
  border: 2px solid #8b5a2b;
  background: linear-gradient(180deg, #2a1f14 0%, #1a1209 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  text-align: center;
}
.pub-lang-title {
  margin: 0 0 0.5rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.35rem;
  color: #e8d4b0;
}
.pub-lang-sub {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  color: #b8a080;
  line-height: 1.4;
}
.pub-lang-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.pub-lang-btn {
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 2px solid #8b5a2b;
  background: linear-gradient(180deg, #4a3520 0%, #2e2012 100%);
  color: #f0e0c8;
  cursor: pointer;
}
.pub-lang-btn:active {
  transform: scale(0.98);
}
.pub-lang-btn--active {
  border-color: #c9a227;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.45);
  background: linear-gradient(180deg, #5a4020 0%, #3a2814 100%);
}

/* ===== George's Brewery ===== */
#game-brewery {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(140, 90, 40, 0.35), transparent 55%),
    linear-gradient(180deg, #3a2416 0%, #2b1b12 45%, #1f140e 100%);
}
.brewery-shell {
  flex: 1 1 auto;
  width: min(640px, 100%);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) 16px 28px;
  box-sizing: border-box;
  color: #f0ddc2;
}
.brewery-header { text-align: center; margin-bottom: 14px; }
.brewery-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 5vw, 1.9rem);
  color: #f6e2c4;
  letter-spacing: 0.02em;
}
.brewery-sub {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: #c4a882;
  line-height: 1.35;
}
.brewery-budget {
  text-align: center;
  font-weight: 700;
  color: #ffe6b8;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #6b4424;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 0 12px;
}
.brewery-budget--over { color: #ffb4a8; border-color: #8a3a2a; }
.brewery-night-hint {
  margin: -4px 0 12px;
  text-align: center;
  font-size: 0.78rem;
  color: #b89a72;
  line-height: 1.35;
}
.brewery-live {
  margin-top: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #6b4424;
  border-radius: 12px;
  animation: brewery-fade-in 0.28s ease-out;
}
.brewery-live .brewery-section-label { margin-top: 0; }
.brewery-live-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.brewery-live-stat {
  text-align: center;
  background: rgba(40, 24, 14, 0.55);
  border-radius: 8px;
  padding: 6px 4px;
}
.brewery-live-stat span {
  display: block;
  font-size: 0.65rem;
  color: #b99a78;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.brewery-live-stat strong {
  display: block;
  margin-top: 2px;
  color: #ffe6b8;
  font-size: 0.95rem;
}
.brewery-george-aside {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #c48a3a;
  background: rgba(90, 50, 20, 0.35);
  border-radius: 0 8px 8px 0;
  color: #f6e2c4;
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.35;
  min-height: 2.6em;
  transition: opacity 0.2s ease;
}
.brewery-section-label {
  margin: 14px 0 8px;
  font-size: 0.95rem;
  color: #e8c9a0;
}
.brewery-styles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.brewery-chip {
  text-align: left;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #5c3a1f;
  border-radius: 10px;
  color: #f0ddc2;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.brewery-chip strong { display: block; margin-bottom: 4px; color: #ffe6b8; }
.brewery-chip span { display: block; font-size: 0.75rem; color: #b99a78; line-height: 1.3; }
.brewery-chip--on {
  border-color: #c48a3a;
  background: rgba(140, 80, 30, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 120, 0.25);
  transform: translateY(-1px);
}
.brewery-cat { margin-bottom: 12px; }
.brewery-cat-title {
  margin: 0 0 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d2b08a;
}
.brewery-ing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.brewery-ing {
  text-align: left;
  background: rgba(20, 12, 8, 0.55);
  border: 2px solid #4a301c;
  border-radius: 10px;
  color: #ecd7b8;
  padding: 8px 10px;
  cursor: pointer;
  min-height: 72px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.brewery-ing-name { display: block; font-weight: 700; font-size: 0.88rem; }
.brewery-ing-cost {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: #f0c27a;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 6px;
  border-radius: 999px;
}
.brewery-ing-blurb {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: #a89070;
  line-height: 1.25;
}
.brewery-ing--on {
  border-color: #b87333;
  background: rgba(110, 60, 22, 0.55);
}
.brewery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.brewery-actions--top { margin-top: 0; margin-bottom: 8px; }
.brewery-actions--result { margin-top: 18px; }
.brewery-primary,
.brewery-secondary {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1rem;
  cursor: pointer;
  border: 3px solid #5c3a1f;
}
.brewery-primary {
  background: #8b5a2b;
  color: #fff8ee;
  font-weight: 700;
}
.brewery-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.brewery-cta-again {
  min-width: min(100%, 220px);
  font-size: 1.08rem;
  padding: 14px 18px;
  border-color: #c48a3a;
  box-shadow: 0 4px 0 #5c3a1f;
  animation: brewery-cta-pulse 2.2s ease-in-out infinite;
}
.brewery-secondary {
  background: rgba(0, 0, 0, 0.35);
  color: #f0ddc2;
}
.brewery-brewing-card {
  margin-top: 40px;
  text-align: center;
  padding: 28px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #6b4424;
  border-radius: 14px;
}
.brewery-kettle {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50% 50% 42% 42%;
  background: radial-gradient(circle at 35% 30%, #d4a574, #6b3a18 60%, #3a1e0c);
  box-shadow: 0 0 18px rgba(200, 120, 40, 0.35);
  animation: brewery-bubble 1.1s ease-in-out infinite;
}
.brewery-kettle--taste {
  animation: brewery-taste 0.9s ease-in-out infinite;
  box-shadow: 0 0 22px rgba(255, 180, 80, 0.45);
}
@keyframes brewery-bubble {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.04); }
}
@keyframes brewery-taste {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(3deg) scale(1.06); }
}
@keyframes brewery-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes brewery-cta-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes brewery-score-flip {
  0% { transform: scale(0.7); opacity: 0.2; filter: blur(2px); }
  60% { transform: scale(1.12); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); }
}
.brewery-brewing-status {
  margin: 0;
  font-size: 1.05rem;
  color: #ffe6b8;
  min-height: 2.4em;
}
.brewery-brewing-beat {
  margin: 8px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4a882;
}
.brewery-result-card {
  padding: 14px 12px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.38);
  border: 2px solid #6b4424;
  animation: brewery-fade-in 0.35s ease-out;
}
.brewery-result-card--legend { border-color: #e0b44a; box-shadow: 0 0 18px rgba(224, 180, 74, 0.25); }
.brewery-result-card--great { border-color: #c48a3a; }
.brewery-result-card--ok { border-color: #8a6a44; }
.brewery-result-card--meh { border-color: #7a5a4a; }
.brewery-result-card--roast { border-color: #a04838; box-shadow: 0 0 14px rgba(160, 72, 56, 0.22); }
.brewery-score-block {
  text-align: center;
  margin: 8px 0 10px;
}
.brewery-score-label {
  display: block;
  font-size: 0.8rem;
  color: #c4a882;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.brewery-score {
  display: block;
  font-size: clamp(3.2rem, 12vw, 4.2rem);
  font-weight: 800;
  color: #ffd27a;
  line-height: 1.05;
  font-family: Georgia, "Times New Roman", serif;
}
.brewery-score--pending { opacity: 0.35; letter-spacing: 0.15em; }
.brewery-score--flip { animation: brewery-score-flip 0.45s ease-out; }
.brewery-score--legend { color: #ffe08a; text-shadow: 0 0 18px rgba(255, 210, 100, 0.35); }
.brewery-score--great { color: #ffd27a; }
.brewery-score--ok { color: #e8c9a0; }
.brewery-score--meh { color: #d2a890; }
.brewery-score--roast { color: #ff9a86; }
.brewery-score-band {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #c4a882;
  min-height: 1.2em;
}
.brewery-score-band--legend { color: #ffe08a; }
.brewery-score-band--great { color: #ffd27a; }
.brewery-score-band--ok { color: #e8c9a0; }
.brewery-score-band--meh { color: #d2a890; }
.brewery-score-band--roast { color: #ff9a86; }
.brewery-brew-night {
  text-align: center;
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: #f0c27a;
  background: rgba(90, 50, 20, 0.4);
  border: 1px dashed #a07040;
  border-radius: 8px;
  padding: 6px 10px;
}
.brewery-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.brewery-stat {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #5c3a1f;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}
.brewery-stat span {
  display: block;
  font-size: 0.7rem;
  color: #b99a78;
}
.brewery-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 1.05rem;
  color: #ffe6b8;
}
.brewery-verdict {
  margin: 12px 0 0;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.45);
  border-left: 4px solid #c48a3a;
  border-radius: 0 10px 10px 0;
  color: #f6e2c4;
  font-style: italic;
  line-height: 1.4;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.brewery-verdict--hidden {
  opacity: 0;
  transform: translateY(6px);
}
.brewery-name-label {
  display: block;
  margin-top: 14px;
  font-size: 0.85rem;
  color: #d2b08a;
}
.brewery-name-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #5c3a1f;
  background: rgba(0, 0, 0, 0.4);
  color: #f0ddc2;
  font-size: 1rem;
}
.brewery-muted {
  color: #b99a78;
  font-size: 0.85rem;
  line-height: 1.35;
}
.brewery-history-row {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #5c3a1f;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.brewery-history-row--legend { border-color: #e0b44a; }
.brewery-history-row--great { border-color: #c48a3a; }
.brewery-history-row--roast { border-color: #a04838; }
.brewery-history-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.brewery-history-score {
  color: #ffd27a;
  font-weight: 800;
}
.brewery-history-verdict {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #e8c9a0;
  font-style: italic;
}
@media (max-width: 420px) {
  .brewery-styles,
  .brewery-ing-grid { grid-template-columns: 1fr; }
  .brewery-stats,
  .brewery-live-stats { grid-template-columns: 1fr 1fr; }
}
