html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', 'Noto Sans Thai', sans-serif;
  -webkit-tap-highlight-color: transparent;
  background-color: #0c0d10;
  color: #e2e8f0;
}

:root {
  --surface-1: #121316;
  --surface-2: #18191d;
  --surface-3: #1e2025;
  --line-soft: rgba(255, 255, 255, 0.04);
  --line-strong: rgba(212, 198, 151, 0.12);
  --accent-soft: #d4c697;
  --shadow-tint: rgba(0, 0, 0, 0.4);
  --shadow-elevation-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-elevation-2: 0 4px 8px rgba(0, 0, 0, 0.4), 0 12px 24px rgba(0, 0, 0, 0.3);
  --shadow-elevation-3: 0 8px 16px rgba(0, 0, 0, 0.5), 0 24px 48px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

#app {
  position: relative;
}

#app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 50% -20%, rgba(212, 198, 151, 0.05), transparent 60%);
}

/* Noise overlay disabled for buttery smooth scrolling performance */
#app::after {
  display: none;
}

.demo-mode-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  background: #f5ec72;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.demo-mode-banner span {
  font-weight: 600;
}

@media (max-width: 640px) {
  .demo-mode-banner {
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
  }
}

.app-shell-home,
.app-shell-liveboard,
.app-shell-game {
  position: relative;
}

.app-topbar {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(18, 19, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.light-theme .app-topbar {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03) !important;
}

.home-topbar__inner,
.liveboard-topbar__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 18px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.home-topbar__title,
.home-topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-topbar__title {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.home-eyebrow,
.liveboard-topbar__eyebrow,
.game-shell__eyebrow,
.stock-group__eyebrow {
  color: #bdae7d;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.home-hero,
.liveboard-hero {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 18px 8px;
}

.home-hero {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 18px;
  align-items: stretch;
}

.home-hero__copy,
.home-hero__meta-card,
.liveboard-hero {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(17, 24, 39, 0.72));
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  box-shadow: 0 22px 42px rgba(2, 6, 23, 0.18);
}

.home-hero__copy {
  padding: 28px;
}

.home-hero__badge,
.liveboard-hero__badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.home-hero__heading {
  font-size: clamp(1.8rem, 2.4vw, 2.6rem);
  line-height: 1.08;
  font-weight: 900;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.03em;
}

.home-hero__text,
.liveboard-hero__text {
  margin: 12px 0 0;
  color: #94a3b8;
  max-width: 60ch;
  line-height: 1.7;
}

.home-hero__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.home-hero__meta-card {
  padding: 22px 20px;
}

.home-hero__meta-label {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  margin-bottom: 8px;
}

.home-hero__meta-value {
  font-size: 2rem;
  line-height: 1;
  color: #f8fafc;
}

.home-grid-wrap {
  max-width: 1440px;
  margin: 0 auto;
}

.home-market-tools {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 18px;
}

.home-market-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid rgba(226, 220, 196, 0.14);
  background: rgba(32, 33, 37, 0.3);
  padding: 0 2px;
  overflow-x: auto;
}

.home-market-tab {
  border: 0;
  background: transparent;
  color: #aaa69d;
  padding: 14px 10px 13px;
  font-size: 14px;
  font-weight: 800;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.home-market-tab.is-active {
  color: var(--accent-soft);
  border-bottom-color: var(--accent-soft);
}

.home-market-tab:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.home-market-tools__main {
  padding: 18px 0 0;
}

.home-market-tools__heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.home-market-tools__heading h2 {
  margin: 0;
  color: #f5f1e8;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.home-market-tools__heading p {
  margin: 6px 0 0;
  color: #aaa59b;
  font-size: 13px;
}

.home-market-tools__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.home-market-search,
.home-market-sort {
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(226, 220, 196, 0.14);
  background: rgba(43, 44, 50, 0.86);
  color: #e9e4d8;
  font-size: 14px;
  font-weight: 700;
}

.home-market-search {
  width: min(300px, 72vw);
  padding: 0 13px;
  outline: none;
}

.home-market-search:focus {
  border-color: rgba(245, 236, 114, 0.58);
  box-shadow: 0 0 0 3px rgba(245, 236, 114, 0.12);
}

.home-market-search::placeholder {
  color: #64748b;
}

.home-market-sort {
  padding: 0 14px;
  cursor: pointer;
}

.home-market-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 0 14px;
}

.home-market-chip {
  border: 1px solid rgba(226, 220, 196, 0.14);
  background: rgba(47, 48, 54, 0.72);
  color: #c9c3b8;
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.home-market-chip.is-active {
  color: #1e1f23;
  border-color: rgba(212, 198, 151, 0.68);
  background: rgba(212, 198, 151, 0.95);
}

.home-market-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary-card,
.home-market-empty {
  border: 1px solid rgba(226, 220, 196, 0.12);
  background: rgba(44, 45, 51, 0.66);
  border-radius: 12px;
}

.summary-card {
  padding: 13px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 198, 151, 0.28);
  box-shadow: 0 8px 20px rgba(212, 198, 151, 0.05);
}

.summary-card strong {
  color: var(--accent-soft) !important;
}

.home-market-summary span {
  display: block;
  color: #aaa59b;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.home-market-summary strong {
  color: #f5f1e8;
  font-size: 1.45rem;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
}

.home-market-empty {
  padding: 20px;
  color: #94a3b8;
  text-align: center;
}

.stock-group {
  background: linear-gradient(180deg, rgba(42, 43, 49, 0.6), rgba(36, 37, 42, 0.34));
  border: 1px solid rgba(226, 220, 196, 0.08);
  border-radius: 28px;
  padding: 18px;
}

.stock-group__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.stock-group__title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f4f0e7;
  margin: 2px 0 0;
  letter-spacing: -0.02em;
}

