:root {
  --gold: #e8c26a;
  --gold-l: #fff2c0;
  --gold-d: #9a6b22;
  --ink: #07060b;
  --panel: rgba(14, 11, 22, .82);
  --text: #efe6cf;
  --muted: #a99f88;
  --cream: #ece5d8;
  --slate: #3d4355;
  --fire: #ff7a3d;
  --water: #4fb8ff;
  --air: #6ff0c8;
  --earth: #f2b84b;
  --aether: #b98cff;
  --ready: #7dffcf;
  --danger: #ff5a4f;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --title: 'Cinzel', 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; user-select: none; -webkit-user-select: none; background: #050409; color: var(--text); font-family: var(--serif); }
button { font-family: inherit; color: inherit; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#stage { position: fixed; inset: 0; z-index: 1; }
#game { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; }

/* ----------------------------------------------------------- Bildschirme */

.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; animation: fadeIn .5s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.screen-head { position: absolute; top: 28px; left: 48px; right: 48px; display: grid; grid-template-columns: 220px 1fr 220px; align-items: center; }
.screen-head h2 { margin: 0; text-align: center; font-family: var(--title); font-weight: 700; font-size: 38px; letter-spacing: .12em; color: var(--gold-l);
  text-shadow: 0 0 18px rgba(232, 194, 106, .45); }
.screen-head h2::before, .screen-head h2::after { content: '✦'; font-size: 18px; color: var(--gold); margin: 0 20px; vertical-align: middle; }
.codex-hint { text-align: right; color: var(--muted); font-style: italic; font-size: 18px; }

/* Genshin-artige Pillen-Buttons */
.btn { position: relative; display: inline-flex; align-items: center; gap: 14px; min-width: 300px; height: 56px; padding: 0 34px 0 10px; border-radius: 28px;
  border: 2px solid rgba(232, 194, 106, .55); background: linear-gradient(180deg, #f4eee2, var(--cream)); color: var(--slate);
  font-family: var(--title); font-weight: 700; font-size: 19px; letter-spacing: .06em; cursor: pointer;
  box-shadow: 0 0 0 4px rgba(10, 8, 16, .65), 0 8px 24px rgba(0, 0, 0, .5); transition: transform .15s, box-shadow .2s, filter .2s; }
.btn i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-style: normal; font-size: 16px; color: var(--gold-l);
  background: radial-gradient(circle at 35% 30%, #4b5268, #262b3a); box-shadow: inset 0 0 0 2px rgba(232, 194, 106, .7); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 4px rgba(10, 8, 16, .65), 0 0 0 6px rgba(232, 194, 106, .6), 0 0 26px rgba(232, 194, 106, .45); }
.btn:active { transform: translateY(1px); }
.btn-main { background: linear-gradient(180deg, #fff6dc, #e9cf8f); }
.btn-small { min-width: 0; height: 42px; padding: 0 20px; font-size: 16px; }
.btn:disabled { filter: grayscale(1) brightness(.6); cursor: default; transform: none; }
.icon-btn { width: 46px; height: 46px; padding: 0; justify-content: center; font-size: 20px; }

/* ----------------------------------------------------------- Titel */

#screen-title { display: none; }
#screen-title.active { display: flex; align-items: center; justify-content: center; }
.title-sigil { position: absolute; left: 50%; top: 50%; width: 820px; height: 820px; margin: -410px 0 0 -410px; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 54%, rgba(232, 194, 106, .18) 54.3%, transparent 54.8%),
    radial-gradient(circle, transparent 63%, rgba(232, 194, 106, .12) 63.2%, transparent 63.6%),
    repeating-conic-gradient(from 0deg, rgba(232, 194, 106, .10) 0 .4deg, transparent .4deg 15deg),
    radial-gradient(circle, rgba(120, 80, 200, .18), transparent 60%);
  -webkit-mask: radial-gradient(circle, #000 66%, transparent 70%); mask: radial-gradient(circle, #000 66%, transparent 70%);
  animation: spin 160s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.title-wrap { position: relative; text-align: center; }
.title-pre { font-family: var(--title); color: var(--gold); letter-spacing: .3em; font-size: 15px; opacity: .85; }
.logo { margin: 6px 0 0; font-family: 'Cinzel Decorative', var(--title); font-weight: 900; font-size: 150px; letter-spacing: .08em; line-height: 1;
  background: linear-gradient(180deg, #fffbe8 10%, #f3cf7a 45%, #a8701f 80%, #f0c66a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(240, 198, 106, .45)) drop-shadow(0 4px 0 rgba(0, 0, 0, .6)); }
.title-sub { font-family: var(--title); font-size: 30px; letter-spacing: .5em; color: var(--gold-l); margin: 4px 0 50px; text-indent: .5em; }
.menu { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.title-foot { position: absolute; bottom: 30px; width: 100%; text-align: center; color: var(--muted); font-style: italic; font-size: 19px; }

/* ----------------------------------------------------------- Heldenwahl */

.hero-list { position: absolute; top: 120px; left: 0; right: 0; display: flex; justify-content: center; gap: 30px; }
.hero-card { position: relative; width: 330px; height: 560px; border-radius: 18px; cursor: pointer; overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 15, 30, .95), rgba(8, 6, 12, .98)); border: 2px solid rgba(232, 194, 106, .35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6); transition: transform .25s, box-shadow .25s, border-color .25s; }
.hero-card:hover { transform: translateY(-6px); border-color: rgba(232, 194, 106, .7); }
.hero-card.active { border-color: var(--gold-l); transform: translateY(-10px);
  box-shadow: 0 0 0 3px rgba(232, 194, 106, .5), 0 0 50px var(--el), 0 20px 50px rgba(0, 0, 0, .7); }
.hero-card .hc-art { height: 300px; background: var(--el-bg); position: relative; }
.hero-card .hc-art .art-svg { width: 100%; height: 100%; }
.hero-card .hc-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(8, 6, 12, 1)); }
.hero-card .hc-el { position: absolute; top: 16px; left: 16px; z-index: 2; padding: 4px 14px; border-radius: 14px; font-family: var(--title); font-size: 14px;
  color: var(--el); background: rgba(0, 0, 0, .55); border: 1px solid var(--el); letter-spacing: .1em; }
.hero-card .hc-stars { position: absolute; top: 16px; right: 16px; z-index: 2; color: var(--gold); text-shadow: 0 0 8px rgba(232, 194, 106, .8); letter-spacing: 2px; }
.hero-card .hc-body { padding: 0 24px; margin-top: -40px; position: relative; z-index: 2; }
.hero-card h3 { margin: 0; font-family: var(--title); font-size: 34px; color: var(--gold-l); letter-spacing: .06em; }
.hero-card .hc-title { color: var(--el); font-style: italic; font-size: 19px; margin-bottom: 12px; }
.hero-card .hc-style { font-size: 18px; line-height: 1.25; color: var(--text); min-height: 68px; }
.hero-card .hc-power { margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: rgba(232, 194, 106, .07); border: 1px solid rgba(232, 194, 106, .25); font-size: 17px; }
.hero-card .hc-power b { font-family: var(--title); color: var(--gold); font-size: 15px; letter-spacing: .05em; }
.select-foot { position: absolute; bottom: 44px; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 60px; }
.diff { display: flex; align-items: center; gap: 0; background: rgba(0, 0, 0, .5); border: 1px solid rgba(232, 194, 106, .4); border-radius: 26px; padding: 4px; }
.diff-label { font-family: var(--title); color: var(--muted); padding: 0 16px; font-size: 15px; letter-spacing: .1em; }
.seg { border: 0; background: transparent; color: var(--text); font-family: var(--title); font-size: 17px; padding: 10px 22px; border-radius: 22px; cursor: pointer; }
.seg.active { background: linear-gradient(180deg, #fff6dc, #e9cf8f); color: var(--slate); font-weight: 700; }

/* ----------------------------------------------------------- Kodex */

.tabs { position: absolute; top: 100px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.tab { border: 1px solid rgba(232, 194, 106, .35); background: rgba(10, 8, 16, .7); color: var(--text); font-family: var(--title); font-size: 15px;
  padding: 8px 18px; border-radius: 18px; cursor: pointer; }
.tab.active { background: linear-gradient(180deg, #fff6dc, #e9cf8f); color: var(--slate); font-weight: 700; }
.codex-grid { position: absolute; top: 160px; left: 40px; right: 40px; bottom: 20px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 26px 22px;
  justify-content: center; align-content: flex-start; padding: 16px 10px 40px; }
.codex-grid .card { --cw: 172px; cursor: pointer; transition: transform .2s; }
.codex-grid .card:hover { transform: translateY(-6px) scale(1.04); }
.codex-grid::-webkit-scrollbar { width: 10px; }
.codex-grid::-webkit-scrollbar-thumb { background: rgba(232, 194, 106, .35); border-radius: 5px; }

/* ----------------------------------------------------------- Elemente */

.suit-wands { --el: var(--fire); --el-bg: radial-gradient(circle at 50% 42%, #c44a1c 0%, #5a1709 45%, #1a0608 100%); }
.suit-cups { --el: var(--water); --el-bg: radial-gradient(circle at 50% 42%, #2273bd 0%, #0c2a58 48%, #050a1a 100%); }
.suit-swords { --el: var(--air); --el-bg: radial-gradient(circle at 50% 42%, #1f9583 0%, #0c4140 48%, #031413 100%); }
.suit-pentacles { --el: var(--earth); --el-bg: radial-gradient(circle at 50% 42%, #b07d22 0%, #4a330b 48%, #140d04 100%); }
.suit-major { --el: var(--aether); --el-bg: radial-gradient(circle at 50% 42%, #7243bd 0%, #2a1250 48%, #0c0618 100%); }
.suit-token { --el: #cfc6b4; --el-bg: radial-gradient(circle at 50% 42%, #5c5566 0%, #26222e 50%, #0c0a10 100%); }

/* ----------------------------------------------------------- Karte */

.card { --cw: 150px; position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); font-size: calc(var(--cw) / 15); border-radius: .75em;
  background: linear-gradient(165deg, #1e1729 0%, #0b0911 55%, #16101f 100%); color: var(--text); user-select: none;
  box-shadow: 0 .4em 1.2em rgba(0, 0, 0, .7); }
.card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: .16em; z-index: 4; pointer-events: none;
  background: linear-gradient(145deg, #fff2c0, #c9973f 28%, #6e4a17 52%, #e8c26a 78%, #fff2c0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.card::after { content: ''; position: absolute; inset: .42em; border-radius: .45em; border: 1px solid rgba(232, 194, 106, .28); pointer-events: none; }
.card.r5 { box-shadow: 0 .4em 1.2em rgba(0, 0, 0, .7), 0 0 1.2em rgba(185, 140, 255, .25); }

.c-art { position: absolute; left: .7em; right: .7em; top: .7em; height: 10.3em; border-radius: .5em .5em .2em .2em; overflow: hidden;
  background: var(--el-bg); box-shadow: inset 0 0 1.6em rgba(0, 0, 0, .85); }
.c-art .art-svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .5s; }
.card.rev .c-art .art-svg { transform: rotate(180deg); }
.card.rev .c-art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 35%, rgba(150, 30, 90, .45)); }
.c-num { position: absolute; top: .45em; left: 50%; transform: translateX(-50%); font-family: var(--title); font-weight: 700; font-size: .95em; color: var(--gold-l);
  padding: .05em .7em; border-radius: 1em; background: rgba(0, 0, 0, .55); border: 1px solid rgba(232, 194, 106, .5); z-index: 2; letter-spacing: .08em; }
.c-stars { position: absolute; bottom: .25em; left: 0; right: 0; text-align: center; font-size: .9em; letter-spacing: .1em; color: #ffd66b;
  text-shadow: 0 0 .4em rgba(255, 200, 80, .9), 0 0 .1em #000; z-index: 2; }

.c-name { position: absolute; left: .35em; right: .35em; top: 10.3em; height: 2em; display: flex; align-items: center; justify-content: center; z-index: 3;
  font-family: var(--title); font-weight: 700; font-size: 1em; color: var(--gold-l); text-shadow: 0 1px 2px #000; white-space: nowrap;
  background: linear-gradient(90deg, transparent, var(--banner, #2b3d63) 14%, var(--banner, #2b3d63) 86%, transparent);
  border-top: 1px solid rgba(232, 194, 106, .6); border-bottom: 1px solid rgba(232, 194, 106, .6); }
.card.r3 { --banner: #2a3c66; }
.card.r4 { --banner: #4e2f78; }
.card.r5 { --banner: #7a4d14; }
.c-name.long span { font-size: .84em; }
.c-name.xlong span { font-size: .74em; }
.c-title { position: absolute; top: 14.6em; left: 0; right: 0; text-align: center; font-style: italic; font-size: .85em; color: var(--muted); }
.c-orient { position: absolute; top: 19.9em; left: 0; right: 0; text-align: center; font-family: var(--title); font-size: .68em; letter-spacing: .12em; color: var(--gold); }
.c-orient.is-rev { color: #ff8fc4; }
.c-text { position: absolute; top: 14.6em; bottom: 2.3em; left: 1em; right: 1em; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 1em; line-height: 1.12; font-weight: 600; color: #f3ead6; }
.c-text.long > div { font-size: .9em; }
.c-text.xlong > div { font-size: .82em; }
.c-text b { color: var(--gold-l); font-weight: 700; }
.c-text b.sp { color: #7dffcf; }
.c-type { position: absolute; bottom: .55em; left: 0; right: 0; text-align: center; font-family: var(--title); font-size: .65em; letter-spacing: .2em; color: var(--muted); }

.c-cost { position: absolute; left: -.6em; top: -.6em; width: 3.2em; height: 3.2em; border-radius: 50%; display: grid; place-items: center; z-index: 5;
  background: radial-gradient(circle at 35% 30%, #4b78d6, #1a2e70 60%, #0b1440); box-shadow: 0 0 0 .18em #e8c26a, 0 0 0 .3em #3d2a0c, 0 .2em .6em rgba(0, 0, 0, .8); }
.c-cost span { font-family: var(--title); font-weight: 900; font-size: 1.75em; color: #fff; text-shadow: 0 0 .3em #8fd0ff, 0 1px 1px #000; }
.c-cost.cheaper span { color: #7dffcf; }
.c-cost.pricier span { color: #ff8f8f; }

.c-atk, .c-hp, .m-atk, .m-hp { position: absolute; display: grid; place-items: center; z-index: 5; }
.c-atk, .c-hp { bottom: -.55em; width: 3em; height: 3em; }
.c-atk { left: -.5em; }
.c-hp { right: -.5em; }
.c-atk span, .c-hp span, .m-atk span, .m-hp span { position: relative; z-index: 1; font-family: var(--title); font-weight: 900; color: #fff; text-shadow: 0 0 3px #000, 0 1px 1px #000; }
.c-atk span, .c-hp span { font-size: 1.6em; }
.c-atk::before, .m-atk::before { content: ''; position: absolute; inset: 12%; transform: rotate(45deg); border-radius: 18%;
  background: radial-gradient(circle at 35% 30%, #f6d58a, #b7811f 55%, #5c3a08); box-shadow: 0 0 0 2px #2a1a05, 0 .1em .4em rgba(0, 0, 0, .8); }
.c-hp::before, .m-hp::before { content: ''; position: absolute; inset: 8%; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: radial-gradient(circle at 35% 30%, #ff7d7d, #b51f2b 55%, #4f0710); box-shadow: 0 0 0 2px #2a0507, 0 .1em .4em rgba(0, 0, 0, .8); }

.card-back { position: relative; width: var(--cw, 90px); height: calc(var(--cw, 90px) * 1.4); border-radius: 8px;
  background: radial-gradient(circle at 50% 50%, #2a1748, #0d0718 70%); box-shadow: 0 4px 12px rgba(0, 0, 0, .7), 0 0 0 2px #6e4a17; }
.card-back .art-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ----------------------------------------------------------- Spielfeld */

#screen-board { background: radial-gradient(ellipse at 50% 50%, rgba(40, 26, 60, .55), rgba(5, 4, 9, .3) 70%); }
.board-deco .astro { position: absolute; left: 50%; top: 50%; border-radius: 50%; pointer-events: none; }
.astro.a1 { width: 1100px; height: 1100px; margin: -550px 0 0 -550px; border: 1px solid rgba(232, 194, 106, .07);
  background: repeating-conic-gradient(rgba(232, 194, 106, .05) 0 .3deg, transparent .3deg 10deg);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%, #000 63%, transparent 64%); mask: radial-gradient(circle, transparent 60%, #000 61%, #000 63%, transparent 64%);
  animation: spin 240s linear infinite; }
.astro.a2 { width: 760px; height: 760px; margin: -380px 0 0 -380px; border: 1px dashed rgba(232, 194, 106, .08); animation: spin 300s linear infinite reverse; }

.lane-bg { position: absolute; left: 270px; right: 270px; height: 186px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 14, 30, .55), rgba(10, 8, 16, .35)); border: 1px solid rgba(232, 194, 106, .14);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .5); }
.lane-bg.top { top: 214px; }
.lane-bg.bottom { top: 420px; }
.lane-bg.bottom.drop { border-color: rgba(232, 194, 106, .7); box-shadow: inset 0 0 50px rgba(232, 194, 106, .18); }
.divider { position: absolute; left: 300px; right: 300px; top: 405px; height: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(90deg, transparent, rgba(232, 194, 106, .55), transparent) center/100% 1px no-repeat; }
.divider span { color: var(--gold); font-size: 16px; text-shadow: 0 0 10px var(--gold); background: #0b0812; padding: 0 10px; }

.lane { position: absolute; left: 270px; right: 270px; height: 186px; display: flex; align-items: center; justify-content: center; }
.lane.top { top: 214px; }
.lane.bottom { top: 420px; }
.lane .empty-hint { color: rgba(232, 194, 106, .25); font-style: italic; font-size: 20px; letter-spacing: .1em; }

/* Diener */
.minion { position: relative; width: 112px; height: 150px; margin: 0 7px; border-radius: 16px 16px 12px 12px; isolation: isolate; cursor: default;
  transition: transform .18s ease, filter .2s; }
.minion .m-art { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: var(--el-bg); box-shadow: inset 0 0 20px rgba(0, 0, 0, .9); }
.minion .m-art .art-svg { position: absolute; left: -8%; width: 116%; top: 6%; height: 70%; }
.minion.rev .m-art .art-svg { transform: rotate(180deg); }
.minion.rev .m-art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, transparent 35%, rgba(150, 30, 90, .45)); }
.minion .m-frame { position: absolute; inset: 0; border-radius: inherit; padding: 3px; pointer-events: none; z-index: 2;
  background: linear-gradient(145deg, #fff2c0, #c9973f 28%, #6e4a17 52%, #e8c26a 78%, #fff2c0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.minion .m-name { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 34px; padding-top: 4px; border-radius: 0 0 10px 10px; z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(5, 3, 10, .92) 45%); text-align: center; font-family: var(--title); font-size: 10.5px; font-weight: 700;
  color: var(--gold-l); line-height: 1.05; display: flex; align-items: center; justify-content: center; padding-left: 26px; padding-right: 26px; }
.minion .m-icons { position: absolute; top: 6px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; z-index: 3; }
.minion .m-icons i { font-style: normal; font-size: 11px; min-width: 19px; height: 19px; padding: 0 3px; display: grid; place-items: center; border-radius: 10px;
  background: rgba(0, 0, 0, .7); border: 1px solid rgba(232, 194, 106, .6); color: var(--gold-l); font-family: var(--title); font-weight: 700; }
.m-atk, .m-hp { bottom: -10px; width: 38px; height: 38px; }
.m-atk { left: -10px; }
.m-hp { right: -10px; }
.m-atk span, .m-hp span { font-size: 19px; }
.m-atk.up span, .m-hp.up span { color: #7dffa0; }
.m-atk.down span { color: #ffb3b3; }
.m-hp.hurt span { color: #ff6b6b; }

.minion.taunt::before { content: ''; position: absolute; left: -12px; right: -12px; top: -14px; bottom: -12px; z-index: -1;
  clip-path: polygon(50% 0, 100% 10%, 100% 58%, 50% 100%, 0 58%, 0 10%);
  background: linear-gradient(180deg, #f8e2a0, #b98a2f 40%, #5a3b0c 80%); filter: drop-shadow(0 0 6px rgba(0, 0, 0, .8)); }
.minion.taunt .m-frame { padding: 4px; }
.m-veil { position: absolute; inset: -7px; border-radius: 22px; z-index: 4; pointer-events: none; border: 2px solid rgba(255, 244, 200, .85);
  background: radial-gradient(ellipse, transparent 55%, rgba(255, 230, 150, .25)); box-shadow: 0 0 18px rgba(255, 228, 150, .8), inset 0 0 18px rgba(255, 228, 150, .5);
  animation: veil 2.4s ease-in-out infinite; }
@keyframes veil { 50% { box-shadow: 0 0 28px rgba(255, 228, 150, 1), inset 0 0 26px rgba(255, 228, 150, .7); } }
.m-ice { position: absolute; inset: 0; border-radius: inherit; z-index: 3; pointer-events: none;
  background: linear-gradient(160deg, rgba(200, 240, 255, .55), rgba(90, 170, 230, .25) 50%, rgba(220, 250, 255, .5)); box-shadow: inset 0 0 0 3px rgba(200, 240, 255, .9); }
.m-chain { position: absolute; inset: 0; border-radius: inherit; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(45deg, transparent 0 14px, rgba(30, 20, 10, .55) 14px 18px, rgba(232, 194, 106, .5) 18px 20px, transparent 20px 34px); }
.m-zzz { position: absolute; top: -8px; right: 4px; z-index: 6; font-family: var(--title); font-weight: 700; color: var(--gold-l); font-size: 18px; text-shadow: 0 0 6px #000;
  animation: zzz 2s ease-in-out infinite; }
.m-zzz i { font-size: 13px; font-style: normal; margin-left: 2px; }
@keyframes zzz { 50% { transform: translateY(-5px); opacity: .6; } }
.minion.silenced .m-name { text-decoration: line-through; text-decoration-color: rgba(255, 120, 120, .7); }
.minion.can-attack { cursor: pointer; }
.minion.can-attack .m-frame { background: linear-gradient(145deg, #e6fff5, #7dffcf 40%, #2aa37e 70%, #c8ffe9); }
.minion.can-attack { filter: drop-shadow(0 0 10px rgba(125, 255, 207, .75)); }
.minion.attacking { filter: drop-shadow(0 0 16px rgba(255, 240, 190, .9)); z-index: 20; }
.minion.enter { animation: enter .55s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes enter { from { transform: scale(.4) translateY(-30px); opacity: 0; filter: brightness(3); } to { transform: none; opacity: 1; } }
.minion.hit, .hero.hit { animation: hit .35s ease; }
@keyframes hit { 20% { transform: translateX(-6px) rotate(-2deg); filter: brightness(2) saturate(.3); } 60% { transform: translateX(5px); } }

/* Zielauswahl */
.targetable { cursor: crosshair !important; }
.minion.targetable { filter: drop-shadow(0 0 12px rgba(255, 110, 80, .95)); }
.minion.targetable .m-frame { background: linear-gradient(145deg, #ffe0d0, #ff7a4f 40%, #a3281a 70%, #ffd2c2); }
.hero.targetable .h-ring { box-shadow: 0 0 0 4px rgba(255, 110, 80, .9), 0 0 30px rgba(255, 110, 80, .9); }
.minion.targetable:hover { transform: scale(1.06); }

/* Helden */
.hero-zone { position: absolute; left: 50%; width: 560px; margin-left: -280px; height: 150px; }
.hero-zone.top { top: 46px; }
.hero-zone.bottom { top: 618px; }
.hero { position: absolute; left: 210px; top: 0; width: 140px; height: 140px; }
.h-ring { position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(from 0deg, #fff2c0, #a8701f, #f0c66a, #6e4a17, #fff2c0, #a8701f, #f0c66a, #6e4a17, #fff2c0);
  box-shadow: 0 0 0 2px #1a1206, 0 8px 26px rgba(0, 0, 0, .8), 0 0 30px var(--el); }
.h-ring::after { content: ''; position: absolute; inset: -12px; border-radius: 50%; border: 1px dashed rgba(232, 194, 106, .45); animation: spin 40s linear infinite; }
.h-portrait { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: var(--el-bg); box-shadow: inset 0 0 26px rgba(0, 0, 0, .9); }
.h-portrait .art-svg { width: 100%; height: 100%; }
.h-hp, .h-armor { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; z-index: 3; }
.h-hp { right: -12px; bottom: -8px; }
.h-armor { right: -14px; bottom: 40px; width: 46px; height: 50px; }
.h-hp::before { content: ''; position: absolute; inset: 6%; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: radial-gradient(circle at 35% 30%, #ff7d7d, #b51f2b 55%, #4f0710); box-shadow: 0 0 0 2px #e8c26a, 0 0 0 4px #2a0507, 0 4px 10px rgba(0, 0, 0, .8); }
.h-armor::before { content: ''; position: absolute; inset: 0; clip-path: polygon(50% 0, 100% 14%, 92% 64%, 50% 100%, 8% 64%, 0 14%);
  background: linear-gradient(180deg, #f2f4f8, #8d96a8 55%, #3b4252); }
.h-hp span, .h-armor span { position: relative; font-family: var(--title); font-weight: 900; font-size: 22px; color: #fff; text-shadow: 0 0 3px #000, 0 1px 1px #000; }
.h-armor span { color: #1d2230; text-shadow: none; font-size: 19px; }
.h-hp.hurt span { color: #ffb0b0; }
.h-name { position: absolute; top: 34px; width: 190px; text-align: right; right: 370px; font-family: var(--title); font-size: 22px; font-weight: 700; color: var(--gold-l);
  text-shadow: 0 0 12px rgba(232, 194, 106, .4); }
.h-name small { display: block; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 16px; color: var(--el); }
.h-name .turn-mark { display: inline-block; margin-right: 8px; color: var(--ready); font-size: 16px; text-shadow: 0 0 8px var(--ready); animation: blink 1.5s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

.power { position: absolute; left: 380px; top: 34px; width: 76px; height: 76px; border-radius: 50%; cursor: default;
  background: radial-gradient(circle at 40% 35%, #2c2240, #0d0915); box-shadow: 0 0 0 3px #b98a2f, 0 0 0 5px #2a1a05, 0 6px 16px rgba(0, 0, 0, .7); transition: transform .15s; }
.power .art-svg { position: absolute; inset: 10px; width: 56px; height: 56px; }
.power .p-cost { position: absolute; top: -10px; left: 50%; margin-left: -15px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #4b78d6, #1a2e70 60%, #0b1440); box-shadow: 0 0 0 2px #e8c26a; font-family: var(--title); font-weight: 900; font-size: 16px; color: #fff; }
.power.usable { cursor: pointer; box-shadow: 0 0 0 3px #7dffcf, 0 0 20px rgba(125, 255, 207, .7), 0 6px 16px rgba(0, 0, 0, .7); }
.power.usable:hover { transform: scale(1.08); }
.power.used { filter: grayscale(1) brightness(.5); }

/* Info: Mana, Wenden, Deck */
.info { position: absolute; left: 1010px; width: 300px; height: 100px; }
.info.top { top: 60px; }
.info.bottom { top: 636px; }
.mana-row { display: flex; align-items: center; gap: 5px; }
.mana-num { font-family: var(--title); font-weight: 900; font-size: 24px; color: #cfe8ff; text-shadow: 0 0 10px #4fa3ff; margin-right: 8px; min-width: 56px; }
.gem { width: 16px; height: 16px; transform: rotate(45deg); border-radius: 3px; border: 1px solid rgba(160, 200, 255, .5); background: rgba(10, 16, 40, .8); }
.gem.full { background: radial-gradient(circle at 35% 30%, #e6f4ff, #59a8ff 50%, #1b3e9a); border-color: #cfe8ff; box-shadow: 0 0 8px rgba(110, 180, 255, .9); }
.gem.temp { background: radial-gradient(circle at 35% 30%, #fff8e0, #f0c66a 50%, #8a5a12); border-color: #fff2c0; box-shadow: 0 0 8px rgba(240, 198, 106, .9); }
.info-row2 { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.flip-token { display: flex; align-items: center; gap: 8px; font-family: var(--title); font-size: 14px; color: var(--muted); }
.flip-token b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 18px; color: #2a1a05;
  background: radial-gradient(circle at 35% 30%, #fff8e0, #f0c66a 50%, #8a5a12); box-shadow: 0 0 10px rgba(240, 198, 106, .8); }
.flip-token.used b { filter: grayscale(1) brightness(.45); box-shadow: none; }
.deck-info { display: flex; align-items: center; gap: 8px; font-family: var(--title); color: var(--muted); font-size: 14px; }
.deck-info .card-back { --cw: 26px; border-radius: 3px; }
.deck-info b { color: var(--gold-l); font-size: 18px; }

/* Hand */
.hand { position: absolute; left: 0; right: 0; bottom: 0; height: 0; z-index: 30; }
.hand-slot { position: absolute; left: calc(50% - 75px); bottom: -84px; transform-origin: 50% 100%;
  transform: translate(var(--x), var(--y)) rotate(var(--r)); transition: transform .22s ease, filter .2s; cursor: pointer; }
.hand-slot:hover, .hand-slot.selected { transform: translate(var(--x), -128px) scale(1.5); z-index: 100 !important; }
.hand-slot.playable .card::before { background: linear-gradient(145deg, #e6fff5, #7dffcf 35%, #22a37a 60%, #c8ffe9); }
.hand-slot.playable .card { box-shadow: 0 0 1.2em rgba(125, 255, 207, .65), 0 .4em 1.2em rgba(0, 0, 0, .7); }
.hand-slot.selected .card { box-shadow: 0 0 1.6em rgba(255, 242, 192, .95), 0 .4em 1.2em rgba(0, 0, 0, .7); }
.hand-slot.dragging { opacity: .25; }
.hand-slot.drawn { animation: drawIn .6s ease-out; }
@keyframes drawIn { from { transform: translate(600px, -300px) rotate(30deg) scale(.6); opacity: 0; } }
.flip-btn { position: absolute; top: -12px; right: -12px; width: 34px; height: 34px; border-radius: 50%; border: 0; z-index: 10; cursor: pointer; font-size: 19px;
  color: #2a1a05; background: radial-gradient(circle at 35% 30%, #fff8e0, #f0c66a 50%, #8a5a12); box-shadow: 0 0 0 2px #2a1a05, 0 0 12px rgba(240, 198, 106, .9);
  opacity: 0; transition: opacity .2s, transform .2s; }
.hand-slot:hover .flip-btn { opacity: 1; }
.flip-btn:hover { transform: rotate(180deg) scale(1.1); }
.hand-slot .card.flipping { animation: flipCard .5s ease; }
@keyframes flipCard { 50% { transform: rotateY(90deg); } }

.opp-hand { position: absolute; left: 50%; top: -66px; width: 0; height: 0; z-index: 5; }
.opp-hand .card-back { --cw: 82px; position: absolute; left: -41px; top: 0; transform-origin: 50% 0; transform: translateX(var(--x)) rotate(var(--r)); }

/* Zug beenden */
.end-turn { position: absolute; right: 58px; top: 378px; width: 186px; height: 68px; border-radius: 34px; cursor: pointer; z-index: 10;
  border: 2px solid rgba(232, 194, 106, .8); background: linear-gradient(180deg, #fff6dc, #e9cf8f); color: var(--slate);
  font-family: var(--title); font-weight: 900; font-size: 18px; letter-spacing: .05em;
  box-shadow: 0 0 0 5px rgba(10, 8, 16, .7), 0 10px 26px rgba(0, 0, 0, .6); transition: transform .15s, box-shadow .2s, filter .2s; }
.end-turn:hover { transform: scale(1.04); }
.end-turn.done { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(10, 8, 16, .7), 0 0 0 9px rgba(125, 255, 207, .55), 0 0 36px rgba(125, 255, 207, .7); } }
.end-turn:disabled { filter: grayscale(.9) brightness(.55); cursor: default; transform: none; animation: none; }

/* Chronik */
.log { position: absolute; left: 26px; top: 190px; width: 222px; height: 460px; border-radius: 14px; background: var(--panel); border: 1px solid rgba(232, 194, 106, .25);
  display: flex; flex-direction: column; overflow: hidden; }
.log-head { font-family: var(--title); text-align: center; padding: 10px 0 8px; color: var(--gold); letter-spacing: .25em; font-size: 15px; border-bottom: 1px solid rgba(232, 194, 106, .2); }
.log-body { flex: 1; overflow-y: auto; padding: 8px 12px 12px; font-size: 15px; line-height: 1.25; color: #d8cfba; }
.log-body div { margin: 0 0 6px; }
.log-body div.turn { color: var(--gold); font-family: var(--title); font-size: 12px; letter-spacing: .08em; text-align: center; margin: 10px 0 6px; }
.log-body::-webkit-scrollbar { width: 6px; }
.log-body::-webkit-scrollbar-thumb { background: rgba(232, 194, 106, .3); border-radius: 3px; }

#menu-btn { position: absolute; left: 26px; top: 26px; }
#sound-btn { position: absolute; left: 86px; top: 26px; }
#sound-btn.off { text-decoration: line-through; opacity: .6; }
.hint { position: absolute; left: 0; right: 0; top: 396px; text-align: center; pointer-events: none; z-index: 8; font-style: italic; font-size: 20px; color: var(--gold-l);
  opacity: 0; transition: opacity .3s; text-shadow: 0 0 8px #000, 0 0 4px #000; }
.hint.show { opacity: 1; }

/* ----------------------------------------------------------- Overlays */

.modal { position: absolute; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(4, 3, 8, .78); backdrop-filter: blur(3px); }
.modal.hidden { display: none; }
.panel { position: relative; min-width: 560px; max-width: 1100px; padding: 40px 54px; border-radius: 20px; text-align: center;
  background: linear-gradient(180deg, rgba(24, 18, 36, .98), rgba(10, 8, 16, .98)); border: 1px solid rgba(232, 194, 106, .55);
  box-shadow: 0 0 0 6px rgba(10, 8, 16, .8), 0 0 0 7px rgba(232, 194, 106, .25), 0 30px 80px rgba(0, 0, 0, .8); animation: pop .35s ease; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.panel h2 { margin: 0 0 8px; font-family: var(--title); font-size: 36px; color: var(--gold-l); letter-spacing: .12em; }
.panel p { font-size: 20px; color: var(--text); margin: 6px 0; }
.panel .sub { color: var(--muted); font-style: italic; }
.panel .row { display: flex; justify-content: center; gap: 22px; margin-top: 24px; }
.panel .btn { min-width: 240px; }
.mull-cards { display: flex; gap: 26px; justify-content: center; margin: 26px 0 6px; }
.mull-cards .mull { position: relative; cursor: pointer; transition: transform .2s; }
.mull-cards .mull:hover { transform: translateY(-8px); }
.mull-cards .card { --cw: 200px; }
.mull.swap .card { filter: brightness(.4) grayscale(.6); }
.mull.swap::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 110px; color: #ff6b6b; text-shadow: 0 0 20px #000; z-index: 9; }

.rules { text-align: left; columns: 2; column-gap: 40px; font-size: 16px; line-height: 1.25; }
.rules h3 { font-family: var(--title); color: var(--gold); font-size: 18px; letter-spacing: .1em; margin: 0 0 6px; break-after: avoid; }
.rules p, .rules ul { margin: 0 0 14px; break-inside: avoid; }
.rules ul { padding-left: 18px; }
.rules b { color: var(--gold-l); }

.end-title { font-family: 'Cinzel Decorative', var(--title) !important; font-size: 92px !important; letter-spacing: .1em !important; line-height: 1.1; margin: 0 !important;
  background: linear-gradient(180deg, #fffbe8 10%, #f3cf7a 45%, #a8701f 80%); -webkit-background-clip: text; background-clip: text; color: transparent !important;
  filter: drop-shadow(0 0 30px rgba(240, 198, 106, .5)); }
.end-title.lose { background: linear-gradient(180deg, #f0e6ff 10%, #9b7fc9 50%, #3d2470 90%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 30px rgba(150, 100, 220, .5)); }

.banner { position: absolute; left: 0; right: 0; top: 50%; height: 140px; margin-top: -70px; z-index: 150; pointer-events: none; display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel Decorative', var(--title); font-weight: 900; font-size: 64px; letter-spacing: .14em; color: var(--gold-l); opacity: 0;
  text-shadow: 0 0 30px rgba(232, 194, 106, .8), 0 3px 0 #000;
  background: linear-gradient(90deg, transparent, rgba(8, 6, 14, .9) 25%, rgba(8, 6, 14, .9) 75%, transparent); }
.banner::before, .banner::after { content: ''; position: absolute; left: 20%; right: 20%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.banner::before { top: 18px; }
.banner::after { bottom: 18px; }
.banner.show { animation: banner 1.5s ease forwards; }
.banner.enemy { color: #e3d4ff; text-shadow: 0 0 30px rgba(170, 120, 255, .8), 0 3px 0 #000; }
@keyframes banner { 0% { opacity: 0; transform: scaleY(.2); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ----------------------------------------------------------- Effekte (Viewport) */

#fx { position: fixed; inset: 0; pointer-events: none; z-index: 500; }
.float-num { position: absolute; transform: translate(-50%, -50%); font-family: var(--title); font-weight: 900; font-size: 40px; color: #fff; pointer-events: none;
  -webkit-text-stroke: 1.5px #000; text-shadow: 0 0 12px rgba(0, 0, 0, .9); animation: floatUp 1.2s ease-out forwards; }
.float-num.dmg { color: #ff5a4f; }
.float-num.heal { color: #7dffa0; }
.float-num.armor { color: #dfe6f2; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  30% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -150%); } }
.burst { position: absolute; width: 0; height: 0; }
.burst i { position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #ffe39a); box-shadow: 0 0 10px var(--c, #ffe39a);
  animation: burst .9s ease-out forwards; }
@keyframes burst { from { transform: translate(-50%, -50%); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); opacity: 0; } }
.ghost { position: absolute; border-radius: 16px; background: radial-gradient(circle, rgba(255, 236, 170, .7), rgba(232, 194, 106, .1) 70%);
  animation: ghost .8s ease-out forwards; }
@keyframes ghost { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.4); } }
.ring { position: absolute; border-radius: 50%; border: 3px solid #fff2c0; box-shadow: 0 0 20px #fff2c0; transform: translate(-50%, -50%); animation: ring .6s ease-out forwards; }
@keyframes ring { from { width: 40px; height: 40px; opacity: 1; } to { width: 220px; height: 220px; opacity: 0; } }
.bolt { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  background: radial-gradient(circle, #fff, #ffe39a 40%, rgba(232, 194, 106, 0) 70%); box-shadow: 0 0 30px 10px rgba(255, 220, 140, .7); }
.drag-ghost { position: absolute; transform: translate(-50%, -60%) rotate(-4deg); filter: drop-shadow(0 0 20px rgba(255, 242, 192, .7)); }
.reveal { position: absolute; transform: translate(-50%, -50%); animation: reveal 1.15s ease forwards; }
@keyframes reveal { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6) rotateY(90deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.85); } }

.arrow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 600; }
.arrow.hidden { display: none; }
#arrow-path { fill: none; stroke: #fff2c0; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 2 16; filter: drop-shadow(0 0 6px #e8c26a); animation: dash .6s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -18; } }
#arrow-head { fill: rgba(232, 194, 106, .18); stroke: #fff2c0; stroke-width: 3; filter: drop-shadow(0 0 8px #e8c26a); }
#arrow-core { fill: #fff2c0; }

.tooltip { position: fixed; z-index: 700; pointer-events: none; display: flex; gap: 12px; align-items: flex-start; }
.tooltip.hidden { display: none; }
.tooltip .card { --cw: 230px; }
.tip-box { max-width: 260px; padding: 12px 14px; border-radius: 10px; background: rgba(10, 8, 16, .95); border: 1px solid rgba(232, 194, 106, .45);
  font-size: 16px; line-height: 1.25; color: var(--text); box-shadow: 0 10px 30px rgba(0, 0, 0, .7); }
.tip-box + .tip-box { margin-top: 8px; }
.tip-col { display: flex; flex-direction: column; gap: 8px; }
.tip-box h4 { margin: 0 0 4px; font-family: var(--title); color: var(--gold); font-size: 14px; letter-spacing: .08em; }
.tip-box.rev h4 { color: #ff8fc4; }
.tip-box b { color: var(--gold-l); }

.toast { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 800; padding: 12px 26px; border-radius: 24px; pointer-events: none;
  background: rgba(10, 8, 16, .92); border: 1px solid rgba(232, 194, 106, .6); font-size: 20px; color: var(--gold-l); opacity: 0; transition: opacity .25s; }
.toast.show { opacity: 1; }
