/* ==================================================================== Fonts
   The Witcher 3 interface uses PF DinText Cond Pro (commercial). It is used when installed on the system;
   otherwise the bundled D-DIN Condensed (SIL Open Font License), a closely matching DIN condensed, is used. */
@font-face { font-family: "D-DIN Condensed"; src: url("../assets/fonts/D-DINCondensed.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "D-DIN Condensed"; src: url("../assets/fonts/D-DINCondensed-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ==================================================================== Base
   The stage is a fixed 1920×1080 canvas (the size of the original board art) scaled to fit the screen. On screens
   wider than 16:9 the board, the player panels and the overlays reach out to the screen's edges (--sx, set by UI.fit,
   is how far). */
:root {
  --font: "PF DinText Cond Pro", "PFDinTextCondPro-Regular", "PF Din Text Cond Pro", "D-DIN Condensed", "Arial Narrow", sans-serif;
  --gold: #d9b26e;
  --gold-hi: #f0cd86;
  --title: #aaa6a0;
  --label: #9c9892;
  --cream: #dcc7a0;
  --perk: #d8c2a0;
  --white: #f2eee6;
  --dim: #6d645c;
  --green: #7fc48c;
  --red: #e0493c;
  --orange: #f0a23a;
  --target: #ffcf6a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: var(--white); font-family: var(--font); overflow: hidden; overflow: clip; touch-action: manipulation; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; }
button { font-family: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { -webkit-user-drag: none; user-select: none; }
kbd { font-family: var(--font); }

#viewport { position: fixed; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; overflow: clip; background: #000; }
#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; background: #000; }

#rotate-hint { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 99; background: #000; color: var(--gold); font: 22px var(--font); align-items: center; justify-content: center; text-align: center; padding: 20px; }
@media (orientation: portrait) and (pointer: coarse) { #rotate-hint { display: flex; } }

.screen { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; overflow: hidden; overflow: clip; }
.screen.active { display: block; }

/* Key/button hints (bottom-right, as in the game) */
.hints { position: absolute; right: 100px; bottom: 58px; display: flex; gap: 34px; align-items: center; z-index: 20; }
.hint { display: flex; align-items: center; gap: 10px; font-size: 22px; color: #d9b48a; white-space: nowrap; }
.hint:hover { color: var(--gold-hi); }
.hint.primary { color: var(--gold-hi); }
.hint.off { opacity: .35; pointer-events: none; }
#stage.overlay-open .screen .hints, #stage.dialog-open .screen .hints, #stage.overlay-open #pass-hint { visibility: hidden; }
#gameover .hints { visibility: visible; }
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 30px; padding: 0 7px;
  border: 2px solid #8f7a5c; border-radius: 6px; background: #1b1712; color: #d8c8ad; font-size: 16px; font-weight: 700;
}
/* Phones and tablets have no keyboard: the hints are plain buttons and How to Play only explains touch. Zoom goes
   too, since it works on the card under the mouse (there a card is pressed and held instead). */
.touch kbd, .touch .pc-only, .touch .hint[data-act=zoom] { display: none; }

/* ==================================================================== Home: plain black with the title and Play */
#menu { background: #000; }
.menu-title { position: absolute; left: 0; right: 0; top: 200px; margin: 0; padding-left: .08em; text-align: center; font-size: 220px; font-weight: 400; line-height: 1; letter-spacing: .08em; color: var(--gold); text-transform: uppercase; }
.play { position: absolute; left: 50%; top: 520px; transform: translateX(-50%); padding: 8px 60px 8px calc(60px + .08em); font-size: 104px; line-height: 1; letter-spacing: .08em; color: var(--cream); text-transform: uppercase; }
.play:hover { color: var(--gold-hi); }
.menu-link { position: absolute; left: 50%; top: 690px; transform: translateX(-50%); padding: 12px 40px;
  font-size: 28px; letter-spacing: .08em; color: var(--cream); text-transform: uppercase; opacity: .75; transition: color .2s, opacity .2s; }
.menu-link:hover { color: var(--gold-hi); opacity: 1; }
.menu-settings { position: absolute; left: 50%; top: 765px; transform: translateX(-50%); display: flex; gap: 20px; }
.menu-settings .menu-link { position: static; transform: none; padding: 10px 26px; font-size: 22px; }

/* ==================================================================== Cards */
.card { position: relative; flex: none; cursor: pointer; border-radius: 5px; overflow: hidden; box-shadow: 0 3px 8px rgba(0, 0, 0, .75); background: #000; }
.card > .c-art { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.card.sm { width: 88px; height: 118px; }
.card.hand { width: 92px; height: 124px; }
.card.pile { width: 100px; height: 138px; }
.card.lg { width: 308px; height: 582px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .85); }
.card.md { width: 315px; height: 595px; border-radius: 14px; }
.card.db { width: 187px; height: 352px; border-radius: 10px; box-shadow: none; }
.card.dbl { width: 130px; height: 245px; border-radius: 8px; }
.db-name { position: absolute; top: 77.4%; left: 4%; right: 3%; text-align: center; font-weight: 700; font-size: 22px; line-height: 25px; color: #1c150e; pointer-events: none; }
.db-name.banner { left: 24%; }
.card.dbl .db-name { font-size: 14px; line-height: 16px; top: 77%; left: 3%; right: 3%; }

.c-pow { position: absolute; left: 0; top: 0; width: 74%; aspect-ratio: 1; background: center / 100% no-repeat; pointer-events: none; }
@supports not (aspect-ratio: 1) { .c-pow { height: 0; padding-bottom: 74%; } } /* older WebViews */
.c-pow.normal { background-image: url("../assets/ui/power_normal.png"); }
.c-pow.hero { background-image: url("../assets/ui/power_hero.png"); }
.c-pow span { position: absolute; left: 32.6%; top: 32.6%; transform: translate(-50%, -50%); font-weight: 700; color: #111; font-size: 21px; line-height: 1; }
.card.hand .c-pow span { font-size: 23px; }
.card.pile .c-pow span { font-size: 25px; }
.c-pow.hero span { color: #fff; }
.c-pow span.buff { color: #1c9b31; }
.c-pow span.nerf { color: #d31f13; }
.c-icons { position: absolute; right: 2px; bottom: 2px; display: flex; gap: 1px; pointer-events: none; }
.c-icons img { width: 24px; height: 24px; }
.card.hand .c-icons img { width: 26px; height: 26px; }

.card.new { animation: appear .3s ease-out; }
@keyframes appear { from { transform: translateY(-24px) scale(1.12); opacity: 0; } }
.card.target { box-shadow: 0 0 0 3px var(--target), 0 0 16px rgba(255, 207, 106, .9); }
.card .c-anim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .35); animation: animicon .9s ease-out forwards; pointer-events: none; z-index: 3; }
.card .c-anim img { width: 74%; }
.card .c-anim.scorch { background: none; }
.card .c-anim.scorch img { width: 100%; height: 100%; object-fit: cover; }
@keyframes animicon { 0% { opacity: 0; transform: scale(1.4); } 25% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.card.burn { animation: burn .9s ease-in forwards; }
@keyframes burn { 60% { filter: brightness(1.5) sepia(1) saturate(3); } 100% { filter: brightness(.1); opacity: 0; transform: scale(.85); } }
.flyer { position: absolute; z-index: 45; pointer-events: none; transition: transform .34s cubic-bezier(.3, .7, .3, 1), width .34s, height .34s; }

/* ==================================================================== Board */
#game { background: #000 url("../assets/ui/board.jpg") 0 0 / 1920px 1080px no-repeat; overflow: visible; }
/* Beside the board (screens wider than 16:9) its plain outer wood carries on, mirrored (tools/make_board_sides.py) */
#game::before, #game::after { content: ""; position: absolute; top: 0; bottom: 0; width: var(--sx, 0px); background: url("../assets/ui/board_side_l.jpg") right top / auto 100% repeat-x; pointer-events: none; }
#game::before { right: 100%; }
#game::after { left: 100%; background-image: url("../assets/ui/board_side_r.jpg"); background-position: left top; }

.row { position: absolute; left: 508px; width: 1012px; height: 120px; }
#row-op-siege { top: 14px; }
#row-op-ranged { top: 147px; }
#row-op-close { top: 284px; }
#row-me-close { top: 431px; }
#row-me-ranged { top: 567px; }
#row-me-siege { top: 704px; }
.row-score { position: absolute; left: 2px; top: 35px; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: #1a120a; pointer-events: none; }
.row-special { position: absolute; left: 60px; top: 0; width: 132px; height: 120px; display: flex; align-items: center; justify-content: center; border-radius: 4px; }
.row-cards { position: absolute; left: 200px; width: 810px; top: 1px; height: 118px; display: flex; justify-content: center; align-items: center; border-radius: 4px; }
.row-wx { position: absolute; left: 60px; right: 0; top: 0; bottom: 0; pointer-events: none; opacity: 0; transition: opacity .5s; background: center / 100% 100% no-repeat; }
.row.w-frost .row-wx { opacity: 1; background-image: url("../assets/ui/overlay_frost.png"); }
.row.w-fog .row-wx { opacity: 1; background-image: url("../assets/ui/overlay_fog.png"); }
.row.w-rain .row-wx { opacity: 1; background-image: url("../assets/ui/overlay_rain.png"); }
.row.target .row-cards, .row-special.target { box-shadow: inset 0 0 0 3px var(--target), 0 0 22px rgba(255, 207, 106, .45); background: rgba(255, 207, 106, .08); cursor: pointer; }

#hand { position: absolute; left: 575px; top: 841px; width: 943px; height: 128px; display: flex; justify-content: center; align-items: center; }
#hand .card { transition: transform .12s; }
#hand .card:hover { transform: translateY(-8px); z-index: 5; }
#hand .card.sel { transform: translateY(-22px); z-index: 6; box-shadow: 0 0 0 3px var(--orange), 0 0 22px rgba(240, 162, 58, .9); }

.leader-slot { position: absolute; left: 140px; width: 100px; height: 138px; }
#op-leader { top: 80px; }
#me-leader { top: 834px; }
.leader-slot .card { width: 100px; height: 138px; }
.leader-slot .card.used, .leader-slot .card.blocked { filter: grayscale(1) brightness(.5); }
.leader-active { position: absolute; left: 257px; width: 40px; height: 40px; background: url("../assets/ui/icon_leader_active.png") center / contain no-repeat; display: none; }
#op-leader-active { top: 128px; }
#me-leader-active { top: 883px; }
.leader-active.on { display: block; }
.leader-active.usable { animation: pulse 1.5s infinite; cursor: pointer; }
@keyframes pulse { 50% { filter: drop-shadow(0 0 10px var(--target)) brightness(1.35); } }

/* Player panels (mirrored like the game: the opponent's name is above its stats, yours below) */
.ppanel { position: absolute; left: 0; width: 452px; height: 138px; background: linear-gradient(90deg, rgba(0, 0, 0, .78), rgba(0, 0, 0, .55) 80%, rgba(0, 0, 0, .25)); border-top: 1px solid rgba(255, 255, 255, .07); border-bottom: 1px solid rgba(255, 255, 255, .07); }
.ppanel::before { content: ""; position: absolute; right: 100%; top: -1px; bottom: -1px; width: var(--sx, 0px); background: rgba(0, 0, 0, .78); border-top: inherit; border-bottom: inherit; } /* to the screen's edge */
#op-panel { top: 270px; }
#me-panel { top: 672px; }
/* the active player's panel glows along its bottom edge, the part reaching to the screen's edge too */
.ppanel.active { border-bottom-color: var(--orange); border-top-color: rgba(240, 162, 58, .4); background-image: linear-gradient(to top, rgba(240, 162, 58, .25), rgba(240, 162, 58, 0) 9px), linear-gradient(90deg, rgba(0, 0, 0, .78), rgba(0, 0, 0, .55) 80%, rgba(0, 0, 0, .25)); }
.ppanel.active::before { background-image: linear-gradient(to top, rgba(240, 162, 58, .25), rgba(240, 162, 58, 0) 9px); }
/* As measured on the current game: the ring at its own size with the portrait filling it, and the shield over the
   ring's top left (opponent) or bottom left (you) */
.pp-portrait { position: absolute; left: 118px; top: 13px; width: 116px; height: 122px; }
.ppanel.me .pp-portrait { top: 4px; }
.pp-portrait::before { content: ""; position: absolute; left: 5px; top: 4px; width: 106px; height: 106px; border-radius: 50%; background: #1a120b url("../assets/ui/profile.png") center bottom / 89% no-repeat; }
.ppanel.me .pp-portrait::before { background: #1a120b url("../assets/ui/portrait_geralt.png") center / cover no-repeat; }
.pp-portrait::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: url("../assets/ui/icon_player_border.png") 0 0 / 100% 100% no-repeat; }
.pp-shield { position: absolute; left: 103px; top: 10px; width: 50px; height: 56px; background: center / contain no-repeat; z-index: 1; }
.ppanel.me .pp-shield { top: 74px; }
.pp-name { position: absolute; left: 242px; right: 70px; font-size: 24px; font-weight: 700; color: #ad8b57; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-faction { position: absolute; left: 242px; font-size: 22px; color: #a08871; }
.pp-stats { position: absolute; left: 240px; display: flex; gap: 18px; align-items: center; }
.ppanel.op .pp-name { top: 11px; }
.ppanel.op .pp-faction { top: 36px; }
.ppanel.op .pp-stats { top: 80px; }
.ppanel.me .pp-stats { top: 22px; }
.ppanel.me .pp-name { top: 72px; }
.ppanel.me .pp-faction { top: 102px; }
.pp-hand { display: flex; align-items: center; gap: 8px; font-size: 27px; font-weight: 700; color: #c9ad7d; }
.pp-hand i { width: 24px; height: 34px; background: url("../assets/ui/icon_card_count.png") center / contain no-repeat; }
.pp-gems { display: flex; gap: 4px; }
.pp-gems i { width: 34px; height: 35px; background: url("../assets/ui/icon_gem_off.png") center / contain no-repeat; }
.pp-gems i.on { background-image: url("../assets/ui/icon_gem_on.png"); }
.passed { position: absolute; left: 340px; width: 100px; text-align: right; font-size: 22px; color: var(--gold); display: none; }
.passed.on { display: block; }
#op-passed { top: 410px; }
#me-passed { top: 642px; }

.total { position: absolute; left: 427px; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
#op-total { top: 304px; }
#me-total { top: 707px; }
.total span { position: relative; font-size: 27px; font-weight: 700; color: #1a120a; }
.total .laurel { position: absolute; left: -25px; top: -14px; width: 102px; height: 78px; background: url("../assets/ui/icon_high_score.png") center / contain no-repeat; display: none; }
.total.lead .laurel { display: block; }

.weather-zone { position: absolute; left: 140px; top: 445px; width: 282px; height: 146px; display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: 4px; }
.weather-zone.target { box-shadow: inset 0 0 0 3px var(--target), 0 0 22px rgba(255, 207, 106, .45); background: rgba(255, 207, 106, .08); cursor: pointer; }
.weather-zone .card { width: 82px; height: 112px; }

.pass-hint { position: absolute; left: 132px; top: 612px; height: 44px; display: none; align-items: center; gap: 10px; font-size: 21px; color: #d9b48a; padding: 0 12px 0 4px; }
.pass-hint.on { display: flex; }
.pass-hint .ring { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 6px; background: linear-gradient(90deg, rgba(240, 162, 58, .45) var(--p, 0%), transparent var(--p, 0%)); }
.pass-hint kbd, .pass-hint .ph-text { position: relative; }
.touch .pass-hint { padding-left: 14px; }

.pile { position: absolute; width: 100px; height: 138px; }
#op-grave { left: 1549px; top: 74px; }
#op-deck { left: 1731px; top: 74px; }
#me-grave { left: 1549px; top: 831px; }
#me-deck { left: 1731px; top: 831px; }
.pile.grave { cursor: pointer; }
.pile .back { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 6px; background: center / cover no-repeat; box-shadow: 2px 2px 0 #222, 4px 4px 0 #111, 6px 6px 12px rgba(0, 0, 0, .7); }
.pile.deck .cnt { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 22px; font-weight: 700; color: #f2eee6; text-shadow: 0 1px 3px #000; z-index: 3; }
.pile.deck .cnt::before { content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 26px; background: rgba(0, 0, 0, .6); border-radius: 3px; z-index: -1; }

/* Card preview (right column) and its ability box (bottom right), as in the game */
#preview { position: absolute; left: 1542px; top: 225px; width: 308px; height: 582px; pointer-events: none; }
.desc-box {
  position: absolute; background: rgba(0, 0, 0, .9); border: 1px solid rgba(255, 255, 255, .05); padding: 16px 28px 18px 70px; text-align: center; display: none;
}
.desc-box.on { display: block; }
.desc-box .db-icon { position: absolute; left: 16px; top: 14px; width: 38px; height: 38px; }
.desc-box h4 { margin: 2px 0 8px; font-weight: 400; font-size: 23px; color: var(--gold); }
.desc-box p { margin: 0 0 4px; font-size: 18px; line-height: 1.3; color: var(--cream); }
.desc-box .cur { color: var(--target); font-size: 17px; }
#preview-desc { left: 1305px; top: 830px; width: 563px; min-height: 120px; z-index: 30; pointer-events: none; }

#hint { position: absolute; left: 575px; top: 810px; width: 943px; text-align: center; font-size: 22px; color: var(--target); pointer-events: none; text-shadow: 0 2px 4px #000; }
#game-hints { right: 70px; bottom: 30px; }
#game-hints .hint { font-size: 20px; }

/* ==================================================================== Notification banner */
#banner {
  position: absolute; left: 0; right: 0; top: 455px; height: 145px; display: flex; align-items: center; justify-content: center; gap: 26px; z-index: 40;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .9) 16%, rgba(0, 0, 0, .9) 84%, transparent);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#banner.show { opacity: 1; }
#banner .bn-icon { width: 200px; height: 143px; flex: none; background: center / contain no-repeat; }
#banner .bn-icon.none { display: none; }
#banner span { font-size: 40px; color: var(--gold); max-width: 980px; line-height: 1.15; }
#banner.long span { font-size: 32px; }

/* ==================================================================== Card selection (redraw, medic, leaders, zoom) */
/* The spread shadow dims the screen beside the stage as well */
.overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; display: none; --dim: rgba(0, 0, 0, .62); background: var(--dim); box-shadow: 0 0 0 2000px var(--dim); }
.overlay.show { display: block; }
.overlay.dark { --dim: rgba(0, 0, 0, .8); }
.ch-band { position: absolute; left: calc(-1 * var(--sx, 0px)); right: calc(-1 * var(--sx, 0px)); top: 138px; height: 66px; background: rgba(0, 0, 0, .86); display: flex; align-items: center; justify-content: center; }
.ch-title { font-size: 32px; color: var(--gold); }
.ch-carousel { position: absolute; left: 0; right: 0; top: 222px; height: 600px; touch-action: none; }
.ch-carousel .slot { position: absolute; top: 0; left: 50%; transform-origin: center top; transition: transform .3s cubic-bezier(.25, .8, .3, 1), filter .3s, opacity .3s; will-change: transform, opacity; cursor: pointer; }
.ch-carousel.dragging .slot { transition: none; } /* the cards follow the finger */
.ch-carousel .slot.far { pointer-events: none; }
.ch-carousel .slot.center .card { box-shadow: 0 0 0 3px var(--orange), 0 0 30px rgba(240, 162, 58, .7); }
.ch-carousel .slot:not(.center) { filter: brightness(.85); }
.ch-desc { left: 678px; top: 836px; width: 564px; min-height: 140px; }
.ch-hints { right: 100px; bottom: 58px; }

#dialog { --dim: rgba(0, 0, 0, .65); z-index: 60; }
#help { z-index: 70; }
.help-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 1560px; height: 940px; display: flex; flex-direction: column;
  padding: 34px 60px 28px; background: rgba(0, 0, 0, .92); border-top: 1px solid rgba(217, 178, 110, .35); border-bottom: 1px solid rgba(217, 178, 110, .35); }
.help-box h2 { margin: 0 0 18px; text-align: center; font-size: 44px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 400; }
.help-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding-right: 12px; }
.help-cols { columns: 2; column-gap: 64px; font-size: 30px; line-height: 1.38; color: var(--cream); }
.help-cols section { break-inside: avoid; margin-bottom: 22px; }
.help-cols h3 { margin: 0 0 6px; font-size: 33px; color: var(--gold); font-weight: 400; text-transform: uppercase; letter-spacing: .05em; }
.help-cols p { margin: 0; }
.help-cols b { color: var(--gold-hi); font-weight: 400; }
.help-cols table { width: 100%; border-collapse: collapse; font-size: 27px; }
.help-cols th { text-align: left; color: var(--gold); font-weight: 400; }
.help-cols td, .help-cols th { padding: 4px 8px 4px 0; border-bottom: 1px solid rgba(217, 178, 110, .15); vertical-align: top; }
.help-hints { margin-top: 16px; display: flex; justify-content: flex-end; }
.dlg-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 640px; max-width: 900px; background: rgba(0, 0, 0, .92); border-top: 1px solid rgba(217, 178, 110, .35); border-bottom: 1px solid rgba(217, 178, 110, .35); padding: 34px 48px; text-align: center; }
.dlg-text { font-size: 30px; color: var(--gold); line-height: 1.3; margin-bottom: 26px; }
.dlg-text small { display: block; font-size: 20px; color: var(--cream); margin-top: 10px; }
.dlg-buttons { display: flex; justify-content: center; gap: 34px; flex-wrap: wrap; }
.dlg-buttons .hint { font-size: 24px; }

#gameover { text-align: center; --dim: rgba(0, 0, 0, .8); }
.go-title { width: 656px; height: 416px; margin: 90px auto 0; background: center / contain no-repeat; }
.go-table { margin: 10px auto; border-collapse: collapse; font-size: 28px; }
.go-table td, .go-table th { padding: 10px 40px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.go-table th { color: var(--label); font-weight: 400; }
.go-table td { color: var(--white); }
.go-table td.w { color: var(--gold); font-weight: 700; }

#toast {
  position: absolute; left: 93px; top: 972px; z-index: 70; padding: 10px 26px; font-size: 22px; color: #2a1c0b; display: none;
  background: linear-gradient(#e2bd72, #b08640); border: 1px solid #f3d793; box-shadow: 0 4px 14px rgba(0, 0, 0, .7);
}
#toast.on { display: block; animation: toast 2.4s forwards; pointer-events: none; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* ==================================================================== Deck builder (The Witcher 3 layout) */
#builder { background: radial-gradient(ellipse at 50% 40%, #0d0b0a, #000 70%); }
.db-faction { position: absolute; left: 0; right: 0; top: 46px; height: 74px; }
.db-current { position: absolute; left: 50%; top: 0; transform: translateX(-50%); display: grid; grid-template-columns: 58px auto; column-gap: 10px; align-items: center; }
.db-shield { grid-row: 1 / span 3; width: 54px; height: 60px; background: center / contain no-repeat; }
.db-chosen { font-size: 17px; color: var(--label); text-align: center; }
.db-fname { font-size: 34px; color: var(--gold); text-align: center; white-space: nowrap; line-height: 1.05; }
.db-dots { display: flex; justify-content: center; gap: 5px; height: 12px; }
.db-dots i { width: 7px; height: 7px; transform: rotate(45deg); background: #3c362f; margin-top: 3px; }
.db-dots i.on { background: var(--gold); }
.db-side { position: absolute; top: 26px; display: flex; align-items: center; gap: 12px; font-size: 18px; color: #6f665d; }
.db-side:hover { color: var(--cream); }
.db-side.prev { right: calc(50% + 205px); }
.db-side.next { left: calc(50% + 190px); }
.db-perk { position: absolute; left: 400px; right: 400px; top: 122px; text-align: center; font-size: 21px; color: var(--perk); line-height: 1.2; }

.db-col { position: absolute; top: 100px; width: 650px; height: 880px; }
.db-col.left { left: 155px; }
.db-col.right { left: 1117px; }
.db-title { position: absolute; left: 0; width: 600px; top: 3px; text-align: center; font-size: 34px; color: var(--title); }
.db-filter-name { position: absolute; left: 0; width: 600px; top: 47px; text-align: center; font-size: 22px; color: #fff; letter-spacing: .02em; }
.db-filters { position: absolute; left: 0; width: 600px; top: 86px; display: flex; justify-content: space-between; padding: 0 8px; }
.db-filters button { width: 40px; height: 40px; opacity: .3; filter: sepia(1) saturate(.6) brightness(.9); transition: opacity .15s; }
.db-filters button img { width: 40px; height: 40px; }
.db-filters button:hover { opacity: .7; }
.db-filters button.sel { opacity: 1; filter: none; }
.db-grid {
  position: absolute; left: 0; top: 147px; width: 650px; height: 723px; overflow-y: auto; overflow-x: hidden;
  display: grid; grid-template-columns: repeat(3, 187px); column-gap: 18px; row-gap: 17px; align-content: start; padding-right: 30px;
  scrollbar-width: thin; scrollbar-color: #9a7c4c transparent;
}
.db-grid::-webkit-scrollbar { width: 8px; }
.db-grid::-webkit-scrollbar-thumb { background: #9a7c4c; border-radius: 4px; }
.db-grid::-webkit-scrollbar-track { background: rgba(255, 255, 255, .03); }
.db-item { position: relative; border-radius: 10px; }
.db-item:hover .card { box-shadow: 0 0 0 3px var(--orange), 0 0 20px rgba(240, 162, 58, .65); }
.db-count { position: absolute; left: 12px; bottom: 10px; display: flex; align-items: center; gap: 1px; font-size: 21px; color: #3e352b; pointer-events: none; }
.db-count i { width: 31px; height: 25px; background: url("../assets/ui/preview_count.png") left center / contain no-repeat; }
.db-mid { position: absolute; left: 838px; width: 262px; top: 180px; bottom: 170px; border-left: 1px solid rgba(255, 255, 255, .06); border-right: 1px solid rgba(255, 255, 255, .06); display: flex; flex-direction: column; align-items: center; }
.db-leader-label { margin-top: 4px; font-size: 19px; color: #c9af8a; }
#db-leader { margin-top: 10px; cursor: pointer; }
#db-leader:hover .card { box-shadow: 0 0 0 3px var(--orange), 0 0 20px rgba(240, 162, 58, .65); }
#db-stats { margin-top: 56px; text-align: center; }
#db-stats .st-label { font-size: 19px; color: var(--label); margin-top: 6px; }
#db-stats .st-val { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 25px; color: #d6b787; height: 32px; }
#db-stats .st-val img { width: 30px; height: 22px; object-fit: contain; }
#db-stats .st-val.bad { color: var(--red); }
#db-stats .st-val.good { color: var(--green); }
#db-hints { right: 100px; bottom: 60px; }
