:root {
  --bg-primary: #09111b;
  --bg-secondary: #101a29;
  --bg-card: rgba(14, 24, 38, 0.84);
  --bg-card-soft: rgba(255, 255, 255, 0.04);
  --bg-glass: rgba(13, 22, 34, 0.78);
  --bg-glass-dark: rgba(7, 12, 22, 0.88);

  --accent-primary: #ff9b52;
  --accent-primary-rgb: 255, 155, 82;
  --accent-hover: #ffb67d;
  --accent-glow: rgba(255, 155, 82, 0.28);

  --accent-green: #4ed7a2;
  --accent-green-rgb: 78, 215, 162;
  --accent-green-glow: rgba(78, 215, 162, 0.24);

  --accent-red: #ff6d6d;
  --accent-red-rgb: 255, 109, 109;
  --accent-red-glow: rgba(255, 109, 109, 0.22);

  --accent-gold: #f3c168;
  --accent-gold-rgb: 243, 193, 104;
  --accent-cyan: #73dce8;

  --text-primary: #f7fbff;
  --text-secondary: #b9c7d8;
  --text-muted: #73849a;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --font-display: "Fraunces", Georgia, serif;
  --font-main: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", monospace;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 34px;
  --radius-full: 999px;

  --shadow-sm: 0 16px 34px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 24px 60px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.36);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 220ms var(--ease-out);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--text-primary);
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 155, 82, 0.1), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(115, 220, 232, 0.1), transparent 30%),
    radial-gradient(circle at 58% 82%, rgba(78, 215, 162, 0.08), transparent 28%),
    linear-gradient(160deg, #07111a 0%, #0d1724 45%, #09111b 100%);
  overflow-x: hidden;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(circle at center, black 32%, transparent 84%);
  opacity: 0.24;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  max-width: 100%;
}

button {
  cursor: pointer;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.topbar,
.topbar-left,
.topbar-right,
.topbar-center,
.main-content,
.hero-board,
.game-layout,
.game-controls,
.result-panel,
.live-feed,
.my-history,
.drop-board,
.modal-content,
.mission-card,
.focus-card,
.feed-item {
  min-width: 0;
}

.brand-block,
.balance-display,
.user-info,
.feed-user,
.feed-amount,
.feed-profit,
.mission-card,
.result-message,
.modal-hint,
.pf-result {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mono {
  font-family: var(--font-mono);
}

.accent {
  color: var(--accent-primary);
}

.glass,
.glass-dark,
.mission-card,
.focus-card,
.feed-item,
.hero-step {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.glass,
.mission-card,
.focus-card,
.feed-item,
.hero-step {
  background: linear-gradient(180deg, rgba(18, 30, 45, 0.92), rgba(10, 17, 27, 0.84));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-dark {
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.96), rgba(7, 11, 18, 0.88));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass::before,
.glass-dark::before,
.mission-card::before,
.focus-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.04));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-weight: 700;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal), background var(--transition-normal);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), color-mix(in srgb, var(--accent-primary) 72%, white));
  color: #1c1108;
  box-shadow: 0 14px 34px var(--accent-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-compact {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.btn-glow .btn-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-140%);
  animation: shine 3.2s linear infinite;
}

@keyframes shine {
  0% { transform: translateX(-140%); }
  18% { transform: translateX(140%); }
  100% { transform: translateX(140%); }
}

.btn-roll {
  width: 100%;
  min-height: 62px;
  font-size: 1.08rem;
  letter-spacing: 0.03em;
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.btn-sm:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
}

.input-label,
.control-label,
.pf-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
}

.input-group {
  margin-bottom: 16px;
}

.input-field {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  background: var(--bg-glass-dark);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  outline: none;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
}

.input-field:focus {
  border-color: rgba(var(--accent-primary-rgb), 0.42);
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.14);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(5, 10, 16, 0.92);
  z-index: 999;
}

.auth-card {
  width: min(100%, 480px);
  padding: 34px;
  border-radius: var(--radius-xl);
}

.auth-head {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
  text-align: center;
}

.auth-logo {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.logo-dice {
  font-size: 3rem;
  filter: drop-shadow(0 0 18px var(--accent-glow));
}

.auth-logo h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 3.8rem);
  line-height: 0.95;
}

.auth-subtitle {
  color: var(--accent-cyan);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-helper {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
}

.auth-tab {
  min-height: 44px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
}

.auth-tab.active {
  background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.28), rgba(115, 220, 232, 0.14));
  color: var(--text-primary);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.auth-form .btn {
  width: 100%;
}

.auth-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--accent-red);
  font-size: 0.86rem;
  text-align: center;
}

