/* ============================================================================
   The Arch Mage — board-game lounge hub / splash
   Brand-matched to the games: dark + carved, gold + rune-violet, low bloom.
   ============================================================================ */
:root {
  --gold: #e8c66a;
  --gold-deep: #b07e2c;
  --rune: #9d7bff;
  --rune-bright: #c4a8ff;
  --frost: #6fd0ff;
  --crimson: #ff3a4a;
  --bg: #08060f;
  --panel: rgba(14, 10, 28, 0.82);
  --panel-edge: rgba(157, 123, 255, 0.35);
  --text: #e9e3ff;
  --text-dim: #a99fce;
  --display: 'Cinzel', 'Spectral', Georgia, serif;
  --body: 'Spectral', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; min-height: 100%; }
body {
  font-family: var(--body);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------- ambient arcane background ---------------- */
.ambiance { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, #1a1140 0%, #0c0820 48%, #06040f 100%); }

/* slow-turning arcane sigil behind everything */
.amb-sigil {
  position: absolute; left: 50%; top: 42%; width: 130vmax; height: 130vmax;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side, rgba(157,123,255,0.10), transparent 70%),
    conic-gradient(from 0deg,
      transparent 0 8%, rgba(157,123,255,0.05) 9% 11%, transparent 12% 20%,
      rgba(232,198,106,0.04) 21% 22%, transparent 23%);
  -webkit-mask: radial-gradient(closest-side, #000 58%, transparent 72%);
          mask: radial-gradient(closest-side, #000 58%, transparent 72%);
  animation: sigilTurn 90s linear infinite;
  opacity: 0.7;
}
@keyframes sigilTurn { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* drifting glyph-dust (matches the games' tablet-dust) */
.amb-dust {
  position: absolute; inset: -10%;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 30%, rgba(232,198,106,0.85), transparent 60%),
    radial-gradient(1.6px 1.6px at 78% 16%, rgba(196,168,255,0.8), transparent 60%),
    radial-gradient(1.2px 1.2px at 40% 72%, rgba(255,255,255,0.65), transparent 60%),
    radial-gradient(1.6px 1.6px at 64% 54%, rgba(232,198,106,0.6), transparent 60%),
    radial-gradient(1.2px 1.2px at 26% 84%, rgba(157,123,255,0.6), transparent 60%),
    radial-gradient(1.6px 1.6px at 88% 78%, rgba(196,168,255,0.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 8% 58%, rgba(255,255,255,0.5), transparent 60%);
  animation: dustDrift 26s ease-in-out infinite alternate;
  opacity: 0.55;
}
@keyframes dustDrift {
  0%   { transform: translate3d(-1%, -0.5%, 0) scale(1.02); }
  100% { transform: translate3d(1.5%, 1%, 0) scale(1.06); }
}

.amb-vignette {
  position: absolute; inset: 0;
  box-shadow: inset 0 0 240px 60px rgba(0,0,0,0.7);
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.42) 100%);
}

/* ---------------- view switching ---------------- */
.view {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 22px;
  opacity: 0; transform: translateY(10px) scale(0.995);
  transition: opacity .5s ease, transform .5s ease;
}
.view.active { opacity: 1; transform: none; }
.view[hidden] { display: none; }

/* ---------------- shared obsidian-glass card (from the games' tablet) ---------------- */
.door-card {
  position: relative;
  width: min(680px, 94vw);
  padding: 46px 44px 40px;
  text-align: center;
  border: 1px solid rgba(204,172,118,0.32);
  border-radius: 20px;
  background: linear-gradient(158deg, rgba(30,21,54,0.82) 0%, rgba(15,10,30,0.88) 52%, rgba(9,6,20,0.92) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
          backdrop-filter: blur(16px) saturate(1.3);
  box-shadow:
    0 32px 80px rgba(0,0,0,0.62),
    0 0 72px rgba(120,80,220,0.30),
    inset 0 1px 0 rgba(255,240,210,0.20);
}
.door-card::after {                 /* gold inlay frame */
  content: ''; position: absolute; inset: 9px; border-radius: 13px;
  pointer-events: none;
  border: 1px solid rgba(232,198,106,0.22);
  box-shadow: inset 0 0 22px rgba(232,198,106,0.06);
}
.door-card > * { position: relative; z-index: 1; }

/* ---------------- splash wordmark ---------------- */
.emblem {
  font-size: 34px; color: var(--gold); line-height: 1; margin-bottom: 14px;
  text-shadow: 0 0 22px rgba(232,198,106,0.55);
  animation: emblemPulse 4.5s ease-in-out infinite;
}
@keyframes emblemPulse { 0%,100% { opacity: .8; } 50% { opacity: 1; text-shadow: 0 0 30px rgba(232,198,106,0.8); } }

.wordmark {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(27px, 5.2vw, 43px); letter-spacing: 2px; line-height: 1.04; text-wrap: balance;
  background:
    linear-gradient(115deg, transparent 38%, rgba(255,255,255,0.85) 48%, transparent 58%) 250% 0 / 250% 100% no-repeat,
    linear-gradient(180deg, #fffdf6 0%, #ffe7a8 44%, var(--gold) 72%, var(--gold-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.30)) drop-shadow(0 0 26px rgba(232,198,106,0.32));
  animation: sheen 7.5s ease-in-out infinite;
}
@keyframes sheen { 0%,64% { background-position: 250% 0, 50% 0; } 86%,100% { background-position: -150% 0, 50% 0; } }

.establishment {
  margin-top: 14px; font-family: var(--display); font-weight: 700;
  font-size: clamp(12px, 1.6vw, 15px); letter-spacing: 4px; text-transform: uppercase;
  color: var(--rune-bright);
}
.world-line {
  margin-top: 8px; font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--gold); opacity: 0.82; text-shadow: 0 0 10px rgba(232,198,106,0.3);
}
.world-line .vvx { color: var(--rune-bright); }
.flavor { margin-top: 18px; color: var(--text-dim); font-style: italic; font-size: 15px; letter-spacing: .5px; }

/* ---------------- ritual button (from the games' start-btn) ---------------- */
.ritual-btn {
  margin-top: 30px; padding: 15px 38px; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: 4px; text-transform: uppercase;
  color: #1c130a; border: 1px solid var(--gold); border-radius: 12px;
  background: linear-gradient(180deg, #ffe9ad 0%, var(--gold) 52%, var(--gold-deep) 100%);
  box-shadow: 0 0 26px rgba(232,198,106,0.42), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform .15s ease, box-shadow .25s ease, filter .2s ease;
}
.ritual-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 34px rgba(232,198,106,0.6); filter: brightness(1.05); }
.ritual-btn:active { transform: translateY(0); }
.ritual-btn:focus-visible { outline: 2px solid var(--rune-bright); outline-offset: 3px; }

/* ---------------- the bar ---------------- */
#bar { justify-content: flex-start; padding-top: clamp(64px, 9vh, 110px); }

.back-btn {
  position: fixed; top: 22px; left: 22px; z-index: 3; cursor: pointer;
  font-family: var(--display); font-size: 13px; letter-spacing: 2px;
  color: var(--text); background: rgba(20,15,38,0.7);
  border: 1px solid var(--panel-edge); border-radius: 10px; padding: 9px 15px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color .2s ease, color .2s ease, transform .15s ease;
}
.back-btn:hover { border-color: var(--gold); color: var(--gold); transform: translateX(-2px); }
.back-btn:focus-visible { outline: 2px solid var(--rune-bright); outline-offset: 3px; }

.bar-head { text-align: center; margin-bottom: 34px; }
.bar-title {
  font-family: var(--display); font-weight: 900; font-size: clamp(30px, 5vw, 46px);
  letter-spacing: 5px; text-transform: uppercase;
  background: linear-gradient(180deg, #fffdf6, var(--gold) 70%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(232,198,106,0.28));
}
.bar-sub { margin-top: 8px; color: var(--text-dim); font-style: italic; letter-spacing: 1px; }

/* table cards */
.tables {
  display: grid; gap: 20px; width: min(1040px, 96vw);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.table-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 30px 24px 26px; border-radius: 16px;
  border: 1px solid var(--panel-edge);
  background: linear-gradient(160deg, rgba(30,21,54,0.7), rgba(10,7,22,0.85));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,240,210,0.10);
  transition: transform .2s ease, border-color .2s ease, box-shadow .3s ease;
}
.table-card.open:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 40px rgba(232,198,106,0.22); }
.table-card.soon { opacity: 0.72; }

.tc-glyph { font-size: 46px; line-height: 1; color: var(--rune-bright); text-shadow: 0 0 20px rgba(157,123,255,0.5); }
.tc-name { margin-top: 12px; font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); }
.tc-mode { margin-top: 3px; font-family: var(--display); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--rune-bright); opacity: .85; }
.tc-blurb { margin-top: 12px; color: var(--text-dim); font-size: 14px; line-height: 1.5; min-height: 42px; }

.tc-status { margin-top: 14px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.tc-status.open { color: var(--frost); }
.tc-status.soon { color: var(--text-dim); }

.seat-btn {
  margin-top: 14px; width: 100%; padding: 13px 18px; cursor: pointer; display: inline-block;
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 3px; text-transform: uppercase;
  text-decoration: none; text-align: center; border-radius: 11px;
  color: #1c130a; border: 1px solid var(--gold);
  background: linear-gradient(180deg, #ffe9ad 0%, var(--gold) 52%, var(--gold-deep) 100%);
  box-shadow: 0 0 20px rgba(232,198,106,0.32), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform .15s ease, box-shadow .25s ease, filter .2s ease;
}
.seat-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(232,198,106,0.55); filter: brightness(1.05); }
.seat-btn:focus-visible { outline: 2px solid var(--rune-bright); outline-offset: 3px; }
.seat-btn.disabled {
  cursor: not-allowed; color: var(--text-dim);
  background: rgba(30,22,54,0.6); border-color: rgba(157,123,255,0.25);
  box-shadow: none;
}
.seat-btn.disabled:hover { transform: none; box-shadow: none; filter: none; }

.bar-foot { margin-top: 40px; color: var(--text-dim); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; opacity: .7; }

@media (max-width: 560px) {
  .door-card { padding: 36px 24px 30px; }
  .wordmark { letter-spacing: 3px; }
  .back-btn { top: 14px; left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .amb-sigil, .amb-dust, .emblem, .wordmark { animation: none; }
  .view { transition: none; }
}
