
/* ===== v63: the Dark Lord's vision ===== */
.dl { position: fixed; inset: 0; z-index: 99990; background: #000; overflow: hidden; opacity: 0; transition: opacity .9s; font-family: var(--font-display); }
.dl.in { opacity: 1; } .dl.out { opacity: 0; transition: opacity .7s; }
.dl-s1, .dl-s2 { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s; }
.dl.s1 .dl-s1 { opacity: 1; }
.dl-throne { width: 100%; height: 100%; display: block; }
.dl-halo2 { opacity: 0; transition: opacity 2s; mix-blend-mode: screen; }
.dl.charge .dl-halo2 { opacity: .9; }
.dl-fire { animation: dlFire .35s infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes dlFire { from { transform: scaleY(.85) skewX(-4deg); opacity: .8; } to { transform: scaleY(1.08) skewX(4deg); opacity: 1; } }
.dl-eyes { opacity: 0; transition: opacity 1.2s; }
.dl.eyes .dl-eyes { opacity: 1; animation: dlBlink 5s 1.6s infinite; }
@keyframes dlBlink { 0%, 46%, 50%, 100% { opacity: 1; } 48% { opacity: .05; } }
.dl.laugh .dl-head, .dl.laugh .dl-lord > path:nth-child(2) { animation: dlLaugh .26s infinite alternate; }
@keyframes dlLaugh { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.dl-arm { transform-box: view-box; transform-origin: 905px 420px; transition: transform 1.6s cubic-bezier(.6,-0.25,.3,1.2); }
.dl.raise .dl-arm { transform: rotate(-168deg); }
.dl-blade-glow { opacity: 0; transition: opacity 1.4s; }
.dl-tip { opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; transition: opacity 1s, transform 1.4s; transform: scale(.3); }
.dl.charge .dl-blade-glow { opacity: .85; } .dl.charge .dl-tip { opacity: 1; transform: scale(1.6); animation: dlPulse .18s infinite alternate; }
@keyframes dlPulse { from { filter: brightness(1); } to { filter: brightness(1.5); } }
.dl-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 30%, #fff8ea, #ff6a3a 40%, #8a0a06 80%); opacity: 0; pointer-events: none; }
.dl.flash .dl-flash { animation: dlFlash 1.6s forwards; }
@keyframes dlFlash { 0% { opacity: 0; } 12% { opacity: 1; } 45% { opacity: 1; } 100% { opacity: 0; } }
.dl.charge .dl-s1 { animation: dlShake .12s infinite; }
@keyframes dlShake { 0% { transform: translate(0,0); } 50% { transform: translate(2px,-2px); } 100% { transform: translate(-2px,1px); } }
.dl-s2 { background-size: cover; background-position: center 70%; }

.dl.s2 .dl-s2 { animation: dlPan 14s linear forwards; opacity: 1; transition: opacity .2s; }
@keyframes dlPan { from { background-position: 46% 70%; } to { background-position: 54% 70%; } }
.dl-rift { position: absolute; left: 50%; top: 4%; width: 22vh; height: 34vh; transform: translateX(-50%) scale(.2, 0); border-radius: 50%;
  background: radial-gradient(ellipse, #fff0d0 0%, #ff4a1a 30%, #6a0a08 65%, transparent 72%); filter: blur(2px); opacity: 0; transition: transform .5s, opacity .5s; }
.dl.s2 .dl-rift { opacity: 1; transform: translateX(-50%) scale(1, 1); }
.dl.landed .dl-rift { opacity: 0; transform: translateX(-50%) scale(.6, .05); transition: transform 1.4s, opacity 1.4s; }
.dl-hero { position: absolute; left: 50%; bottom: 13%; width: 30vh; height: 36vh; transform: translate(-50%, -140vh); opacity: 0; }
.dl-hero .sprite { position: absolute; inset: 0; }
.dl.fall .dl-hero { opacity: 1; transform: translate(-50%, 0); transition: transform .9s cubic-bezier(.55,0,1,.6); }
.dl.landed .dl-hero { animation: dlLand .5s; }
@keyframes dlLand { 0% { transform: translate(-50%, 0) scale(1.08, .86); } 100% { transform: translate(-50%, 0) scale(1, 1); } }
.dl-dust { position: absolute; left: 50%; bottom: 11%; width: 50vh; height: 8vh; transform: translateX(-50%) scale(.2); border-radius: 50%; background: radial-gradient(ellipse, rgba(120,70,70,.8), transparent 70%); opacity: 0; }
.dl.landed .dl-dust { animation: dlDust 1.4s forwards; }
@keyframes dlDust { 0% { opacity: .9; transform: translateX(-50%) scale(.3); } 100% { opacity: 0; transform: translateX(-50%) scale(1.6, 1.2); } }
.dl-skyeyes { position: absolute; left: 50%; top: 5%; width: 46vh; transform: translateX(-50%); opacity: 0; transition: opacity 2.5s; filter: drop-shadow(0 0 18px #ff2a0a); }
.dl.skyeyes .dl-skyeyes { opacity: .7; animation: dlBlink 4s 2s infinite; }
.dl-sub { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); width: min(90vw, 900px); text-align: center; color: #f0d8cc; font-size: clamp(18px, 3.2vh, 32px);
  font-style: italic; letter-spacing: .02em; text-shadow: 0 0 12px #000, 0 0 24px #5a0a06, 0 2px 0 #000; opacity: 0; transition: opacity .5s; min-height: 1.4em; }
.dl-sub.show { opacity: 1; }
.dl.black .dl-s2, .dl.black .dl-s1 { opacity: 0 !important; transition: opacity 1.4s; }
.dl-end { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #e9dcc0; opacity: 0; transition: opacity 1.6s; pointer-events: none; }
.dl-end small { font: italic 400 clamp(14px, 2.2vh, 20px) var(--font-display); color: #a89888; }
.dl-end h1 { margin: 14px 0 10px; font-size: clamp(34px, 7vh, 72px); letter-spacing: .08em; color: #d23a24; text-shadow: 0 0 28px rgba(210,40,20,.55); }
.dl-end p { margin: 0; font-size: clamp(15px, 2.4vh, 22px); letter-spacing: .2em; text-transform: uppercase; color: #c9b8a6; }
.dl.end .dl-end { opacity: 1; }
.dl-again { text-align: center; margin: 4px 0 0; }

.sprite.debuffed img { filter: drop-shadow(0 0 14px rgba(200,60,110,0.9)) drop-shadow(0 6px 10px rgba(0,0,0,0.55)) saturate(0.7); }
.floater.debuff { color: #ff8fb0; font-size: 20px; }
.floater.stun, .floater.stunned { color: #ffe27a; font-size: 22px; }
.spec-box { margin: 6px 0 14px; padding: 14px; border-radius: 14px; border: 1px solid #6b5a2a; background: rgba(243,213,140,0.06); }
.spec-box h3 { margin: 0 0 4px; font-family: var(--font-display); color: var(--gold-2); }
.spec-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.spec-opt { flex: 1 1 150px; max-width: 220px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; font: inherit; transition: transform .15s, border-color .15s; }
.spec-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold-2); }
.spec-opt .spec-ico { font-size: 28px; } .spec-opt b { color: var(--gold-2); } .spec-opt small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.spec-opt.chosen { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(243,213,140,0.35); }
.spec-opt:disabled:not(.chosen) { opacity: 0.45; cursor: default; }
.status.hexed { background: #231c17; border-color: #9a4f9a; color: #f0c8f0; cursor: help; }
.kw.hex { color: #e6a8ff; }
.vfx.orb.hexbolt { width: 22px; height: 22px; background: radial-gradient(circle, #fff 0%, var(--c) 45%, transparent 72%); box-shadow: 0 0 16px 4px var(--c); }

/* keyword help: card panels, tap bubble, guide */
.card .kw-panel { display: none; position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); width: 220px; z-index: 70; pointer-events: none;
  flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: #18130e; border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left; }
.card .kw-panel div { font: 400 11.5px/1.4 var(--font-body); color: var(--muted); }
.card .kw-panel b { display: block; color: var(--gold-2); font-size: 12px; }
/* keywords are explained once, in the panel beside the card (tooltips.js .kw-pop); the panel above the card stays hidden */
.pile-grid .card { cursor: pointer; }
.tip-bubble { position: fixed; z-index: 200; max-width: 260px; padding: 9px 11px; border-radius: 10px; background: #18130e; border: 1px solid var(--gold-2); box-shadow: var(--shadow);
  font: 400 12.5px/1.45 var(--font-body); color: var(--text); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.tip-bubble.show { opacity: 1; transform: none; }
.tip-bubble b { display: block; color: var(--gold-2); margin-bottom: 2px; }
.card-info { display: flex; gap: 18px; align-items: flex-start; justify-content: center; flex-wrap: wrap; text-align: left; }
.card-info .card.big { --card-w: 170px; --card-h: 240px; margin: 8px 10px 4px; }
.card-info .card.big .card-text { font-size: 13px; }
.card-info .card.big .kw-panel { display: none !important; }
.card-info .kw-list { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; }
.kw-row { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.kw-row > span { font-size: 18px; line-height: 1.2; }
.kw-row b { display: block; color: var(--gold-2); font-size: 13.5px; }
.kw-row small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.glossary { text-align: left; max-height: calc(62 * var(--hvh)); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.glossary h3 { margin: 10px 0 2px; font-family: var(--font-display); color: var(--gold-2); font-size: 16px; }
.block-badge { cursor: help; }
.hand .card { -webkit-touch-callout: none; user-select: none; }
/* hero art on the class select */
.class-card .class-portrait { height: 150px; display: flex; justify-content: center; align-items: flex-end; margin: -6px 0 2px; border-radius: 12px; background: radial-gradient(ellipse at 50% 85%, rgba(243,213,140,0.18), transparent 65%); }
.class-card .class-portrait img { max-height: 100%; max-width: 100%; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.6)); }
.class-card.locked .class-portrait img { filter: grayscale(1) brightness(0.35); }

@media (max-width: 860px) {
  .arena.stage { grid-template-columns: 1fr 1fr; padding: 40px 8px 26px; min-height: 330px; }
  .stage .portrait-wrap { width: 100%; max-width: 230px; height: 200px; }
  #enemyPanel.final .portrait-wrap, #enemyPanel.big .portrait-wrap { max-width: 280px; height: 220px; }
  .log-box { width: min(260px, 70%); bottom: 4px; }
}
@media (max-width: 480px) {
  .arena.stage { min-height: 300px; padding-top: 38px; }
  .stage .portrait-wrap { height: 165px; }
  #enemyPanel.final .portrait-wrap, #enemyPanel.big .portrait-wrap { height: 175px; }
  .stage .plate { padding: 4px 6px 5px; }

  .stage .combatant .name { font-size: 13px; }
  .stage .intent { font-size: 12px; padding: 5px 9px; min-height: 32px; }
  .stage .intent-spacer { min-height: 32px; }
  .stage .floater { font-size: 26px; }
  .class-card .class-portrait { height: 110px; }
}

/* Published build: one deliberate dark look, touch-friendly */
:root { color-scheme: dark; --hvw: calc(1vw / var(--skz, 1)); --hvh: calc(1vh / var(--skz, 1)); --hdvh: calc(1dvh / var(--skz, 1)); --font-display: "GameDisplay", Georgia, "Times New Roman", serif; --font-body: "GameBody", system-ui, -apple-system, "Segoe UI", sans-serif; --bg: #0f0c0a; --bg-2: #19140f; --panel: #221b15; --panel-2: #2d241c; --line: #4a3c2c; --gold: #c9a052; --gold-2: #ecd39a; --text: #f1e8d8; --muted: #b3a48c; --hp: #d64545; --hp-2: #ff6b5e; --hp-bg: #3a1c24; --block: #5b9bd5; --block-2: #8cc4ff; --energy: #f0b429; --attack-2: #e0685c; --skill-2: #52c2a3; --shadow: 0 10px 30px rgba(0, 0, 0, 0.45); --radius: 14px; }
html, body { background: var(--bg); }
@media (hover: none) {
  .hand .card:hover:not(.unplayable) { transform: translateY(var(--lift)) rotate(var(--rot)); box-shadow: 0 8px 18px rgba(0,0,0,0.5); z-index: auto; }
  .card.selectable:hover, .class-card:hover, .pile:hover, .gear-slot:hover, button.relic-tile:hover:not(:disabled), .option-card:hover:not(:disabled) { transform: none; }
  [data-tip]:hover::after { display: none; }
}
.hand .card:active:not(.unplayable) { transform: translateY(-14px) scale(1.04); }
.dl-continue { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); z-index: 3; padding: 11px 26px; border-radius: 6px; cursor: pointer;
  border: 2px solid #8a2a1f; background: rgba(20,8,6,.85); color: #e9dcc0; font: 600 15px var(--font-body); letter-spacing: .08em;
  opacity: 0; visibility: hidden; transition: opacity .8s, visibility .8s; }
.dl.done .dl-continue { opacity: 1; visibility: visible; animation: dlContinuePulse 2.4s ease-in-out .8s infinite; }
.dl-continue:hover { background: #3a120c; }
@keyframes dlContinuePulse { 0%, 100% { box-shadow: 0 0 0 rgba(210,58,36,0); } 50% { box-shadow: 0 0 18px rgba(210,58,36,.55); } }
/* shown only once the dragon has been slain */
.dl-skip { position: absolute; right: 3%; top: 4%; z-index: 4; padding: 7px 16px; border-radius: 5px; cursor: pointer; background: rgba(20,12,9,.7); color: #eadfc4;
  border: 1.5px solid rgba(234,223,196,.5); font: 600 14px var(--font-ui, sans-serif); letter-spacing: .04em; opacity: .75; transition: opacity .2s; }
.dl-skip:hover { opacity: 1; } .dl.done .dl-skip { display: none; }