.referral-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(var(--accent-primary-rgb), 0.26);
  background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.14), rgba(115, 220, 232, 0.08));
}

.referral-copy {
  display: grid;
  gap: 2px;
}

.referral-label {
  color: var(--accent-cyan);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.referral-copy strong {
  font-family: var(--font-mono);
}

.referral-note {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.topbar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px 18px;
  border-radius: 24px;
}

.topbar-left,
.topbar-right,
.topbar-center,
.top-pills,
.hero-actions,
.hero-steps,
.quick-tip-row,
.bet-buttons,
.info-row,
.condition-toggle,
.assistant-grid,
.feed-list,
.history-list,
.deposit-amounts {
  display: flex;
  gap: 10px;
}

.topbar-left,
.topbar-right,
.brand-block,
.dropdown-stats {
  align-items: center;
}

.topbar-center {
  flex: 1;
  justify-content: center;
}

.logo-mini {
  font-size: 1.55rem;
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

.brand-block {
  display: grid;
  gap: 2px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

.brand-note {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.top-pills {
  flex-wrap: wrap;
  justify-content: center;
}

.top-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.top-pill-accent {
  background: rgba(var(--accent-primary-rgb), 0.16);
  border-color: rgba(var(--accent-primary-rgb), 0.24);
  color: var(--text-primary);
}

.balance-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
}

.balance-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.balance-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
}

.btn-deposit-small {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--accent-green);
  color: #081118;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 10px 20px var(--accent-green-glow);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-gold), #ffdca0);
  color: #241205;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.user-avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), color-mix(in srgb, var(--accent-primary) 54%, white));
  color: #2b1306;
  font-weight: 800;
  box-shadow: 0 10px 24px var(--accent-glow);
}

.dropdown {
  position: fixed;
  top: 98px;
  right: 16px;
  width: min(320px, calc(100vw - 24px));
  padding: 18px;
  border-radius: 24px;
  z-index: 120;
}

.dropdown-header,
.stat-item,
.drop-board-head,
.mission-topline,
.mission-meta,
.mission-foot,
.panel-head-inline,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dropdown-header span:first-child {
  font-weight: 700;
}

.dropdown-level {
  color: var(--accent-gold);
  font-size: 0.78rem;
  font-weight: 700;
}

.xp-bar-container {
  position: relative;
  height: 8px;
  margin: 14px 0 26px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.xp-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  transition: width 0.4s var(--ease-out);
}

.xp-label {
  position: absolute;
  left: 0;
  top: 14px;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.dropdown-stats {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.stat-val {
  font-family: var(--font-mono);
  font-weight: 700;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  font-weight: 600;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.dropdown-item.danger:hover {
  background: rgba(var(--accent-red-rgb), 0.12);
  color: #ffc0c0;
}

.main-content {
  width: min(1320px, calc(100vw - 28px));
  margin: 0 auto;
  padding-top: 112px;
  padding-bottom: 40px;
  position: relative;
  z-index: 1;
}

.hero-board,
.drop-board,
.game-controls,
.result-panel,
.live-feed,
.my-history,
.modal-content {
  border-radius: var(--radius-xl);
}

.hero-board {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-bottom: 22px;
  padding: 24px;
}

.hero-copy {
  display: grid;
  gap: 18px;
}

.hero-kicker,
.panel-kicker,
.drop-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-cyan);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-title,
.drop-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.95;
}

.hero-copy-text,
.panel-copy,
.drop-copy,
.focus-note,
.panel-footnote,
.mission-card p,
.mission-summary,
.feed-empty,
.modal-hint {
  color: var(--text-secondary);
}

.hero-copy-text {
  max-width: 58ch;
  font-size: 1rem;
}

.hero-steps {
  flex-wrap: wrap;
}

.hero-step {
  align-items: center;
  gap: 12px;
  min-width: 170px;
  padding: 14px 16px;
  border-radius: 18px;
}

.hero-step strong {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--accent-primary-rgb), 0.18);
  color: var(--accent-primary);
  font-weight: 800;
}

.hero-step span {
  font-size: 0.92rem;
  font-weight: 600;
}

.hero-actions {
  flex-wrap: wrap;
}

.context-banner,
.mission-summary,
.profit-display,
.info-block,
.mission-empty,
.pf-result {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
}

.context-banner {
  color: var(--text-secondary);
  line-height: 1.5;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(340px, calc(100vw - 24px));
}

