/* AURUM · fictional social casino demo · landscape-first PWA */

@font-face {
  font-family: "Cinzel";
  src: url("../assets/fonts/cinzel-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../assets/fonts/manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --onyx: #0a0a0f;
  --marble: #14141c;
  --marble-hi: #1d1d29;
  --gold: #d4af37;
  --gold-bright: #f6e27a;
  --gold-deep: #8a6d1f;
  --emerald: #17b877;
  --emerald-deep: #0b5e3e;
  --garnet: #b3383e;
  --ivory: #efe9dc;
  --ash: #9a94a6;

  --metal-gold: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 48%, var(--gold-deep) 100%);
  --edge-gold: 1px solid rgba(212, 175, 55, 0.28);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 28px rgba(0, 0, 0, 0.55);

  --font-display: "Cinzel", "Times New Roman", serif;
  --font-ui: "Manrope", system-ui, sans-serif;

  --topbar-h: clamp(46px, 7vh, 60px);
  --cell: clamp(56px, 17vh, 104px);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* sections use flex/grid displays, so the hidden attribute needs teeth */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  color: var(--ivory);
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(212, 175, 55, 0.10), transparent 55%),
    radial-gradient(90% 90% at 85% 110%, rgba(23, 184, 119, 0.05), transparent 60%),
    var(--onyx);
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.sprite-defs { position: absolute; width: 0; height: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- shared controls ---------- */

.gold-btn {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: clamp(0.85rem, 1.8vh, 1rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #241c05;
  background: var(--metal-gold);
  border: 1px solid var(--gold-deep);
  border-radius: 999px;
  padding: 0.65em 1.9em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 14px rgba(212, 175, 55, 0.25);
  transition: filter 0.15s, transform 0.1s;
}
.gold-btn:hover { filter: brightness(1.08); }
.gold-btn:active { transform: translateY(1px); }
.gold-btn:disabled { filter: grayscale(0.5) brightness(0.75); cursor: default; }
.gold-btn-small { padding: 0.5em 1.4em; font-size: 0.8rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: var(--edge-gold);
  background: var(--marble);
  color: var(--gold);
  cursor: pointer;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--marble-hi); }
.icon-btn svg { width: 20px; height: 20px; }

.link-btn {
  background: none;
  border: none;
  color: var(--ash);
  font: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--ivory); }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- topbar ---------- */

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(10px, 2vw, 24px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
  background: rgba(10, 10, 15, 0.7);
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: clamp(8px, 1.2vw, 14px); }

.back-btn { display: none; }
body[data-view="slot"] .back-btn { display: grid; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark { width: 26px; height: 26px; }
.brand-word {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.6vh, 1.35rem);
  letter-spacing: 0.34em;
  background: linear-gradient(100deg, var(--gold-deep) 0%, var(--gold) 30%, var(--gold-bright) 50%, var(--gold) 70%, var(--gold-deep) 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gold-sheen 2s ease-out 0.3s 1 both;
}
@keyframes gold-sheen {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}

.currency-switch {
  display: flex;
  border: var(--edge-gold);
  border-radius: 999px;
  background: var(--marble);
  overflow: hidden;
}
.cur-seg {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--ash);
  font-family: var(--font-ui);
  font-size: clamp(0.72rem, 1.7vh, 0.85rem);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cur-seg[aria-pressed="true"] { background: var(--marble-hi); color: var(--ivory); }
.cur-icon { width: 15px; height: 15px; }
.cur-icon-gc { color: var(--gold); }
.cur-icon-sc { color: var(--emerald); }
.cur-amount { font-weight: 800; font-variant-numeric: tabular-nums; }
.cur-code { font-weight: 600; font-size: 0.85em; opacity: 0.75; }
.cur-seg[aria-pressed="true"] .cur-code { color: var(--gold-bright); opacity: 1; }
.cur-seg#cur-sc[aria-pressed="true"] .cur-code { color: var(--emerald); }

.avatar { position: relative; }
.presence-dot {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--emerald);
  border: 2px solid var(--onyx);
}