.stock-group__count {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(55, 55, 63, 0.72);
  color: #c9c3b8;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(226, 220, 196, 0.12);
}

.stock-card {
  min-height: 146px;
  padding: 16px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 20px -6px var(--shadow-tint);
  border: 1px solid rgba(226, 220, 196, 0.05);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}



.stock-card-open {
  background: linear-gradient(180deg, #27282e 0%, #1e1f23 100%);
  border-color: rgba(212, 198, 151, 0.12);
}

.stock-card-open:hover {
  border-color: rgba(212, 198, 151, 0.28);
  transform: translateY(-4px);
  box-shadow: 0 20px 38px rgba(10, 10, 12, 0.42), 0 0 16px rgba(212, 198, 151, 0.03);
}

.stock-card-closed {
  background: linear-gradient(180deg, rgba(37, 38, 43, 0.4) 0%, rgba(28, 29, 33, 0.3) 100%);
  border-color: rgba(226, 220, 196, 0.05);
}

.stock-card__glow {
  position: absolute;
  inset: auto -20% -45% auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(212, 198, 151, 0.12), transparent 68%);
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.stock-card:hover .stock-card__glow {
  opacity: 0.8;
  transform: scale(1.1);
}

.stock-card__top,
.stock-card__bottom {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.stock-card__top {
  align-items: flex-start;
}

.stock-card__flag-wrap {
  flex: 0 0 auto;
  padding: 4px;
  border-radius: 11px;
  background: rgba(58, 58, 64, 0.58);
  border: 1px solid rgba(226, 220, 196, 0.10);
}

.stock-card__status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.stock-card__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.stock-card__status-dot.is-open {
  background: var(--accent-soft);
  animation: pulse-dot 2s infinite ease-in-out;
}

.stock-card__status-dot.is-closed {
  background: #7a7771;
}

.stock-card__status-text,
.stock-card__meta-label,
.stock-card__timer-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stock-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stock-card__meta-value,
.stock-card__timer-value {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: 'Outfit', sans-serif;
}

.stock-card__actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.stock-card__timer {
  padding: 5px 10px;
  border-radius: 8px;
  min-width: 86px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.15);
  font-family: 'Outfit', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #34d399;
  text-shadow: 0 0 4px rgba(52, 211, 153, 0.2);
  transition: all 0.25s ease;
}

.stock-card-closed .stock-card__timer {
  background: rgba(30, 31, 35, 0.4);
  border: 1px solid rgba(226, 220, 196, 0.04);
  color: #7a7771;
  text-shadow: none;
}



.risk-warning-panel {
  margin-bottom: 12px;
  border: 1px solid rgba(245, 236, 114, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(55, 55, 63, 0.78), rgba(42, 43, 49, 0.72));
  padding: 11px;
}

.risk-warning-panel.is-empty {
  border-color: rgba(226, 220, 196, 0.10);
  background: rgba(42, 43, 49, 0.52);
}

.risk-warning-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 9px;
}

.risk-warning-title {
  color: #f5ec72;
  font-size: 12px;
  font-weight: 900;
}

.risk-warning-sub,
.risk-warning-head span,
.risk-warning-empty {
  color: #aaa59b;
  font-size: 11px;
  line-height: 1.45;
}

.risk-warning-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(245, 236, 114, 0.12);
  border: 1px solid rgba(245, 236, 114, 0.16);
  padding: 4px 8px;
  color: #e7dc73;
  font-weight: 800;
}

.risk-warning-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  max-height: 92px;
  overflow-y: auto;
}

.risk-warning-chip {
  border: 1px solid rgba(245, 236, 114, 0.14);
  background: rgba(32, 33, 37, 0.58);
  border-radius: 10px;
  padding: 7px 9px;
}

.risk-warning-chip strong,
.risk-warning-chip small {
  display: block;
}

.risk-warning-chip strong {
  color: #f0ece2;
  font-size: 12px;
  line-height: 1.2;
}

.risk-warning-chip small {
  color: #d5c95f;
  font-size: 10px;
  margin-top: 3px;
}

.restricted-toggle {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 44px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s var(--transition-smooth);
}

.restricted-toggle__knob {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #e2e8f0;
  transition: transform 0.2s var(--transition-smooth), background-color 0.2s var(--transition-smooth);
}

.restricted-toggle__text {
  display: none;
}

.restricted-toggle.is-on {
  background: #991b1b !important;
  border-color: #991b1b !important;
}

.restricted-toggle.is-on .restricted-toggle__knob {
  transform: translateX(22px);
  background: #fff;
}

.restricted-toggle.is-off {
  background: rgba(255, 255, 255, 0.04) !important;
}

.restricted-panel {
  width: 100%;
  max-width: 672px; /* 2xl */
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.94)) !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  border-radius: 16px;
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.3) !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.restricted-panel__header {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.88)) !important;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14) !important;
  color: #c5a8a8 !important;
  font-weight: 700;
  font-size: 13px;
}

.restricted-panel__body {
  padding: 16px;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-shell-game .restricted-input {
  width: 100%;
  height: 96px;
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  color: #e2e8f0 !important;
  font-family: 'Outfit', monospace;
  outline: none;
  resize: none;
  box-shadow: none !important;
}

.app-shell-game .restricted-input:focus {
  border-color: rgba(239, 68, 68, 0.2) !important;
}

.hhlott-section {
  background: rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  border-radius: 12px;
  padding: 12px;
}

.btn-refresh-hhlott {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.4) !important;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-refresh-hhlott:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}