.toast {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: rgba(9, 14, 22, 0.92);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.toast.success {
  border-color: rgba(var(--accent-green-rgb), 0.34);
}

.toast.error {
  border-color: rgba(var(--accent-red-rgb), 0.34);
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.focus-card {
  padding: 18px;
  border-radius: 22px;
  display: grid;
  gap: 8px;
}

.focus-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.focus-value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2vw, 2.4rem);
  line-height: 0.95;
}

.focus-text {
  font-size: 1.2rem;
  line-height: 1.15;
}

.game-layout {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.game-controls,
.result-panel,
.live-feed,
.my-history,
.drop-board {
  padding: 22px;
}

.game-controls {
  position: sticky;
  top: 106px;
}

.panel-head {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.panel-head h2,
.result-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 0.96;
}

.result-title {
  font-size: 1.5rem;
}

.quick-tip-row {
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tip-pill,
.mission-kicker,
.mission-tag,
.mission-status,
.mission-reward,
.tournament-tier-pill,
.tournament-tier-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.tip-pill {
  font-size: 0.84rem;
}

.control-group {
  margin-bottom: 18px;
}

.bet-input-row {
  align-items: stretch;
}

.bet-input-row .input-field {
  flex: 1;
  min-height: 54px;
  font-size: 1.14rem;
  font-weight: 700;
}

.bet-buttons {
  flex-wrap: wrap;
}

.slider {
  width: 100%;
  height: 8px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-green) var(--slider-percent, 50%), var(--accent-red) var(--slider-percent, 50%), var(--accent-red) 100%);
  border-radius: 999px;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff7ef;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 0 6px rgba(var(--accent-primary-rgb), 0.14);
}

.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff7ef;
  border: 3px solid var(--accent-primary);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.info-row {
  align-items: stretch;
}

.info-block {
  flex: 1;
  text-align: center;
}

.info-label,
.profit-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.info-value,
.profit-value {
  font-family: var(--font-mono);
  font-size: 1.08rem;
  font-weight: 700;
}

.info-value {
  color: var(--accent-primary);
}

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

.profit-value {
  color: var(--accent-green);
}

.condition-toggle {
  background: rgba(255, 255, 255, 0.04);
  padding: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
}

.condition-btn {
  flex: 1;
  min-height: 46px;
  padding: 0 14px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
}

.condition-btn.active {
  background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.28), rgba(115, 220, 232, 0.14));
  color: var(--text-primary);
}

.panel-footnote {
  margin: 12px 0 0;
  font-size: 0.82rem;
  text-align: center;
}

.game-result-area {
  display: grid;
  gap: 20px;
}

.result-number-container {
  display: grid;
  gap: 18px;
  margin-top: 4px;
}

.result-number {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 8vw, 5.2rem);
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
  transition: transform 0.3s var(--ease-bounce), color 0.2s var(--ease-out), text-shadow 0.2s var(--ease-out);
}

.result-number.win {
  color: var(--accent-green);
  text-shadow: 0 0 26px var(--accent-green-glow);
}

.result-number.lose {
  color: var(--accent-red);
  text-shadow: 0 0 24px var(--accent-red-glow);
}

.result-bar-container {
  padding: 0 4px;
}

.result-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-red);
}

.result-target-zone {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-green);
  transition: width var(--transition-normal), left var(--transition-normal);
}

.result-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 28px;
  border-radius: 999px;
  background: white;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.65);
  display: none;
}

.result-marker.visible {
  display: block;
}

.result-message {
  min-height: 28px;
  margin-top: 14px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
}

.result-message.win {
  color: var(--accent-green);
}

.result-message.lose {
  color: var(--accent-red);
}

.assistant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feed-title,
.history-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green-glow);
  animation: pulse 1.6s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.feed-list,
.history-list {
  flex-direction: column;
}

.feed-item {
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  animation: itemIn 0.24s var(--ease-out);
}

@keyframes itemIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-user,
.feed-amount,
.feed-profit {
  font-size: 0.82rem;
}