/* ---------- lobby ---------- */

.app-main { height: calc(100dvh - var(--topbar-h)); }

.view-lobby {
  display: flex;
  height: 100%;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: clamp(8px, 1.6vh, 16px) 8px;
  border-right: 1px solid rgba(212, 175, 55, 0.14);
  width: clamp(64px, 13vw, 180px);
  flex-shrink: 0;
}
.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(7px, 1.4vh, 11px) 12px;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ash);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.rail-item svg { width: 21px; height: 21px; flex-shrink: 0; }
.rail-item:hover { color: var(--ivory); background: rgba(255, 255, 255, 0.03); }
.rail-item.is-active {
  color: var(--gold-bright);
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.10), transparent);
  border-radius: 0 8px 8px 0;
}

.lobby-scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.35) transparent;
  padding: clamp(10px, 2vh, 24px) clamp(12px, 2.4vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vh, 20px);
}

.lobby-featured {
  display: flex;
  gap: clamp(10px, 1.6vw, 18px);
}

.hero {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: var(--edge-gold);
  background:
    radial-gradient(90% 130% at 85% 20%, rgba(212, 175, 55, 0.22), transparent 55%),
    linear-gradient(120deg, var(--marble-hi), var(--marble) 65%);
  box-shadow: var(--card-shadow);
  padding: clamp(12px, 2.6vh, 26px) clamp(14px, 2vw, 28px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(3px, 0.8vh, 8px);
}
.hero-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vh, 2.4rem);
  line-height: 1.05;
  background: var(--metal-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--ash); font-size: clamp(0.75rem, 1.8vh, 0.9rem); }
.hero-play { margin-top: clamp(4px, 1vh, 10px); }
.hero-art {
  position: absolute;
  right: clamp(-20px, -1vw, 6px);
  bottom: -14%;
  width: clamp(110px, 22vh, 190px);
  height: clamp(110px, 22vh, 190px);
  opacity: 0.9;
  filter: drop-shadow(0 6px 24px rgba(212, 175, 55, 0.35));
  transform: rotate(8deg);
}

