:root {
  --bg: #0b0a08; --panel: #17130e; --panel-2: #211b13; --edge: #4a3b26; --edge-hi: #8a6d3b;
  --text: #e8dcc0; --muted: #a39578; --gold: #ffd100; --red: #e0443a; --green: #3fd65a; --blue: #4aa8ff;
  --q-common: #ffffff; --q-uncommon: #1eff00; --q-rare: #0070dd; --q-epic: #a335ee; --q-legendary: #ff8000;
  --font-head: "Morpheus", "FrizQuadrata", Georgia, serif; --font-body: "FrizQuadrata", Georgia, serif;
  --cell: 48px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; }
body { min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; touch-action: manipulation; display: flex; flex-direction: column; overflow-x: hidden;
  background: radial-gradient(ellipse at 50% -10%, #2a2015 0%, var(--bg) 60%) fixed; }
#app { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 12px 16px 24px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
a { color: var(--gold); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); font-weight: normal; color: var(--gold); margin: 0; letter-spacing: .02em; text-shadow: 0 2px 0 #000; }

.btn { background: linear-gradient(#8b1a10, #5a0f08); border: 1px solid #c9a24a; border-radius: 4px; padding: 8px 16px;
  color: var(--gold); text-shadow: 0 1px 0 #000; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 0 #000; min-height: 40px; }
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.2); } }
.btn:active:not(:disabled) { transform: scale(.96); filter: brightness(.92); }
.btn:disabled { filter: grayscale(1) brightness(.6); cursor: default; }
.btn.small { padding: 4px 10px; min-height: 32px; font-size: 13px; }
.btn.ghost { background: var(--panel-2); border-color: var(--edge); color: var(--text); }
.btn.big { font-size: 20px; padding: 12px 28px; font-family: var(--font-head); }
.panel { background: linear-gradient(180deg, #1c1710, #120f0a 70%); border: 1px solid var(--edge); border-radius: 7px; padding: 14px; position: relative;
  box-shadow: inset 0 0 0 1px #000, inset 0 1px 0 rgba(255,220,150,.07), 0 6px 18px rgba(0,0,0,.55); }
.panel::before { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(138,109,59,.18); border-radius: 5px; pointer-events: none; }
.panel h3 { font-size: 18px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.q-common { color: var(--q-common); } .q-uncommon { color: var(--q-uncommon); } .q-rare { color: var(--q-rare); }
.q-epic { color: var(--q-epic); } .q-legendary { color: var(--q-legendary); }


.hearts { color: var(--red); letter-spacing: 1px; text-shadow: 0 0 6px rgba(224,68,58,.5); }
.hearts .gone { color: #4a2420; text-shadow: none; }
.gold { color: var(--gold); }

.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.panel-head h3 { margin: 0; }
.panel-head .muted { font-size: 12px; margin-left: auto; }

/* vendor */
.shop-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: stretch; }
.storage { min-height: 110px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; align-items: flex-start; padding: 10px;
  border: 1px dashed var(--edge); border-radius: 5px; background: rgba(0,0,0,.3); }
.storage > .muted { font-size: 13px; font-style: italic; margin: auto; }
.storage.drop-hot, .sellzone.drop-hot { border-color: var(--gold); background: rgba(255,209,0,.06); }
.sellzone { border: 1px dashed #6a2a20; border-radius: 5px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #c98a80; font-size: 13px; }
.sellzone.drop-hot { color: var(--gold); }
.fight-row { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.fight-row .btn.big { min-width: 180px; font-size: 24px; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 18px rgba(200,40,20,.35), 0 3px 0 #000; }
.history { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }
.history i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid #000; box-shadow: inset 0 1px 1px rgba(255,255,255,.35); }
.history .w { background: var(--green); } .history .l { background: var(--red); } .history .d { background: var(--muted); }
.selbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 40px; margin-top: 10px; font-size: 13px; }
.selbar > .muted { font-size: 12px; }
.statline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.statline span { font-size: 12px; padding: 3px 8px; border-radius: 10px; background: rgba(0,0,0,.4); border: 1px solid #2c2318; color: var(--muted); }
.statline b { color: var(--text); font-weight: normal; }

/* tooltip (WoW style) */
.tooltip { position: fixed; z-index: 50; max-width: 290px; pointer-events: none; padding: 8px 10px; font-size: 13px; line-height: 1.4;
  background: rgba(8, 10, 24, .95); border: 1px solid #8a8a9a; border-radius: 4px; box-shadow: 0 0 0 1px #000, 0 6px 18px rgba(0,0,0,.6); }
.tooltip .tt-name { font-size: 15px; }
.tooltip .tt-sub { color: #fff; opacity: .85; }
.tooltip .tt-line { color: #1eff00; }
.tooltip .tt-bonus { color: #66c8ff; }
.tooltip .tt-flavor { color: #ffd100; font-style: italic; }
.tooltip .tt-sell { color: #fff; margin-top: 4px; }

.toast { position: fixed; left: 50%; bottom: calc(56px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: rgba(0,0,0,.85);
  color: #ff5a4a; border: 1px solid #6a2a20; padding: 8px 14px; border-radius: 4px; font-size: 14px; }

.end { text-align: center; padding-top: 30px; }
.end h1 { font-size: clamp(44px, 10vw, 80px); }
.end .rec { font-size: 20px; margin: 10px 0 20px; }

.fcp { text-align: center; font-size: 12px; color: #8f8369; padding: 10px 16px 14px; }
.fcp a { color: #9c8a5c; }

@media (max-width: 860px) {
  .board-wrap { padding: 4px; }
  .panel { padding: 10px; }
  #app { padding: 10px 16px 20px; }
}
.end .panel > div { padding: 6px 4px; border-bottom: 1px solid #2c2318; font-size: 14px; }
.end .panel > div:last-child { border-bottom: 0; }
.end h1 { text-shadow: 0 0 30px rgba(255,170,0,.3), 0 3px 0 #000; }

/* rich item card tooltip */
.tooltip.tt-card { --qc: var(--q-common); max-width: 340px; min-width: 250px; padding: 12px 14px 10px; font-size: 14px; line-height: 1.45; color: #e8dcc0; border: 0; border-radius: 6px;
  background: radial-gradient(ellipse at 50% 0%, rgba(60,70,110,.35), transparent 60%), linear-gradient(180deg, #141a2c, #0b0e18 70%);
  box-shadow: 0 0 0 1px #000, 0 0 0 2px #6a5530, 0 0 0 3px #000, inset 0 0 0 1px color-mix(in srgb, var(--qc) 45%, transparent), inset 0 0 22px color-mix(in srgb, var(--qc) 18%, transparent), 0 14px 30px rgba(0,0,0,.8); }
.tooltip.tt-card.r-uncommon { --qc: var(--q-uncommon); } .tooltip.tt-card.r-rare { --qc: var(--q-rare); } .tooltip.tt-card.r-epic { --qc: var(--q-epic); } .tooltip.tt-card.r-legendary { --qc: var(--q-legendary); }
.tooltip.tt-card::before, .tooltip.tt-card::after { content: "❖"; position: absolute; top: 3px; font-size: 11px; color: #c9a24a; text-shadow: 0 0 4px #000; }
.tooltip.tt-card::before { left: 5px; } .tooltip.tt-card::after { right: 5px; }
.tt-head { text-align: center; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid rgba(201,162,74,.35); }
.tt-card .tt-name { font-family: var(--font-head); font-size: 21px; line-height: 1.15; text-shadow: 0 2px 0 #000, 0 0 10px color-mix(in srgb, var(--qc) 50%, transparent); }
.tt-class { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.tt-weapon { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 8px; padding: 6px 4px; border-radius: 4px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(201,162,74,.2); }
.tt-weapon > div { display: flex; flex-direction: column; align-items: center; }
.tt-weapon span { font-size: 10px; color: #a8987a; text-transform: uppercase; letter-spacing: .04em; }
.tt-big { font-size: 17px; color: #fff; font-family: var(--font-head); }
.tt-sect { padding: 6px 0; border-top: 1px solid rgba(201,162,74,.22); }
.tt-sect:first-of-type, .tt-weapon + .tt-sect { border-top: 0; padding-top: 0; }
.tt-card .tt-line { color: #efe4c8; margin: 2px 0; }
.tt-trig { color: #ffd34a; font-weight: 600; }
.tt-num { color: #ffe27a; font-weight: 700; }
.tt-kw { color: #ffd34a; white-space: nowrap; }
.tt-ico, .chip-ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; border-radius: 3px; box-shadow: 0 0 0 1px #000; } /* real WoW status icons (tooltip + status chips) */
.tt-sect.bonus .tt-line { color: #7ad0ff; }
.tt-sect.gloss { font-size: 12.5px; color: #b8ac90; }
.tt-gl { margin: 2px 0; }
.tt-card .tt-flavor { color: #ffd100; font-style: italic; font-size: 13px; padding: 4px 0 2px; text-align: center; opacity: .9; }
.tt-foot { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-top: 6px; padding-top: 7px; border-top: 1px solid rgba(201,162,74,.35); font-size: 13px; }
.tt-rar { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.tt-rar .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor, 0 0 0 1px #000; }
.tt-type { color: #cfc2a2; }
.tt-card .tt-sell { color: #fff; margin: 0; display: flex; align-items: center; gap: 4px; }
.tt-card .coin { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe27a, #d9a014 60%, #9a6a00); box-shadow: 0 0 0 1px #5a3a00; }


@media (pointer: coarse) { .btn.small { min-height: 44px; } }