.feed-user {
  flex: 1;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-amount,
.feed-profit {
  font-family: var(--font-mono);
  font-weight: 700;
}

.feed-profit.win {
  color: var(--accent-green);
}

.feed-profit.lose {
  color: var(--accent-red);
}

.feed-empty {
  text-align: center;
  padding: 18px;
  font-size: 0.9rem;
}

.retention-zone {
  margin-top: 22px;
}

.retention-shell {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.retention-board {
  align-items: stretch;
}

.reward-zone {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.reward-explainer {
  display: grid;
  gap: 8px;
  padding: 18px 22px;
}

.reward-explainer strong {
  font-size: 1rem;
}

.reward-explainer span {
  color: var(--text-secondary);
  line-height: 1.55;
}

.drop-board {
  background:
    linear-gradient(145deg, rgba(12, 19, 30, 0.96), rgba(16, 25, 38, 0.84)),
    radial-gradient(circle at top right, rgba(var(--accent-primary-rgb), 0.16), transparent 34%);
}

.drop-board-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.drop-board-copy {
  max-width: 64ch;
}

.drop-title {
  font-size: clamp(1.7rem, 2.6vw, 2.8rem);
  margin-bottom: 8px;
}

.mission-summary {
  max-width: 330px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.mission-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.mission-card {
  padding: 18px;
  border-radius: 22px;
  display: grid;
  gap: 12px;
}

.mission-card.claimable {
  border-color: rgba(var(--accent-green-rgb), 0.24);
}

.mission-card.claimed {
  opacity: 0.88;
  border-color: rgba(var(--accent-gold-rgb), 0.2);
}

.mission-card h3 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
}

.mission-card p {
  margin: 0;
  font-size: 0.92rem;
  min-height: 42px;
}

.mission-kicker {
  color: var(--text-secondary);
}

.mission-reward {
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.mission-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.mission-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
}

.mission-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.mission-tag,
.mission-status {
  color: var(--text-secondary);
}

.mission-status.claimed {
  background: rgba(var(--accent-gold-rgb), 0.18);
  color: #f4d396;
}

.mission-claim-btn {
  min-height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-green), color-mix(in srgb, var(--accent-green) 70%, white));
  color: #07131a;
  font-weight: 800;
}

.retention-card {
  min-height: 100%;
}

.retention-progress {
  display: grid;
  gap: 10px;
}

.retention-progress-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.retention-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
}

.retention-progress-copy {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.retention-streak-row {
  display: grid;
  gap: 10px;
}

.retention-streak-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-weight: 700;
}

.retention-streak-pill.is-active {
  background: rgba(var(--accent-green-rgb), 0.16);
  color: var(--text-primary);
  border-color: rgba(var(--accent-green-rgb), 0.26);
}

.retention-streak-note {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.streak-card {
  background:
    linear-gradient(180deg, rgba(18, 30, 45, 0.92), rgba(10, 17, 27, 0.84)),
    radial-gradient(circle at top right, rgba(var(--accent-gold-rgb), 0.14), transparent 36%);
}

.mission-empty {
  text-align: center;
}

.tournament-shell {
  background:
    linear-gradient(145deg, rgba(13, 18, 29, 0.96), rgba(18, 17, 29, 0.84)),
    radial-gradient(circle at top left, rgba(var(--accent-gold-rgb), 0.16), transparent 34%);
}

.tournament-card {
  gap: 14px;
}

.tournament-window {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-gold);
}

.tournament-tier-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tournament-tier-pill.active {
  border-color: rgba(var(--accent-green-rgb), 0.26);
  background: rgba(var(--accent-green-rgb), 0.1);
  color: var(--text-primary);
}

.tournament-tier-note {
  padding: 0;
  border: none;
  background: transparent;
}

.tournament-standing {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.18);
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.tournament-standing strong {
  color: var(--text-primary);
}

.tournament-standing.ranked {
  border-color: rgba(var(--accent-green-rgb), 0.24);
}

.tournament-leaderboard {
  display: grid;
  gap: 8px;
}

.tournament-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
}

.tournament-row.me {
  border: 1px solid rgba(var(--accent-primary-rgb), 0.26);
  background: rgba(var(--accent-primary-rgb), 0.08);
}

.tournament-rank,
.tournament-score {
  font-family: var(--font-mono);
  font-weight: 700;
}

.tournament-user {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 9, 15, 0.72);
  backdrop-filter: blur(6px);
  z-index: 200;
}

.modal-content {
  width: min(100%, 560px);
  max-height: 86vh;
  overflow-y: auto;
  padding: 24px;
}

.modal-lg {
  width: min(100%, 720px);
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 1.35rem;
}

.modal-close:hover {
  background: rgba(var(--accent-red-rgb), 0.14);
  color: #ffd2d2;
}

.modal-body .btn {
  width: 100%;
}

.deposit-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.deposit-quick {
  min-height: 46px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 700;
}

.deposit-quick:hover {
  border-color: rgba(var(--accent-green-rgb), 0.28);
  color: var(--accent-green);
}

.pf-section {
  margin-bottom: 16px;
}

.pf-section h4 {
  margin: 0 0 12px;
  font-size: 0.98rem;
}

.pf-field {
  margin-bottom: 12px;
}

.pf-row {
  display: flex;
  gap: 8px;
}

.pf-row .input-field {
  flex: 1;
}

