/* Wickfield — interface styles.
   Layout: full-bleed canvas world lit only around the player; thin HUD on the top edge;
   menus are centered panels over a dimmed field. Single dark look by design. */
@font-face { font-family: "IM Fell English SC"; src: url("../assets/fonts/im-fell-english-sc.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("../assets/fonts/pixelify-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("../assets/fonts/rubik-latin.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --night: #0b1512;
  --moss: #10201b;
  --ink: #f4ead6;
  --muted: #9aa99f;
  --ember: #ffb347;
  --flame: #ff7a3d;
  --xp: #5ff2c8;
  --blood: #ff4d5e;
  --gold: #ffcf5a;
  --panel: rgba(12, 22, 19, .92);
  --panel-2: rgba(244, 234, 214, .05);
  --line: rgba(244, 234, 214, .14);
  --display: "IM Fell English SC", "Palatino Linotype", Georgia, serif;
  --body: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--night); color: var(--ink); font-family: var(--body);
  overflow: hidden; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
/* pixel art style: square type for headings and numbers, crisp edges on sprite canvases */
body.pixel-art { --display: "Pixelify Sans", "IM Fell English SC", Georgia, serif; }
body.pixel-art .timer, body.pixel-art .results b, body.pixel-art .stats-list b, body.pixel-art .big { font-family: "Pixelify Sans", var(--body); }
body.pixel-art .title-word { letter-spacing: .02em; }
body.pixel-art .pick canvas, #c.pixel { image-rendering: pixelated; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-btn { cursor: pointer; border: 0; background: transparent; padding: 8px 16px; font-weight: 600; font-size: 14px; }
.seg-btn[aria-checked="true"] { background: var(--ink); color: #10201b; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

/* ---------- HUD ---------- */
.hud { position: fixed; top: 0; left: 0; right: 0; padding-top: env(safe-area-inset-top, 0px); pointer-events: none; }
.xpbar { height: 8px; background: rgba(0, 0, 0, .55); }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2bb59a, var(--xp)); box-shadow: 0 0 12px var(--xp); transition: width .15s; }
.hud-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  font-variant-numeric: tabular-nums;
}
.hud-left { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.hud-top { display: flex; gap: 14px; align-items: center; font-weight: 600; font-size: 14px; }
.hud-right { display: flex; gap: 14px; align-items: center; justify-content: flex-end; font-weight: 600; font-size: 14px; }
.lvl { font-family: var(--display); font-size: 19px; color: var(--xp); }
.timer { font-weight: 800; font-size: 28px; letter-spacing: .02em; text-shadow: 0 2px 10px #000; text-align: center; }
.timer small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat { display: flex; gap: 6px; align-items: center; }
.ico-skull { width: 12px; height: 12px; border-radius: 50% 50% 35% 35%; background: var(--muted); }
.ico-wax { display: inline-block; width: 10px; height: 13px; border-radius: 3px 3px 2px 2px; background: var(--ember); box-shadow: 0 0 8px var(--flame); flex: none; }
.slots { display: flex; gap: 4px; flex-wrap: wrap; max-width: 46vw; }
.slot {
  position: relative; width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center; font-family: var(--display); font-size: 15px; color: #1a0f05;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3);
}
.slot.p { border-radius: 50%; width: 24px; height: 24px; font-size: 13px; }
.slot.evo { box-shadow: 0 0 0 2px var(--gold), 0 0 10px var(--gold); }
.slot b { position: absolute; right: -3px; bottom: -4px; font-family: var(--body); font-size: 9px; font-weight: 800; background: #0b1512; color: var(--ink); border-radius: 4px; padding: 0 3px; }
.slot-row { display: flex; gap: 4px; }
.icon-btn {
  pointer-events: auto; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .35); display: grid; place-items: center; cursor: pointer;
}
.icon-btn svg { width: 14px; height: 14px; }
.bossbar { margin: 10px auto 0; width: min(460px, calc(100% - 32px)); display: grid; gap: 4px; justify-items: center; }
.bossbar span { font-family: var(--display); font-size: 17px; color: var(--blood); letter-spacing: .04em; }
.bossbar div { width: 100%; height: 9px; border-radius: 99px; background: rgba(0, 0, 0, .6); overflow: hidden; border: 1px solid rgba(255, 77, 94, .4); }
.bossbar i { display: block; height: 100%; background: var(--blood); transition: width .1s; }
.flame-meter { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ico-flame { width: 10px; height: 14px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff2c4, var(--flame) 70%); }
.flame-bar { width: 120px; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .55); overflow: hidden; border: 1px solid rgba(255, 179, 71, .35); }
.flame-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--flame), var(--ember), #fff2c4); transition: width .15s; }
.flame-meter.low .flame-bar i { background: var(--blood); animation: breathe .8s ease-in-out infinite; }
.streak { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ember); text-shadow: 0 0 10px rgba(255, 122, 61, .6); }
.streak b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hint {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 26px); transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px)); padding: 12px 18px; border-radius: 12px; text-align: center;
  background: var(--panel); border: 1px solid rgba(255, 179, 71, .45); font-size: 15px; line-height: 1.4; pointer-events: none; z-index: 5;
  animation: deal .3s ease;
}
.hint b { color: var(--ember); }
.dash-btn {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 52%);
  width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255, 242, 196, .4); background: rgba(255, 122, 61, .25);
  font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; touch-action: none; z-index: 4;
}
body.playing #c { cursor: none; }
.abilities { display: flex; gap: 6px; }
.ab { white-space: nowrap; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line); background: rgba(0, 0, 0, .4); color: var(--muted); }
.ab b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ab.ready { border-color: rgba(255, 122, 61, .7); color: var(--ember); box-shadow: 0 0 10px rgba(255, 122, 61, .35); }
.ab.over { border-color: rgba(255, 77, 94, .6); color: var(--blood); }
.traits { grid-column: 2; display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.trait { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.trait[style] { border-color: var(--c); color: var(--c); }
.trait.curse { border-color: rgba(255, 77, 94, .6); color: var(--blood); }
.burden { grid-column: 2; font-size: 12px; color: var(--muted); }
.burden.over { color: var(--blood); }
.burden.set { color: var(--gold); }
.card.swap { border-style: dashed; }
.card.drop:hover, .card.drop:focus-visible { border-color: var(--blood); }
.pause-sets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 720px; }
.pause-sets span { font-size: 12px; padding: 5px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); text-align: left; }
.pause-sets b { color: var(--gold); }
.ignite-btn { bottom: calc(env(safe-area-inset-bottom, 0px) + 52% + 76px); background: rgba(255, 90, 61, .3); }
.screen.title-screen {
  display: grid; grid-template-rows: 1fr 150px 1fr; justify-items: center; gap: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(5, 9, 8, 0) 30%, rgba(5, 9, 8, .6) 100%);
}
.title-block { align-self: end; display: grid; justify-items: center; gap: 16px; padding-bottom: 6px; }
.title-screen .title-word { font-size: clamp(48px, 14vw, 150px); letter-spacing: .01em; animation: candlelight 5s ease-in-out infinite; }
@keyframes candlelight {
  0%, 100% { text-shadow: 0 0 42px rgba(255, 179, 71, .45), 0 0 2px #fff6; }
  37% { text-shadow: 0 0 30px rgba(255, 150, 60, .35), 0 0 2px #fff4; }
  41% { text-shadow: 0 0 52px rgba(255, 190, 90, .55), 0 0 2px #fff8; }
  70% { text-shadow: 0 0 38px rgba(255, 170, 70, .42), 0 0 2px #fff6; }
}
.ornament { display: flex; align-items: center; gap: 12px; }
.ornament i { width: clamp(48px, 10vw, 96px); height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 179, 71, .7)); }
.ornament i:last-child { transform: scaleX(-1); }
.ornament b { width: 7px; height: 7px; background: var(--ember); transform: rotate(45deg); box-shadow: 0 0 12px var(--flame); }
.title-menu { align-self: start; display: grid; gap: 2px; justify-items: center; padding-top: 20px; }
.tm {
  position: relative; cursor: pointer; border: 0; background: none; padding: 5px 26px;
  font-family: var(--display); font-size: clamp(20px, 3.2vw, 26px); letter-spacing: .04em; color: var(--muted);
  transition: color .15s, text-shadow .15s;
}
.tm.primary { font-size: clamp(28px, 4.6vw, 38px); color: var(--ember); text-shadow: 0 0 18px rgba(255, 122, 61, .35); }
.tm::before, .tm::after {
  content: ""; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  background: var(--ember); transform: rotate(45deg) scale(.4); opacity: 0; transition: opacity .15s, transform .15s;
  box-shadow: 0 0 10px var(--flame);
}
.tm::before { left: 6px; } .tm::after { right: 6px; }
.tm:hover, .tm:focus-visible { color: var(--ink); text-shadow: 0 0 20px rgba(255, 179, 71, .55); outline: none; }
.tm.primary:hover, .tm.primary:focus-visible { color: #ffd890; }
.tm:hover::before, .tm:hover::after, .tm:focus-visible::before, .tm:focus-visible::after { opacity: 1; transform: rotate(45deg) scale(1); }
body.pixel-art .tm { letter-spacing: .02em; }
.screen.intro { gap: 18px; background: radial-gradient(ellipse at center, rgba(8, 14, 12, .9), rgba(5, 9, 8, .97)); }
.intro-text { max-width: 54ch; display: grid; gap: 12px; text-align: left; font-size: 16px; line-height: 1.55; color: var(--muted); }
.intro-text p { margin: 0; }
.intro-text b { color: var(--ink); font-weight: 600; }
@media (max-height: 640px) { .screen.title-screen { grid-template-rows: 1fr 110px 1fr; } .tm { padding: 2px 22px; } }
@media (prefers-reduced-motion: reduce) { .title-screen .title-word { animation: none; } }
.edition-badge { font-family: var(--body); font-size: 11px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: var(--ember); padding: 3px 10px 3px 13px; border: 1px solid rgba(255, 179, 71, .5); border-radius: 99px; }
.tm.wish { color: var(--gold); text-decoration: none; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.pick.full { opacity: .8; border-style: dashed; }
.full-tag { color: var(--gold) !important; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 11px !important; }
.foot-link { pointer-events: auto; color: var(--muted); margin-right: 10px; }
.fake-ad { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0, 0, 0, .92); }
.fake-ad div { display: grid; gap: 10px; justify-items: center; padding: 28px 36px; border: 1px dashed var(--muted); border-radius: 14px; color: var(--ink); }
.fake-ad span { color: var(--muted); font-size: 14px; }
.fake-ad button { cursor: pointer; border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 6px 12px; }
.fps { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); font: 600 11px var(--body); color: var(--muted); pointer-events: none; }

.banner {
  position: fixed; left: 0; right: 0; top: 30%; text-align: center; pointer-events: none;
  font-family: var(--display); font-size: clamp(28px, 6vw, 46px); color: var(--ink);
  text-shadow: 0 0 24px rgba(255, 122, 61, .6); opacity: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.banner small { display: block; font-family: var(--body); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.banner.show { animation: banner 2.6s ease forwards; }
.banner.red { color: var(--blood); text-shadow: 0 0 24px rgba(255, 77, 94, .6); }
@keyframes banner { 0% { opacity: 0; transform: scale(1.15); } 12%, 75% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }

.toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); display: grid; gap: 8px; pointer-events: none; z-index: 20; }
.toast {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center;
  padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid rgba(255, 207, 90, .4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); min-width: 240px; max-width: 320px;
  animation: toast 4.5s ease forwards;
}
.toast .medal { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, var(--gold) 50%, #a3741a); }
.toast b { font-size: 14px; }
.toast span { font-size: 12px; color: var(--muted); }
@keyframes toast { 0% { opacity: 0; transform: translateY(20px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(10px); } }

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding-block: calc(env(safe-area-inset-top, 0px) + 24px) calc(env(safe-area-inset-bottom, 0px) + 24px);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: radial-gradient(ellipse at center, rgba(11, 21, 18, .6), rgba(5, 9, 8, .94));
  overflow-y: auto; text-align: center; z-index: 10;
}
.screen.tall { justify-content: flex-start; }
.screen.clear { background: radial-gradient(ellipse at center, rgba(11, 21, 18, 0), rgba(5, 9, 8, .7)); }
.title-word { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(64px, 14vw, 132px); line-height: .9; color: var(--ink); text-shadow: 0 0 40px rgba(255, 179, 71, .45), 0 0 2px #fff6; }
.lede { margin: 0; max-width: 46ch; color: var(--muted); font-size: 15px; line-height: 1.5; text-wrap: balance; }
.lede b { color: var(--ink); font-weight: 600; }
.h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 7vw, 54px); line-height: 1; text-wrap: balance; }
.h2.red { color: var(--blood); }
.h2.gold { color: var(--gold); text-shadow: 0 0 30px rgba(255, 207, 90, .5); }
.eyebrow { margin: 0; font-size: 12px; color: var(--muted); letter-spacing: .16em; text-transform: uppercase; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.menu { display: grid; gap: 10px; width: min(300px, 100%); }
.btn {
  cursor: pointer; border: 0; border-radius: 12px; padding: 13px 24px; min-width: 140px;
  font-family: var(--body); font-weight: 800; font-size: 16px; letter-spacing: .02em;
  background: linear-gradient(180deg, #ffc56b, var(--flame)); color: #2a1204;
  box-shadow: 0 5px 0 #a3421a, 0 0 30px rgba(255, 122, 61, .3); transition: transform .08s, box-shadow .08s, filter .1s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #a3421a; }
.btn.ghost { background: rgba(244, 234, 214, .07); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 5px 0 rgba(0, 0, 0, .5); }
.btn.ghost:active { box-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.btn.small { padding: 9px 14px; min-width: 0; font-size: 14px; }
.btn:disabled { opacity: .4; cursor: default; filter: none; }
.btn .count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 1px 6px; border-radius: 99px; background: rgba(0, 0, 0, .25); font-size: 12px; }
.wallet { display: inline-flex; gap: 8px; align-items: center; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.foot { position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); font-size: 12px; color: var(--muted); pointer-events: none; }

/* choice cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 240px)); gap: 12px; width: 100%; justify-content: center; }
@media (max-width: 560px) { .cards { grid-template-columns: minmax(0, 380px); } }
.card {
  cursor: pointer; text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: start;
  padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  transition: transform .12s, border-color .12s; animation: deal .3s cubic-bezier(.2, .9, .3, 1.2) backwards;
}
.card:nth-child(2) { animation-delay: .05s; } .card:nth-child(3) { animation-delay: .1s; } .card:nth-child(4) { animation-delay: .15s; }
@keyframes deal { from { transform: translateY(24px) scale(.96); opacity: 0; } }
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: var(--ember); }
.card.banishing { border-color: var(--blood); }
.gl { grid-row: span 3; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-size: 21px; color: #1a0f05; flex: none; }
.gl.p { border-radius: 50%; }
.card .nm { font-weight: 800; font-size: 17px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tagl { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--xp); }
.tagl.new { color: var(--ember); } .tagl.evo { color: var(--gold); }
.card .ds { font-size: 14px; color: var(--muted); line-height: 1.4; }
.card .key { font-size: 11px; color: rgba(154, 169, 159, .6); }

/* character and stage pickers */
.picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; width: min(980px, 100%); }
.pick {
  cursor: pointer; display: grid; gap: 6px; justify-items: center; text-align: center;
  padding: 16px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); transition: border-color .12s, transform .12s;
}
.pick:hover, .pick:focus-visible { transform: translateY(-2px); }
.pick.on { border-color: var(--ember); box-shadow: 0 0 0 1px var(--ember), 0 0 30px rgba(255, 122, 61, .2); }
.pick.locked { opacity: .55; }
#charList { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(820px, 100%); }
@media (max-width: 640px) { #charList { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pick canvas { width: 72px; height: 72px; }
.pick .nm { font-weight: 800; font-size: 17px; }
.pick .sub { font-size: 12px; color: var(--muted); font-style: italic; }
.pick .perk { font-size: 13px; color: var(--ink); line-height: 1.35; }
.pick .req { font-size: 12px; color: var(--ember); line-height: 1.35; }
.pick .swatch { width: 100%; height: 64px; border-radius: 10px; }
.pick .best { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toggle { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 600; }
.toggle .box { width: 38px; height: 22px; border-radius: 99px; background: rgba(244, 234, 214, .15); position: relative; transition: background .15s; }
.toggle .box::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.toggle[aria-checked="true"] .box { background: var(--flame); }
.toggle[aria-checked="true"] .box::after { transform: translateX(16px); }
.toggle:disabled { opacity: .45; cursor: default; }

/* results */
.results { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 28px; }
@media (max-width: 460px) { .results { grid-template-columns: repeat(2, auto); } }
.results div { display: grid; gap: 2px; }
.results span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.results b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.newbest { color: var(--ember); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
.dmg { width: min(460px, 100%); display: grid; gap: 6px; text-align: left; }
.dmg-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.dmg-row .gl { width: 26px; height: 26px; font-size: 13px; border-radius: 6px; grid-row: auto; }
.dmg-bar { height: 6px; border-radius: 3px; background: rgba(244, 234, 214, .1); margin-top: 3px; overflow: hidden; }
.dmg-bar i { display: block; height: 100%; background: var(--ember); }
.dmg-row b { font-variant-numeric: tabular-nums; }
.earned { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.earned span { font-size: 12px; padding: 5px 10px; border-radius: 99px; border: 1px solid rgba(255, 207, 90, .45); color: var(--gold); }

/* chest */
.chest-items { display: grid; gap: 10px; width: min(420px, 100%); }
.chest-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); animation: deal .35s cubic-bezier(.2, .9, .3, 1.2) backwards; }
.chest-item.evo { border-color: var(--gold); box-shadow: 0 0 30px rgba(255, 207, 90, .25); }
.chest-item .gl { width: 36px; height: 36px; font-size: 18px; }
.chest-item b { font-size: 15px; }
.chest-item span { font-size: 13px; color: var(--muted); }

/* shop, collection, achievements, settings */
.panel { width: min(760px, 100%); display: grid; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.up {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
}
.up .nm { font-weight: 800; }
.up .ds { font-size: 13px; color: var(--muted); grid-column: 1; }
.pips { display: flex; gap: 4px; grid-column: 1; }
.pips i { width: 14px; height: 5px; border-radius: 3px; background: rgba(244, 234, 214, .14); }
.pips i.on { background: var(--ember); }
.buy {
  grid-row: 1 / span 3; grid-column: 2; cursor: pointer; border: 1px solid rgba(255, 179, 71, .5); border-radius: 10px;
  padding: 9px 12px; background: rgba(255, 179, 71, .12); font-weight: 800; font-size: 14px;
  display: flex; gap: 6px; align-items: center; font-variant-numeric: tabular-nums;
}
.buy:disabled { opacity: .4; cursor: default; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tab { cursor: pointer; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: transparent; font-weight: 600; font-size: 14px; }
.tab[aria-selected="true"] { background: var(--ink); color: #10201b; }
.entry { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.entry .gl { grid-row: span 3; width: 38px; height: 38px; font-size: 18px; }
.entry b { font-size: 15px; }
.entry span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.entry .recipe { color: var(--gold); font-size: 12px; }
.entry.locked { opacity: .5; }
.ach { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; text-align: left; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.ach .medal { grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: rgba(244, 234, 214, .12); }
.ach.got .medal { background: radial-gradient(circle at 35% 35%, #fff2b0, var(--gold) 50%, #a3741a); }
.ach b { font-size: 14px; }
.ach span { font-size: 12px; color: var(--muted); }
.ach .rew { color: var(--ember); }
.setting { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: left; }
.setting label { font-weight: 600; }
.setting input[type="range"] { width: min(220px, 40vw); accent-color: var(--flame); }
.danger { color: var(--blood); border-color: rgba(255, 77, 94, .4) !important; }
.stats-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; text-align: left; font-size: 13px; color: var(--muted); width: min(560px, 100%); }
.stats-list b { color: var(--ink); font-variant-numeric: tabular-nums; float: right; }
.build { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chip { font-size: 12px; font-weight: 600; padding: 5px 9px 5px 6px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); display: flex; gap: 6px; align-items: center; }
.chip i { width: 10px; height: 10px; border-radius: 50%; }
.chip.evo { border-color: var(--gold); color: var(--gold); }

@media (prefers-reduced-motion: reduce) { .card, .banner.show, .chest-item, .toast { animation-duration: .01s; } }
@media (max-width: 560px) { .flame-bar { width: 64px; } .flame-meter span { display: none; } }