.daily-card {
  width: clamp(150px, 20vw, 220px);
  flex-shrink: 0;
  border-radius: var(--radius);
  border: 1px solid rgba(23, 184, 119, 0.35);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(23, 184, 119, 0.14), transparent 60%),
    var(--marble);
  box-shadow: var(--card-shadow);
  padding: clamp(10px, 2vh, 18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(2px, 0.7vh, 6px);
}
.daily-icon { width: clamp(20px, 4.5vh, 30px); height: clamp(20px, 4.5vh, 30px); color: var(--emerald); }
.daily-title {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 2vh, 1rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.daily-sub { color: var(--ash); font-size: clamp(0.7rem, 1.6vh, 0.82rem); font-weight: 600; }
.daily-card .gold-btn { margin-top: clamp(2px, 0.8vh, 8px); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 16px;
  border-radius: 999px;
  border: var(--edge-gold);
  background: transparent;
  color: var(--ash);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.chip:hover { color: var(--ivory); }
.chip.is-active { background: var(--metal-gold); color: #241c05; border-color: var(--gold-deep); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(108px, 13vw, 160px), 1fr));
  gap: clamp(8px, 1.4vw, 16px);
}
.game-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  border: var(--edge-gold);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10%;
  padding: 10% 6%;
  transition: transform 0.18s, border-color 0.18s;
}
.game-tile:hover { transform: translateY(-3px); border-color: rgba(246, 226, 122, 0.55); }
.game-tile.is-locked:hover { transform: none; border-color: rgba(212, 175, 55, 0.28); }
.art-gold {
  background: radial-gradient(100% 80% at 50% 20%, rgba(212, 175, 55, 0.20), transparent 60%), var(--marble);
}
.art-emerald {
  background: radial-gradient(100% 80% at 50% 20%, rgba(23, 184, 119, 0.16), transparent 60%), var(--marble);
}
.art-garnet {
  background: radial-gradient(100% 80% at 50% 20%, rgba(179, 56, 62, 0.18), transparent 60%), var(--marble);
}
.art-onyx {
  background: radial-gradient(100% 80% at 50% 20%, rgba(239, 233, 220, 0.07), transparent 60%), var(--marble);
}
.tile-art {
  width: 46%;
  height: 46%;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}
.tile-name {
  font-family: var(--font-display);
  font-size: clamp(0.62rem, 1.8vh, 0.85rem);
  letter-spacing: 0.05em;
  text-align: center;
  color: var(--ivory);
}
.tile-tag {
  position: absolute;
  top: 7px; right: 7px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(154, 148, 166, 0.4);
  color: var(--ash);
}
.tag-hot { background: var(--garnet); border-color: #701f2b; color: var(--ivory); }

.lobby-footer {
  margin-top: auto;
  padding-top: clamp(6px, 1.5vh, 14px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
  color: var(--ash);
  font-size: 0.72rem;
}
.lobby-footer a { color: var(--gold); }

/* ---------- slot view ---------- */

.view-slot {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: clamp(4px, 1vh, 12px);
  padding: clamp(6px, 1.4vh, 18px);
}

.slot-head { text-align: center; }
.slot-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4vh, 1.9rem);
  letter-spacing: 0.06em;
  background: var(--metal-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.slot-sub { color: var(--ash); font-size: clamp(0.68rem, 1.6vh, 0.82rem); }

.slot-cabinet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 1vh, 10px);
}

.slot-window {
  position: relative;
  display: flex;
  gap: clamp(6px, 1vh, 10px);
  padding: clamp(8px, 1.4vh, 14px);
  border-radius: calc(var(--radius) + 4px);
  border: 2px solid var(--gold-deep);
  background: linear-gradient(180deg, #060609, #101018);
  box-shadow:
    inset 0 0 0 1px rgba(246, 226, 122, 0.25),
    inset 0 10px 26px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(212, 175, 55, 0.12),
    0 14px 34px rgba(0, 0, 0, 0.6);
}
/* payline arrows */
.slot-window::before,
.slot-window::after {
  content: "";
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  border: 7px solid transparent;
  z-index: 3;
}
.slot-window::before { left: -3px; border-left-color: var(--gold-bright); }
.slot-window::after { right: -3px; border-right-color: var(--gold-bright); }

.reel {
  position: relative;
  width: var(--cell);
  height: calc(var(--cell) * 3);
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #0e0e15, #16161f 50%, #0e0e15);
  border: 1px solid rgba(212, 175, 55, 0.18);
}
/* shade top and bottom rows so the middle payline reads instantly */
.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(4, 4, 7, 0.72) 0%, rgba(4, 4, 7, 0.12) 30%,
    transparent 40%, transparent 60%,
    rgba(4, 4, 7, 0.12) 70%, rgba(4, 4, 7, 0.72) 100%);
}
.reel.is-anticipating {
  border-color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(246, 226, 122, 0.45);
}

.reel-strip { will-change: transform; }
.reel.is-spinning .reel-strip { filter: blur(1.4px); }

.reel-cell {
  width: var(--cell);
  height: var(--cell);
  display: grid;
  place-items: center;
}
.reel-cell svg { width: 64%; height: 64%; }
.reel-cell.is-winning svg { animation: win-pulse 0.45s ease-in-out 3; }
@keyframes win-pulse {
  50% { transform: scale(1.22); filter: drop-shadow(0 0 12px rgba(246, 226, 122, 0.9)); }
}