.pf-divider {
  margin: 16px 0;
  border: none;
  border-top: 1px solid var(--border-subtle);
}

.soft-divider {
  opacity: 0.35;
}

.pf-result {
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.history-table-container {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.history-table th {
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.history-table td {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.balance-value.updating {
  animation: balancePulse 0.3s var(--ease-bounce);
}

@keyframes balancePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes winFlash {
  0% { box-shadow: inset 0 0 0 rgba(var(--accent-green-rgb), 0); }
  50% { box-shadow: inset 0 0 90px rgba(var(--accent-green-rgb), 0.14); }
  100% { box-shadow: inset 0 0 0 rgba(var(--accent-green-rgb), 0); }
}

@keyframes loseFlash {
  0% { box-shadow: inset 0 0 0 rgba(var(--accent-red-rgb), 0); }
  50% { box-shadow: inset 0 0 90px rgba(var(--accent-red-rgb), 0.14); }
  100% { box-shadow: inset 0 0 0 rgba(var(--accent-red-rgb), 0); }
}

.game-controls.win-flash {
  animation: winFlash 0.55s ease;
}

.game-controls.lose-flash {
  animation: loseFlash 0.55s ease;
}

@media (max-width: 1120px) {
  .hero-board,
  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-controls {
    position: static;
  }

  .assistant-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
    min-height: 68px;
    padding: 12px 14px;
  }

  .topbar-center {
    display: none;
  }

  .brand-note,
  .level-badge {
    display: none;
  }

  .brand-name {
    max-width: min(36vw, 240px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-content {
    width: min(100vw - 16px, 100%);
    padding-top: 96px;
  }

  .drop-board-head {
    flex-direction: column;
  }

  .mission-summary {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 680px) {
  .topbar {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    border-radius: 22px;
  }

  .topbar-left {
    flex: 1 1 auto;
  }

  .topbar-right {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .main-content {
    padding-top: 132px;
  }

  .auth-card,
  .hero-board,
  .game-controls,
  .result-panel,
  .live-feed,
  .my-history,
  .drop-board,
  .modal-content {
    padding: 18px;
  }

  .hero-actions,
  .hero-steps,
  .quick-tip-row,
  .info-row {
    flex-direction: column;
  }

  .hero-step {
    min-width: 0;
    width: 100%;
  }

  .assistant-grid,
  .deposit-amounts,
  .focus-grid {
    grid-template-columns: 1fr;
  }

  .bet-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .bet-input-row {
    flex-direction: column;
  }

  .condition-toggle {
    flex-direction: column;
  }

  .hero-title,
  .drop-title {
    font-size: 2.1rem;
  }

  .deposit-amounts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal {
    padding: 12px;
  }

  .modal-content {
    width: 100%;
    max-height: calc(100dvh - 24px);
  }

  .toast-region {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }

  .btn,
  .btn-sm,
  .btn-compact {
    width: 100%;
  }

  .balance-display {
    flex: 1 1 auto;
    justify-content: space-between;
    padding-right: 8px;
  }

  .balance-label {
    display: none;
  }

  .balance-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-avatar {
    width: 34px;
    height: 34px;
  }

  .dropdown {
    top: 128px;
    right: 8px;
    left: 8px;
    width: auto;
  }
}

@media (max-width: 480px) {
  .topbar {
    top: 8px;
    left: 8px;
    right: 8px;
    padding: 10px;
  }

  .logo-mini {
    font-size: 1.32rem;
  }

  .brand-name {
    max-width: 50vw;
    font-size: 1rem;
  }

  .balance-display {
    padding: 7px 8px 7px 10px;
  }

  .auth-card {
    padding: 24px 18px;
  }

  .auth-logo h1 {
    font-size: 2.3rem;
  }

  .hero-title,
  .drop-title {
    font-size: 1.8rem;
  }

  .result-number {
    font-size: 2.7rem;
  }

  .pf-row {
    flex-direction: column;
  }

  .deposit-amounts {
    grid-template-columns: 1fr;
  }

  .history-table-container {
    overflow: visible;
  }

  .history-table {
    min-width: 0;
  }

  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table td {
    display: block;
    width: 100%;
  }

  .history-table thead {
    display: none;
  }

  .history-table tr {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
  }

  .history-table td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    text-align: right;
  }

  .history-table td:last-child {
    border-bottom: 0;
  }

  .history-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
  }

  .history-table td[colspan] {
    display: block;
    text-align: center;
  }

  .history-table td[colspan]::before {
    content: none;
  }
}

@media (max-width: 360px) {
  .brand-name {
    max-width: 44vw;
  }

  .btn-deposit-small {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.16);
}
