:root {
  --hf-bg: #080a09;
  --hf-panel: #111514;
  --hf-ink: #e9dcc3;
  --hf-muted: #9e9585;
  --hf-dim: #6c675d;
  --hf-gold: #b58a4a;
  --hf-gold-bright: #f0c879;
  --hf-gold-soft: #765a35;
  --hf-line: #514432;
  --hf-line-soft: rgba(153, 119, 67, .34);
  --hf-rare: #8ba1a1;
  --hf-epic: #ad82b6;
  --hf-special: #d3a253;
  --hf-sans: "Segoe UI", Arial, sans-serif;
  --hf-serif: Georgia, "Times New Roman", serif;
  --tier: var(--hf-rare);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--hf-bg); color: var(--hf-ink); font-family: var(--hf-sans); }
button { font: inherit; color: inherit; }

.dv { max-width: 1120px; margin: 0 auto; padding: 12px 16px 24px; }

.dv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px 12px; }
.dv-brand { display: flex; align-items: center; gap: 10px; }
.dv-seal { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--hf-line); border-radius: 50%; color: var(--hf-gold-bright); background: #14110c; }
.dv-seal svg { width: 18px; height: 18px; }
.dv-brand-name { display: block; font-family: var(--hf-serif); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.dv-brand-small { display: block; font-size: 11px; color: var(--hf-muted); letter-spacing: .08em; text-transform: uppercase; }
.dv-purse { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--hf-line-soft); border-radius: 999px; background: #0e100f; font-size: 14px; }
.dv-coin { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f4f1ea, #9fb0b8 55%, #4e5a60); box-shadow: 0 0 6px rgba(170, 200, 215, .45); }
.dv-purse-label { color: var(--hf-muted); font-size: 12px; }

.dv-tabs { display: flex; justify-content: center; gap: 6px; padding: 8px; border: 1px solid var(--hf-line-soft); border-bottom: 0; border-radius: 10px 10px 0 0; background: #0d0f0e; }
.dv-tab { padding: 7px 14px; border-radius: 6px; color: var(--hf-muted); text-decoration: none; font-size: 13px; }
.dv-tab[aria-current="page"] { color: var(--hf-gold-bright); background: #1b1710; box-shadow: inset 0 0 0 1px var(--hf-gold-soft); }

.dv-stage { position: relative; overflow: hidden; height: min(72vh, 640px); min-height: 520px; border: 1px solid var(--hf-line-soft); border-radius: 0 0 10px 10px; background: #050605; isolation: isolate; user-select: none; -webkit-tap-highlight-color: transparent; }
.dv-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dv-stage::before, .dv-stage::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; z-index: 1; }
.dv-stage::before { top: 0; height: 34%; background: linear-gradient(rgba(4, 5, 4, .82), rgba(4, 5, 4, 0)); transition: opacity .6s; }
.dv-stage::after { bottom: 0; height: 36%; background: linear-gradient(rgba(4, 5, 4, 0), rgba(4, 5, 4, .9)); }

.dv-intro, .dv-status, .dv-reveal, .dv-hint, .dv-actions, .dv-skip, .dv-board { position: absolute; z-index: 2; }

.dv-intro { top: 26px; left: 50%; width: min(560px, calc(100% - 32px)); transform: translateX(-50%); text-align: center; transition: opacity .5s, transform .5s; }
.dv-eyebrow { margin: 0 0 6px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--hf-gold); }
.dv-intro h1 { margin: 0; font-family: var(--hf-serif); font-weight: 400; font-size: clamp(28px, 4.4vw, 42px); color: #f1e6cf; text-shadow: 0 2px 18px rgba(0, 0, 0, .8); }
.dv-lead { margin: 8px auto 0; max-width: 440px; font-size: 14px; line-height: 1.55; color: #cfc2a8; text-shadow: 0 1px 8px #000; }

.dv-status { bottom: 92px; left: 50%; transform: translateX(-50%); margin: 0; width: calc(100% - 32px); text-align: center; font-family: var(--hf-serif); font-style: italic; font-size: 15px; color: #d8ccb2; text-shadow: 0 1px 10px #000; opacity: 0; transition: opacity .4s; }

.dv-actions { bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; transition: opacity .4s, transform .4s; }
.dv-btn { display: grid; gap: 1px; min-width: 168px; padding: 9px 18px; border: 1px solid var(--hf-line); border-radius: 8px; background: linear-gradient(#22231c, #151712); cursor: pointer; text-align: center; transition: border-color .2s, filter .2s; }
.dv-btn span { font-size: 15px; }
.dv-btn small { font-size: 11px; color: var(--hf-muted); }
.dv-btn:hover:not(:disabled) { border-color: var(--hf-gold); filter: brightness(1.12); }
.dv-btn:disabled { opacity: .55; cursor: wait; }
.dv-btn:focus-visible, .dv-skip:focus-visible, .dv-card:focus-visible { outline: 2px solid var(--hf-gold-bright); outline-offset: 2px; }
.dv-btn-gold { border-color: var(--hf-gold-soft); background: linear-gradient(#6d5330, #3e2e19); }
.dv-btn-gold small { color: #e0c99b; }

.dv-skip { top: 14px; right: 14px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--hf-line-soft); border-radius: 6px; background: rgba(8, 9, 8, .6); color: var(--hf-muted); font-size: 12px; cursor: pointer; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .3s; }

.dv-reveal { left: 50%; bottom: 58px; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); text-align: center; pointer-events: none; }
.dv-reveal > * { opacity: 0; transform: translateY(10px); transition: opacity .6s, transform .6s; }
.dv-reveal.on > * { opacity: 1; transform: none; }
.dv-reveal.on > :nth-child(2) { transition-delay: .08s; }
.dv-reveal.on > :nth-child(3) { transition-delay: .2s; }
.dv-reveal-kicker { margin: 0; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--tier); }
.dv-reveal h2 { margin: 4px 0 6px; font-family: var(--hf-serif); font-weight: 400; font-size: clamp(30px, 5vw, 44px); color: #f3e8d2; text-shadow: 0 0 24px color-mix(in srgb, var(--tier) 55%, transparent), 0 2px 10px #000; }
.dv-reveal-copy { margin: 0; font-family: var(--hf-serif); font-style: italic; font-size: 15px; line-height: 1.5; color: #d4c7ad; text-shadow: 0 1px 8px #000; }
.dv-hint { bottom: 18px; left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; color: var(--hf-dim); opacity: 0; transition: opacity .4s; pointer-events: none; }

.dv[data-tier="0"] { --tier: #aacdde; }
.dv[data-tier="1"] { --tier: #c692e2; }
.dv[data-tier="2"] { --tier: #f4bd5c; }

/* Состояния сцены */
.dv[data-stage="film"] .dv-intro, .dv[data-stage="reveal"] .dv-intro, .dv[data-stage="board"] .dv-intro { opacity: 0; transform: translate(-50%, -12px); pointer-events: none; }
.dv[data-stage="film"] .dv-stage::before, .dv[data-stage="reveal"] .dv-stage::before { opacity: .35; }
.dv[data-stage="film"] .dv-skip, .dv[data-stage="reveal"] .dv-skip { visibility: visible; opacity: 1; pointer-events: auto; }
.dv[data-stage="film"] .dv-actions, .dv[data-stage="reveal"] .dv-actions, .dv[data-stage="board"] .dv-actions { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.dv[data-stage="reveal"] .dv-hint.on { opacity: 1; }
.dv[data-stage="reveal"] .dv-stage { cursor: pointer; }

.dv-board { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 16px 16px; background: #0a0806 url("assets/table.webp") center / cover no-repeat; overflow: hidden; }
.dv-board[hidden] { display: none; }
.dv-board::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 46%, rgba(255, 190, 110, .16), transparent 34%), radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .55)); animation: dv-candle 3.2s ease-in-out infinite alternate; }
@keyframes dv-candle { from { opacity: .75; } to { opacity: 1; } }
.dv-board > * { position: relative; }
.dv-board-head { text-align: center; text-shadow: 0 2px 12px #000; }
.dv-board-head h2 { margin: 0; font-family: var(--hf-serif); font-weight: 400; font-size: 26px; color: #f1e6cf; }
.dv-ring { position: relative; flex: none; width: 300px; height: 300px; margin: auto 0; }
.dv-card { --c: #aacdde; position: absolute; left: var(--x); top: var(--y); width: 21%; padding: 0; border: 0; background: none; cursor: pointer; transform: translate(-50%, -50%) rotate(var(--rot)); opacity: 0; animation: dv-card-in .6s cubic-bezier(.18, .72, .25, 1) forwards; }
.dv-card[data-tier="1"] { --c: #c692e2; }
.dv-card[data-tier="2"] { --c: #f4bd5c; }
.dv-card img { position: relative; display: block; width: 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .7)); transition: transform .2s; }
/* Свечение — отдельный ореол: анимируется только яркость, цвет не меняется (переход цвета в drop-shadow Chrome смешивает с ошибкой). */
.dv-card::before { content: ""; position: absolute; left: 50%; top: 50%; width: 210%; height: 250%; border-radius: 50%; background: radial-gradient(closest-side, var(--c), color-mix(in srgb, var(--c) 45%, transparent) 55%, transparent); mix-blend-mode: screen; transform: translate(-50%, -50%) scale(.9); opacity: .55; transition: opacity .2s, transform .2s; pointer-events: none; }
.dv-card[data-tier="2"]::before { opacity: .85; }
.dv-card[aria-pressed="true"]::before { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
.dv-card[aria-pressed="true"] img { transform: scale(1.12); }
.dv-card-name { position: absolute; left: 50%; top: 100%; transform: translate(-50%, -2px) rotate(calc(var(--rot) * -1)); font-family: var(--hf-serif); font-size: 13px; color: #f1e6cf; white-space: nowrap; text-shadow: 0 1px 6px #000, 0 0 2px #000; opacity: 0; transition: opacity .2s; }
.dv-card[aria-pressed="true"] .dv-card-name, .dv-card:hover .dv-card-name { opacity: 1; }
@keyframes dv-card-in { from { opacity: 0; transform: translate(-50%, -30%) rotate(var(--rot)) scale(.85); } to { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot)); } }
.dv-board.single .dv-card { width: 46%; }
.dv-board.single .dv-card-name { display: none; }

.dv-detail { width: min(560px, 100%); padding: 10px 14px; border: 1px solid var(--hf-line-soft); border-radius: 8px; background: rgba(10, 9, 7, .82); text-align: center; }
.dv-detail-kicker { margin: 0; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--tier); }
.dv-detail h3 { margin: 2px 0 4px; font-family: var(--hf-serif); font-weight: 400; font-size: 22px; }
.dv-detail p:last-child { margin: 0; font-size: 14px; line-height: 1.5; color: #cbbfa6; }
.dv-board-actions { display: flex; gap: 10px; }

.dv-dev { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--hf-dim); }
.dv-dev select { margin-left: 6px; padding: 4px 6px; border: 1px solid var(--hf-line); border-radius: 6px; background: #121412; color: var(--hf-ink); }

@media (max-width: 640px) {
  .dv { padding: 8px 10px 16px; }
  .dv-purse-label, .dv-brand-small { display: none; }
  .dv-stage { height: calc(100svh - 150px); min-height: 540px; }
  .dv-actions { width: calc(100% - 24px); }
  .dv-btn { flex: 1; min-width: 0; padding: 9px 8px; }
  .dv-board-head h2 { font-size: 22px; }
  .dv-card { width: 24%; }
  .dv-card-name { font-size: 11px; }
  .dv-board-actions { width: 100%; }
  .dv-board-actions .dv-btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dv-card { animation-duration: .01s; }
  .dv-reveal > * { transition-duration: .01s; }
}