.win-readout {
  min-height: 1.4em;
  font-weight: 800;
  font-size: clamp(0.85rem, 2.2vh, 1.05rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}

.paytable-strip {
  display: flex;
  gap: clamp(10px, 1.8vw, 22px);
  color: var(--ash);
  font-size: clamp(0.68rem, 1.7vh, 0.8rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pay-item { display: flex; align-items: center; gap: 5px; }
.pay-item svg { width: clamp(15px, 2.6vh, 20px); height: clamp(15px, 2.6vh, 20px); }

.slot-controls {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.4vw, 28px);
}

.bet-box, .slot-balance {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: var(--edge-gold);
  background: var(--marble);
}
.bet-step {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: var(--edge-gold);
  background: var(--marble-hi);
  color: var(--gold-bright);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}
.bet-step:hover { background: #262635; }
.bet-step:disabled { opacity: 0.35; cursor: default; }
.bet-value, .slot-balance { text-align: center; }
.bet-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
}
.bet-amount {
  font-weight: 800;
  font-size: clamp(0.85rem, 2.2vh, 1rem);
  font-variant-numeric: tabular-nums;
}
.spin-btn { padding: 0.8em 2.6em; font-size: clamp(0.95rem, 2.4vh, 1.15rem); }

/* ---------- overlays ---------- */

.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: var(--onyx);
}
.rotate-icon { width: 56px; height: 56px; color: var(--gold); animation: rotate-hint 1.6s ease-in-out infinite; }
@keyframes rotate-hint {
  0%, 55%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-90deg); }
}
.rotate-title { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.08em; }
.rotate-copy { color: var(--ash); font-size: 0.85rem; max-width: 30ch; }
.rotate-legal { color: var(--ash); opacity: 0.7; font-size: 0.68rem; margin-top: 12px; }

@media (orientation: portrait) and (max-width: 700px) {
  .rotate-overlay { display: flex; }
}

.bigwin-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vh;
  background: rgba(10, 10, 15, 0.85);
  overflow: hidden;
}
.bigwin-overlay[hidden] { display: none; }
.bigwin-rays {
  position: absolute;
  inset: -60%;
  background: repeating-conic-gradient(from 0deg, rgba(212, 175, 55, 0.14) 0deg 9deg, transparent 9deg 24deg);
  animation: rays-turn 9s linear infinite;
}
@keyframes rays-turn { to { transform: rotate(360deg); } }
.bigwin-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 12vh, 5rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--metal-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 24px rgba(212, 175, 55, 0.55));
  z-index: 1;
}
.bigwin-amount {
  font-weight: 800;
  font-size: clamp(1.2rem, 5vh, 2rem);
  font-variant-numeric: tabular-nums;
  color: var(--ivory);
  z-index: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: clamp(12px, 4vh, 32px);
  translate: -50% 16px;
  z-index: 95;
  max-width: min(88vw, 420px);
  padding: 10px 18px;
  border-radius: 10px;
  border: var(--edge-gold);
  background: var(--marble-hi);
  color: var(--ivory);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, translate 0.25s;
}
.toast.is-visible { opacity: 1; translate: -50% 0; }

.coin-particle {
  position: fixed;
  z-index: 80;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold) 60%, var(--gold-deep));
  box-shadow: 0 0 6px rgba(246, 226, 122, 0.7);
  pointer-events: none;
}

.noscript-note { padding: 24px; text-align: center; color: var(--ash); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .rail { width: 56px; }
  .rail-item { justify-content: center; padding: 9px 0; }
  .rail-item span { display: none; }
}

@media (max-height: 480px) {
  :root { --cell: clamp(48px, 15.5vh, 72px); }
  .slot-sub { display: none; }
  .hero-art { display: none; }
  .cur-seg { padding: 4px 10px; }
  .win-readout { min-height: 1.1em; font-size: 0.8rem; }
  .bet-box, .slot-balance { padding: 4px 10px; }
  .spin-btn { padding: 0.6em 2.2em; }
}

/* in-game on very short screens: the reels are the header */
@media (max-height: 420px) {
  .slot-head { display: none; }
}

@media (max-width: 640px) {
  .lobby-featured { flex-direction: column; }
  .daily-card { width: 100%; flex-direction: row; justify-content: space-between; text-align: left; }
  .lobby-footer { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-word { animation: none; background-position: 50% 0; }
  .rotate-icon { animation: none; }
  .bigwin-rays { animation: none; }
  .reel-cell.is-winning svg { animation: none; filter: drop-shadow(0 0 10px rgba(246, 226, 122, 0.9)); }
  .game-tile, .gold-btn { transition: none; }
}