.btn-save-restricted {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-save-restricted:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

.restricted-status {
  color: rgba(255, 255, 255, 0.25) !important;
  font-size: 10px;
}

.restricted-panel.is-disabled .restricted-input {
  opacity: 0.5;
  color: rgba(255, 255, 255, 0.4) !important;
}

.restricted-panel.is-disabled .restricted-status {
  color: rgba(255, 255, 255, 0.2) !important;
}

.game-shell {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.94)) !important;
  border-color: rgba(148, 163, 184, 0.14) !important;
}

.game-shell__header {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.88)) !important;
}

.game-shell__back {
  background: rgba(30, 41, 59, 0.82);
  padding: 8px !important;
}

.game-shell__flag {
  border-radius: 10px !important;
}

.game-tabs button {
  min-height: 42px;
  border-radius: 14px !important;
}

.liveboard-hero {
  margin-top: 12px;
  padding: 20px 24px;
}

.liveboard-stock {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(17, 24, 39, 0.9)) !important;
  border-radius: 24px !important;
}

.liveboard-stock__header {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(30, 41, 59, 0.78)) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.draw-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.26);
  background: rgba(120, 53, 15, 0.3);
  color: #fde68a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.draw-time-pill svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.draw-time-pill strong {
  color: #fef3c7;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.draw-time-pill.is-waiting {
  border-color: rgba(248, 113, 113, 0.38);
  background: rgba(127, 29, 29, 0.38);
  color: #fecaca;
}

.bill-time-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.transfer-time-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.5);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.transfer-time-badge.is-before {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(20, 83, 45, 0.24);
  color: #86efac;
}

.transfer-time-badge.is-late {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(127, 29, 29, 0.34);
  color: #fca5a5;
}

.transfer-time-badge.is-unknown {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(71, 85, 105, 0.22);
  color: #cbd5e1;
}

button,
input,
textarea,
select {
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease;
}

button {
  letter-spacing: 0;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.08s;
}

input,
textarea,
select {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow:
    0 0 0 1.5px rgba(232, 223, 110, 0.6),
    0 0 0 5px rgba(232, 223, 110, 0.10),
    0 0 20px rgba(232, 223, 110, 0.06);
}

.custom-scrollbar::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.88);
  border-radius: 999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #475569, #334155);
  border-radius: 999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #64748b, #475569);
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.fade-in {
  animation: fadeIn 0.24s var(--transition-smooth, cubic-bezier(0.16, 1, 0.3, 1));
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.slide-up {
  animation: slideUp 0.36s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(24px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.winner-card {
  border: 1px solid rgba(16, 185, 129, 0.55) !important;
  background:
    linear-gradient(135deg, rgba(6, 78, 59, 0.96), rgba(4, 120, 87, 0.82)) !important;
  box-shadow:
    0 20px 35px rgba(4, 120, 87, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
  z-index: 10;
  transition: all 0.28s ease;
  color: #ecfdf5 !important;
}

.winner-badge {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

.modal-backdrop {
  background-color: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.bg-gray-800,
.bg-\[\#121214\],
.bg-black\/30,
.bg-white\/\[0\.02\] {
  box-shadow:
    0 14px 34px rgba(2, 6, 23, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.border-gray-700,
.border-gray-600,
.border-white\/5,
.border-white\/10 {
  border-color: rgba(255, 255, 255, 0.04) !important;
}

.rounded,
.rounded-lg,
.rounded-xl,
.rounded-2xl {
  backdrop-filter: blur(10px);
}

.sticky.top-0 {
  backdrop-filter: blur(18px);
}

.bg-gray-800.p-4.shadow-sm.sticky.top-0.z-20.border-b.border-gray-700.flex.justify-between.items-center {
  background: rgba(15, 23, 42, 0.88) !important;
  border-bottom-color: rgba(148, 163, 184, 0.12) !important;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.24) !important;
}

.bg-blue-900.text-white.p-4.shadow-md.sticky.top-0.z-20.flex.justify-between.items-center.border-b.border-blue-800 {
  background:
    linear-gradient(135deg, rgba(30, 64, 175, 0.92), rgba(30, 41, 59, 0.92)) !important;
  border-bottom-color: rgba(96, 165, 250, 0.16) !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28) !important;
}

.relative.p-2.rounded.shadow-sm.flex.flex-col.justify-between.min-h-\[85px\].overflow-hidden.group.border {
  border-radius: 18px;
  padding: 14px;
  box-shadow:
    0 14px 28px rgba(2, 6, 23, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.relative.p-2.rounded.shadow-sm.flex.flex-col.justify-between.min-h-\[85px\].overflow-hidden.group.border:hover {
  transform: translateY(-2px);
}

.w-full.max-w-2xl.bg-gray-800.border.border-gray-700.rounded-lg.shadow-xl.overflow-hidden.flex.flex-col,
.w-full.max-w-lg.bg-gray-800.rounded-xl.shadow-2xl.overflow-hidden.flex.flex-col.max-h-\[90vh\].slide-up.border.border-gray-700 {
  border-radius: 22px !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 24px 44px rgba(2, 6, 23, 0.30) !important;
}

.bg-gray-900\/50,
.bg-gray-800,
.bg-gray-700,
.bg-black\/40 {
  border-color: rgba(148, 163, 184, 0.18);
}

.placeholder-gray-500::placeholder,
.placeholder-gray-600::placeholder,
.placeholder-gray-700::placeholder {
  color: #64748b !important;
}

.bg-blue-600,
.from-blue-600.to-blue-500,
.from-blue-600.via-indigo-600.to-purple-600 {
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.bg-green-600 {
  box-shadow: 0 10px 22px rgba(22, 163, 74, 0.18);
}

.bg-red-600,
.bg-rose-500\/10 {
  box-shadow: 0 10px 20px rgba(225, 29, 72, 0.14);
}

.bg-gray-800.rounded-xl.shadow-md.overflow-hidden.border.border-gray-700 {
  border-radius: 20px !important;
  overflow: hidden;
}

.bg-\[\#121214\].border.border-white\/5.rounded-2xl,
.bg-white\/\[0\.02\].border.border-white\/5.p-6.rounded-2xl.relative.overflow-hidden.shadow-lg {
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 42, 0.92)) !important;
}

.bg-emerald-950\/30.border-emerald-500\/20,
.bg-rose-950\/30.border-rose-500\/20 {
  box-shadow:
    0 20px 40px rgba(2, 6, 23, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.bg-gray-800.border.border-gray-700.rounded.px-2.py-1.shadow-sm.shrink-0.min-w-\[120px\],
.bg-gray-800.rounded.p-2.flex.gap-2.border.border-gray-700.shadow-sm {
  border-radius: 14px;
}

.bg-gray-900.border-2.border-gray-800\/80.text-white.rounded-2xl {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(59, 130, 246, 0.18) !important;
}

body.light-theme {
  background:
    radial-gradient(circle at top left, rgba(245, 236, 114, 0.18), transparent 22%),
    linear-gradient(180deg, #d7dbda 0%, #ece9df 34%, #dfe3df 100%) !important;
  color: #3e403f !important;
}

.light-theme .bg-gray-900,
.light-theme .bg-gray-900\/50 {
  background-color: #edf2f7 !important;
}

.light-theme .bg-gray-800,
.light-theme .bg-gray-800\/50,
.light-theme .bg-\[\#121214\] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96)) !important;
  box-shadow:
    0 18px 34px rgba(148, 163, 184, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.light-theme .bg-gray-700,
.light-theme .bg-black\/40 {
  background-color: rgba(226, 232, 240, 0.72) !important;
}

.light-theme .home-market-tabs {
  background: rgba(239, 236, 226, 0.66);
  border-bottom-color: rgba(90, 90, 86, 0.16);
}

.light-theme .home-market-tools__heading h2,
.light-theme .home-market-summary strong {
  color: #2f3133;
}

.light-theme .home-market-search,
.light-theme .home-market-sort,
.light-theme .home-market-chip,
.light-theme .summary-card,
.light-theme .home-market-empty {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(90, 90, 86, 0.18) !important;
  color: #444642 !important;
}

/* Light Theme Card Overrides for visibility */
.light-theme .summary-card.is-open strong {
  color: #059669 !important;
}
.light-theme .summary-card.is-closing strong {
  color: #d97706 !important;
}
.light-theme .summary-card.is-waiting strong {
  color: #7c3aed !important;
}
.light-theme .summary-card.is-today strong {
  color: #2563eb !important;
}

.light-theme .stock-card__timer {
  background: rgba(5, 150, 105, 0.05) !important;
  border-color: rgba(5, 150, 105, 0.15) !important;
  color: #059669 !important;
  text-shadow: none !important;
}

.light-theme .stock-card-closed .stock-card__timer {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #64748b !important;
}



.light-theme .home-market-chip.is-active {
  background: #f5ec72 !important;
  border-color: rgba(80, 80, 72, 0.14) !important;
  color: #2d2e2f !important;
}

.light-theme .border-gray-800,
.light-theme .border-gray-700,
.light-theme .border-gray-600,
.light-theme .border-white\/5,
.light-theme .border-white\/10 {
  border-color: rgba(148, 163, 184, 0.24) !important;
}

.light-theme .text-white,
.light-theme .text-gray-100,
.light-theme .text-gray-200 {
  color: #1f2937 !important;
}

.light-theme .text-gray-300,
.light-theme .text-gray-400 {
  color: #475569 !important;
}

.light-theme .text-gray-500 {
  color: #64748b !important;
}

.light-theme .text-green-400,
.light-theme .text-green-300 {
  color: #059669 !important;
}

.light-theme .text-red-400,
.light-theme .text-red-300 {
  color: #dc2626 !important;
}

.light-theme .text-yellow-400 {
  color: #d97706 !important;
}

.light-theme .text-blue-400 {
  color: #2563eb !important;
}

.light-theme .custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.9);
}

.light-theme .custom-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #cbd5e1, #94a3b8);
}

.light-theme .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #94a3b8, #64748b);
}

.light-theme .modal-backdrop {
  background-color: rgba(226, 232, 240, 0.72);
}

.light-theme input,
.light-theme textarea,
.light-theme select {
  background-color: rgba(255, 255, 255, 0.94) !important;
  color: #334155 !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

.light-theme input::placeholder,
.light-theme textarea::placeholder {
  color: #94a3b8 !important;
}

.light-theme .bg-blue-900 {
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.96), rgba(224, 231, 255, 0.96)) !important;
  color: #1d4ed8 !important;
  border-color: rgba(96, 165, 250, 0.22) !important;
}

.light-theme .bg-blue-800 {
  background-color: rgba(191, 219, 254, 0.96) !important;
  color: #1e3a8a !important;
}

.light-theme .winner-card {
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(209, 250, 229, 0.98)) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  color: #065f46 !important;
}

.light-theme .draw-time-pill {
  background: rgba(254, 243, 199, 0.92);
  border-color: rgba(217, 119, 6, 0.28);
  color: #92400e;
}

.light-theme .draw-time-pill strong {
  color: #78350f;
}

.light-theme .draw-time-pill.is-waiting {
  background: rgba(254, 226, 226, 0.96);
  border-color: rgba(220, 38, 38, 0.28);
  color: #991b1b;
}

.light-theme .transfer-time-badge.is-before {
  background: rgba(220, 252, 231, 0.92);
  border-color: rgba(22, 163, 74, 0.22);
  color: #047857;
}

.light-theme .transfer-time-badge.is-late {
  background: rgba(254, 226, 226, 0.95);
  border-color: rgba(220, 38, 38, 0.26);
  color: #b91c1c;
}

/* Fine polish */
.rounded-full {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.font-mono {
  letter-spacing: 0.04em;
}

img[src*="flagcdn.com"] {
  border-radius: 8px !important;
  box-shadow:
    0 6px 14px rgba(2, 6, 23, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.text-yellow-400.font-bold.text-xs.mt-1.bg-yellow-900\/30,
#game-timer {
  background: rgba(120, 53, 15, 0.28) !important;
  border: 1px solid rgba(245, 158, 11, 0.22);
  padding-left: 10px !important;
  padding-right: 10px !important;
  min-width: 72px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.bg-gray-700.text-xs.px-2.py-0\.5.rounded.ml-1.font-mono.text-yellow-400,
.bg-gray-900\/50.text-xs.px-2.py-0\.5.rounded-full.text-gray-400,
.bg-gray-700.text-gray-300.text-\[10px\].px-1\.5.py-0\.5.rounded.border.border-gray-600 {
  border-color: rgba(148, 163, 184, 0.16) !important;
  background: rgba(30, 41, 59, 0.72) !important;
}

.bg-gray-700.hover\:bg-gray-600.p-1\.5.rounded-full.transition.text-gray-300,
.p-1.rounded-full.hover\:bg-gray-700.text-gray-400.transition,
.bg-blue-800.p-2.rounded-full.hover\:bg-blue-700.transition,
.text-gray-500.hover\:text-red-400.bg-gray-700.p-1.rounded-full {
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.16);
}

.bg-gradient-to-r.from-blue-600.to-blue-500.hover\:from-blue-500.hover\:to-blue-400.text-white.px-6.h-11.rounded-xl.font-bold.shadow-lg.shadow-blue-900\/20.transition-all.flex.items-center.justify-center.gap-2.border.border-blue-500\/50 {
  background-image: linear-gradient(135deg, #2563eb, #3b82f6) !important;
  box-shadow:
    0 18px 28px rgba(37, 99, 235, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.bg-green-600.text-white.w-20.h-9.rounded.font-bold.shadow-sm.flex.items-center.justify-center.text-sm,
.font-bold.rounded.shadow-sm.flex.items-center.justify-center.bg-green-600.text-white.hover\:bg-green-500.h-9.px-6.whitespace-nowrap {
  background-image: linear-gradient(135deg, #16a34a, #22c55e) !important;
  box-shadow:
    0 14px 24px rgba(22, 163, 74, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.opacity-50 {
  filter: saturate(0.8);
}

.bg-gray-800.rounded.shadow-sm.border.border-gray-700.p-2.flex.gap-2.fade-in,
.flex.items-center.gap-2.bg-gray-800.border.border-gray-700.rounded.px-2.py-1.shadow-sm.shrink-0.min-w-\[120px\] {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.82), rgba(17, 24, 39, 0.92)) !important;
}

.bg-black\/30.border.border-white\/5.p-4.rounded-xl.hover\:bg-white\/\[0\.02\].transition-colors.cursor-pointer.group {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.88)) !important;
  border-color: rgba(148, 163, 184, 0.12) !important;
}

.bg-black\/30.border.border-white\/5.p-4.rounded-xl.hover\:bg-white\/\[0\.02\].transition-colors.cursor-pointer.group:hover {
  border-color: rgba(96, 165, 250, 0.18) !important;
  transform: translateY(-1px);
}

.text-green-400.font-black.text-2xl,
.text-green-400.font-black.text-lg,
.text-green-400.font-bold.text-sm {
  text-shadow: 0 0 18px rgba(16, 185, 129, 0.10);
}

.text-red-400,
.text-rose-500 {
  text-shadow: 0 0 16px rgba(244, 63, 94, 0.08);
}

.light-theme img[src*="flagcdn.com"] {
  box-shadow: 0 6px 12px rgba(148, 163, 184, 0.16);
}

.light-theme .bg-gray-700.text-xs.px-2.py-0\.5.rounded.ml-1.font-mono.text-yellow-400,
.light-theme .bg-gray-900\/50.text-xs.px-2.py-0\.5.rounded-full.text-gray-400,
.light-theme .bg-gray-700.text-gray-300.text-\[10px\].px-1\.5.py-0\.5.rounded.border.border-gray-600 {
  background: rgba(226, 232, 240, 0.92) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}

.light-theme #game-timer {
  background: rgba(254, 243, 199, 0.96) !important;
  border-color: rgba(245, 158, 11, 0.24) !important;
}

/* Muted friendly palette overrides */
.stock-card__flag {
  width: 32px !important;
  height: 24px !important;
  border-radius: 7px !important;
}

.bg-gray-900,
.bg-gray-900\/50 {
  background-color: #222328 !important;
}

.bg-gray-800,
.bg-gray-800\/50,
.bg-\[\#121214\] {
  background:
    linear-gradient(180deg, rgba(47, 48, 54, 0.94), rgba(38, 39, 44, 0.94)) !important;
}

.bg-gray-700,
.bg-black\/40 {
  background-color: rgba(62, 63, 70, 0.78) !important;
}

.text-blue-400,
.home-market-tab.is-active {
  color: #d4c697 !important;
}

.bg-blue-600,
.bg-blue-800,
.bg-blue-900 {
  background-color: #3f4148 !important;
  border-color: rgba(212, 198, 151, 0.22) !important;
}

.text-yellow-400 {
  color: #d4c697 !important;
}

.border-gray-800,
.border-gray-700,
.border-gray-600 {
  border-color: rgba(255, 255, 255, 0.04) !important;
}

.text-gray-100,
.text-gray-200 {
  color: #f0ece2 !important;
}

.text-gray-300,
.text-gray-400 {
  color: #bdb7aa !important;
}

.text-gray-500 {
  color: #918d85 !important;
}

.light-theme .stock-card-open {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(236, 233, 224, 0.94)) !important;
}

.light-theme .stock-card-closed {
  background: linear-gradient(180deg, rgba(226, 226, 222, 0.72), rgba(214, 216, 213, 0.72)) !important;
}

.light-theme .stock-group {
  background: rgba(239, 236, 226, 0.58);
  border-color: rgba(90, 90, 86, 0.12);
}

.light-theme .stock-group__title,
.light-theme .stock-card h3 {
  color: #333536 !important;
}

.light-theme .stock-group__count,
.light-theme .stock-card__flag-wrap,
.light-theme .stock-card__timer {
  background: rgba(255, 255, 255, 0.66) !important;
  border-color: rgba(90, 90, 86, 0.14) !important;
}

.light-theme .bg-gray-900,
.light-theme .bg-gray-900\/50 {
  background-color: #e2e4df !important;
}

.light-theme .bg-gray-800,
.light-theme .bg-gray-800\/50,
.light-theme .bg-\[\#121214\] {
  background:
    linear-gradient(180deg, rgba(248, 246, 239, 0.95), rgba(232, 230, 222, 0.96)) !important;
}

.light-theme .bg-gray-700,
.light-theme .bg-black\/40 {
  background-color: rgba(218, 217, 209, 0.82) !important;
}

.light-theme .risk-warning-panel {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.06);
}

.light-theme .risk-warning-panel.is-empty {
  background: #fbfbf8;
  border-color: rgba(0, 0, 0, 0.04);
}

.light-theme .risk-warning-title {
  color: #bdae7d;
}

.light-theme .risk-warning-sub,
.light-theme .risk-warning-empty {
  color: rgba(0, 0, 0, 0.5);
}

.light-theme .risk-warning-head span {
  background: rgba(189, 174, 125, 0.1);
  border-color: rgba(189, 174, 125, 0.2);
  color: #7a6a4d;
}

.light-theme .risk-warning-chip {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.06);
}

.light-theme .risk-warning-chip strong {
  color: rgba(0, 0, 0, 0.8);
}

.light-theme .risk-warning-chip small {
  color: #dc2626;
}

.light-theme .restricted-toggle {
  background: rgba(0, 0, 0, 0.08) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

.light-theme .restricted-toggle.is-on {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}

.light-theme .restricted-toggle.is-off {
  background: rgba(0, 0, 0, 0.08) !important;
}

.light-theme .restricted-panel {
  background: linear-gradient(180deg, #e4e6e1, #d9ddd8) !important;
  border: 1px solid rgba(121, 130, 122, 0.25) !important;
  box-shadow: 0 12px 34px rgba(73, 82, 76, 0.08) !important;
}

.light-theme .restricted-panel__header {
  background: linear-gradient(180deg, #f1f2ee, #e7e9e4) !important;
  border-bottom: 1px solid rgba(121, 130, 122, 0.18) !important;
  color: #b91c1c !important;
}

.light-theme .restricted-panel__body {
  background: transparent !important;
}

.light-theme .app-shell-game .restricted-input {
  background: #ffffff !important;
  border: 1px solid rgba(121, 130, 122, 0.25) !important;
  color: #1f2933 !important;
  box-shadow: none !important;
}

.light-theme .app-shell-game .restricted-input:focus {
  border-color: rgba(220, 38, 38, 0.3) !important;
}

.light-theme .hhlott-section {
  background: #f1f2ee !important;
  border: 1px solid rgba(121, 130, 122, 0.12) !important;
}

.light-theme .btn-refresh-hhlott {
  background: #ffffff !important;
  border: 1px solid rgba(121, 130, 122, 0.25) !important;
  color: #3f4a56 !important;
}

.light-theme .btn-refresh-hhlott:hover {
  background: #f1f2ee !important;
  color: #1f2933 !important;
}

.light-theme .btn-save-restricted {
  background: #3f4a56 !important;
  border: 1px solid #3f4a56 !important;
  color: #ffffff !important;
}

.light-theme .btn-save-restricted:hover {
  background: #2d3743 !important;
  border-color: #2d3743 !important;
}

.light-theme .restricted-status {
  color: #55606a !important;
}

.light-theme .restricted-panel.is-disabled .restricted-input {
  color: rgba(0, 0, 0, 0.4) !important;
  border-color: rgba(121, 130, 122, 0.12) !important;
}

.light-theme .restricted-panel.is-disabled .restricted-status {
  color: rgba(0, 0, 0, 0.3) !important;
}

@media (max-width: 900px) {
  .home-market-tools__heading {
    flex-direction: column;
  }

  .home-market-tools__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .home-market-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .home-market-search {
    width: 100%;
  }

  .home-market-sort {
    width: 100%;
  }

  .home-market-summary {
    grid-template-columns: 1fr;
  }
}

/* Game slip muted soft-gray theme
   Scoped to the game page so the deploy risk stays away from finance/liveboard. */
.app-shell-game {
  background:
    radial-gradient(circle at 12% 0%, rgba(238, 239, 232, 0.58), transparent 28%),
    radial-gradient(circle at 92% 4%, rgba(196, 203, 199, 0.42), transparent 30%),
    linear-gradient(180deg, #cfd3cf 0%, #d7d9d6 46%, #c9cdc8 100%) !important;
  color: #1f2933 !important;
}

.app-shell-game .game-shell,
.app-shell-game > .w-full.max-w-2xl.bg-gray-800.border.border-gray-700.rounded-lg.shadow-xl.overflow-hidden.flex.flex-col {
  background: linear-gradient(180deg, #e4e6e1, #d9ddd8) !important;
  border-color: rgba(121, 130, 122, 0.34) !important;
  box-shadow:
    0 26px 50px rgba(73, 82, 76, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

.app-shell-game .game-shell__header {
  background: linear-gradient(180deg, #f1f2ee, #e7e9e4) !important;
  border-bottom-color: rgba(137, 145, 136, 0.22) !important;
}

.app-shell-game .game-shell__back {
  background: #3f4a56 !important;
  color: #e6edf0 !important;
  border: 1px solid rgba(31, 41, 51, 0.18);
  box-shadow: 0 10px 18px rgba(65, 74, 80, 0.18) !important;
}

.app-shell-game .game-shell__eyebrow {
  color: #916a18 !important;
}

.app-shell-game .game-shell h1,
.app-shell-game .text-gray-100,
.app-shell-game .text-gray-200,
.app-shell-game .text-white {
  color: #1f2933 !important;
}

.app-shell-game .text-gray-300,
.app-shell-game .text-gray-400,
.app-shell-game .text-gray-500 {
  color: #5f6d77 !important;
}

.app-shell-game #tabs-area,
.app-shell-game #game-footer,
.app-shell-game #history-area {
  background: linear-gradient(180deg, #e4e6e1, #dfe2dd) !important;
  border-color: rgba(137, 145, 136, 0.22) !important;
}

.app-shell-game #tabs-area > .bg-gray-900\/50,
.app-shell-game #tabs-area .bg-gray-800.border,
.app-shell-game #tabs-area .bg-gray-800 {
  background: rgba(243, 244, 240, 0.86) !important;
  border-color: rgba(137, 145, 136, 0.24) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}

.app-shell-game .game-tabs button {
  min-height: 44px;
  border-radius: 13px !important;
  box-shadow: none !important;
}

.app-shell-game .game-tabs button.bg-blue-600 {
  background: #343c49 !important;
  color: #ffffff !important;
  border-color: rgba(31, 41, 51, 0.24) !important;
  transform: none !important;
}

.app-shell-game .game-tabs button.bg-gray-700 {
  background: #d9dbd5 !important;
  color: #465461 !important;
  border-color: transparent !important;
}

.app-shell-game input,
.app-shell-game textarea,
.app-shell-game select {
  background: #f5f5f1 !important;
  color: #1f2933 !important;
  border-color: rgba(137, 145, 136, 0.32) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55) !important;
}

.app-shell-game input::placeholder,
.app-shell-game textarea::placeholder {
  color: #74808a !important;
  opacity: 1 !important;
}

.app-shell-game #num-input::placeholder {
  color: #6d7884 !important;
  font-weight: 900;
}

.app-shell-game #btn-ok,
.app-shell-game .bg-blue-600.text-white {
  background: #343c49 !important;
  color: #ffffff !important;
  box-shadow: 0 12px 22px rgba(52, 60, 73, 0.16) !important;
}

.app-shell-game #tabs-area > .flex.gap-2.mb-2 button.bg-gray-700 {
  background: #d5d8d2 !important;
  color: #44515d !important;
  border-color: rgba(137, 145, 136, 0.30) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

.app-shell-game #tabs-area > .flex.gap-2.mb-2 button.bg-purple-600,
.app-shell-game #tabs-area > .flex.gap-2.mb-2 button.bg-yellow-600 {
  background: #343c49 !important;
  color: #ffffff !important;
  border-color: rgba(31, 41, 51, 0.24) !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.fade-in {
  background: #f2f3ef !important;
  border-color: rgba(137, 145, 136, 0.26) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52) !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.fade-in .text-blue-400 {
  color: #8a640f !important;
  text-shadow: none !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.fade-in button.bg-gray-700 {
  background: #59636f !important;
  color: #f7f8f5 !important;
  border-color: rgba(31, 41, 51, 0.20) !important;
  box-shadow: 0 6px 12px rgba(80, 86, 92, 0.12) !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.fade-in button.bg-gray-700:hover {
  background: #6b2f35 !important;
  color: #fff5f5 !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.space-y-2 {
  background: #f2f3ef !important;
  border-color: rgba(137, 145, 136, 0.28) !important;
  box-shadow:
    0 10px 20px rgba(80, 86, 92, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.52) !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.space-y-2 .text-blue-300 {
  color: #3f82d8 !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.space-y-2 .bg-gray-900\/80 {
  background: #f7f7f3 !important;
  border-color: rgba(137, 145, 136, 0.26) !important;
  color: #263240 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54) !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.space-y-2 .bg-gray-700.border.border-gray-600 {
  background: #d8dcd6 !important;
  border-color: rgba(137, 145, 136, 0.30) !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.space-y-2 .text-gray-300 {
  color: #263240 !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.space-y-2 .text-gray-400,
.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.space-y-2 .text-gray-500 {
  color: #5f6d77 !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.space-y-2 button.bg-gray-700 {
  background: #d5d8d2 !important;
  color: #44515d !important;
  border: 1px solid rgba(137, 145, 136, 0.30) !important;
}

.app-shell-game #tabs-area .bg-gray-800.border.border-gray-700.rounded.p-2.space-y-2 .bg-yellow-900\/30 {
  background: #fff5d8 !important;
  border-color: rgba(180, 128, 22, 0.32) !important;
  color: #7c560c !important;
}

.app-shell-game .font-bold.rounded.shadow-sm.flex.items-center.justify-center.bg-green-600,
.app-shell-game .bg-green-600 {
  background: #087b5d !important;
  color: #ffffff !important;
  box-shadow: 0 14px 26px rgba(8, 123, 93, 0.20) !important;
}

.app-shell-game #local-list {
  min-height: 0 !important;
  padding: 12px !important;
  background: #dfe3dd !important;
  border-color: rgba(137, 145, 136, 0.20) !important;
}

.app-shell-game #local-list > .bg-gray-800.rounded.shadow-sm.border.border-gray-700.p-2.flex.gap-2.fade-in {
  background: #f2f3ef !important;
  border-color: rgba(137, 145, 136, 0.28) !important;
  border-width: 1px !important;
  border-radius: 13px !important;
  padding: 8px !important;
  box-shadow:
    0 10px 20px rgba(80, 86, 92, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.56) !important;
}

.app-shell-game #local-list .bg-gray-700.rounded.p-1.shrink-0 {
  background: #d9dcd6 !important;
  border-color: rgba(137, 145, 136, 0.30) !important;
  color: #1f2933 !important;
}

.app-shell-game #local-list .bg-gray-700.rounded.p-1.shrink-0 .border-b {
  border-color: rgba(137, 145, 136, 0.28) !important;
}

.app-shell-game #local-list .bg-gray-900.border.border-gray-700.rounded.p-2 {
  max-height: none !important;
  overflow: visible !important;
  background: #f7f7f3 !important;
  border-color: rgba(137, 145, 136, 0.26) !important;
  color: #263240 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52) !important;
  line-height: 1.55 !important;
}

.app-shell-game #local-list button.w-10 {
  width: 42px !important;
  background: #e2e4df !important;
  color: #6f7a84 !important;
  border-color: rgba(137, 145, 136, 0.24) !important;
  border-radius: 10px !important;
}

.app-shell-game #game-footer {
  background: #f2f3ef !important;
  border-color: rgba(137, 145, 136, 0.24) !important;
  box-shadow: 0 -10px 24px rgba(80, 86, 92, 0.10) !important;
}

.app-shell-game #footer-controls #btn-capture {
  background: #f4f5f1 !important;
  color: #44515d !important;
  border-color: rgba(137, 145, 136, 0.28) !important;
  box-shadow: none !important;
}

.app-shell-game #footer-controls #btn-save-firebase {
  background-image: none !important;
  background-color: #2f6fe4 !important;
  color: #ffffff !important;
  border-color: rgba(38, 91, 192, 0.26) !important;
  box-shadow: 0 14px 24px rgba(47, 111, 228, 0.18) !important;
}

.app-shell-game .text-green-400,
.app-shell-game .text-green-300 {
  color: #087b5d !important;
}

.app-shell-game #game-timer {
  background: #f7efe3 !important;
  border-color: rgba(156, 110, 35, 0.24) !important;
  color: #8a5b1c !important;
}

.app-shell-game .custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(207, 211, 205, 0.72) !important;
}

.app-shell-game .custom-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #aeb7ad, #8e988f) !important;
}

/* Mobile Mode Layout & Scaling */
body.mode-mobile {
  font-size: 14px !important;
}

body.mode-mobile .home-topbar__inner,
body.mode-mobile .liveboard-topbar__inner {
  padding: 10px 12px !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
}

body.mode-mobile .home-topbar__title {
  align-items: center !important;
}

body.mode-mobile .home-topbar__actions,
body.mode-mobile .liveboard-topbar__actions {
  justify-content: center !important;
  width: 100% !important;
}

body.mode-mobile .home-hero {
  grid-template-columns: 1fr !important;
  padding: 12px 12px 4px !important;
  gap: 12px !important;
}

body.mode-mobile .home-hero__copy {
  padding: 16px !important;
}

body.mode-mobile .home-hero__meta {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}

body.mode-mobile .home-hero__meta-card {
  padding: 12px !important;
}

body.mode-mobile .group-grid {
  grid-template-columns: 1fr !important;
  gap: 8px !important;
}

body.mode-mobile .stock-group {
  padding: 12px !important;
  border-radius: 16px !important;
}

body.mode-mobile .game-shell,
body.mode-mobile .restricted-panel {
  max-width: 100% !important;
  border-radius: 12px !important;
}

body.mode-mobile .game-shell__header {
  padding: 8px 12px !important;
}

body.mode-mobile .game-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

body.mode-mobile .local-list-item,
body.mode-mobile .history-item {
  padding: 8px !important;
}

/* Segmented Control Layout Toggle */
.layout-toggle-container {
  display: inline-flex;
  background: rgba(30, 31, 35, 0.6);
  border: 1px solid rgba(226, 220, 196, 0.08);
  border-radius: 12px;
  padding: 3px;
  position: relative;
}

.layout-toggle-btn {
  padding: 6px 14px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #8e8b83;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s ease;
  outline: none;
}

.layout-toggle-btn:hover {
  color: #e7e3d8;
}

.layout-toggle-btn.is-active {
  color: #111827 !important;
  background-color: #d4c697 !important; /* --accent-soft */
  box-shadow: 0 4px 12px rgba(212, 198, 151, 0.24);
}

.layout-toggle-btn:active {
  transform: scale(0.95);
}

/* Compact version for game header */
.layout-toggle-container.is-compact {
  border-radius: 9px;
  padding: 2px;
}

.layout-toggle-container.is-compact .layout-toggle-btn {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
}

.light-theme .layout-toggle-container {
  background: rgba(90, 90, 86, 0.08);
  border-color: rgba(90, 90, 86, 0.12);
}

.light-theme .layout-toggle-btn {
  color: #5a5a56;
}

.light-theme .layout-toggle-btn:hover {
  color: #111827;
}

.light-theme .layout-toggle-btn.is-active {
  color: #ffffff !important;
  background-color: #374151 !important;
  box-shadow: 0 4px 12px rgba(55, 65, 81, 0.24);
}
