/* play.thehaugenproject.com: same look as the main site (tokens copied from its style.css) */
:root {
  --bg: #f6f6f3; --ink: #141414; --muted: #76767a; --faint: #b9b9bc; --line: #dfdfdb; --panel: #efefeb;
  --accent: #82439d; --accent-soft: rgba(130, 67, 157, .13); --err: #c75b90;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Consolas, monospace;
  /* rarity: always shown with its name and pips too, never color alone */
  --r-common: #8a8a90; --r-uncommon: #3f8f5a; --r-rare: #2a83b5; --r-epic: #a447b0; --r-legendary: #c27a1e; --r-mythic: #c43d5c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #110f15; --ink: #ecebee; --muted: #918c99; --faint: #4d4856; --line: #29252f; --panel: #18151d;
    --accent: #ce99e5; --accent-soft: rgba(206, 153, 229, .15); --err: #e281ad;
    --r-common: #a3a3a8; --r-uncommon: #5fb87e; --r-rare: #5aaee0; --r-epic: #c98ad8; --r-legendary: #e0a04a; --r-mythic: #ec7590;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 3px; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }

.page { max-width: 1040px; margin: 0 auto; padding: 28px 20px 80px; display: flex; flex-direction: column; gap: 36px; }
.mast { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.mast a { text-decoration: none; }
.mast .name { color: var(--ink); }
.label { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.statement { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 7vw, 64px); line-height: 1.04; margin: 0; }
.statement em { color: var(--accent); }
.lede { color: var(--muted); max-width: 52ch; margin: 0; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; margin: 0; }
h2 .label { display: block; margin-bottom: 4px; }

.btn { font-family: var(--mono); font-size: 14px; background: var(--ink); color: var(--bg); border: 0; padding: 11px 18px; cursor: pointer; border-radius: 4px; }
.btn.alt { background: none; color: var(--ink); border: 1px solid var(--line); }
.btn.big { font-size: 16px; padding: 16px 26px; }
.btn:disabled { opacity: .3; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }
.link { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.link:hover { color: var(--ink); }
.field { font-family: var(--sans); font-size: 17px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 0; width: 100%; }
.field:focus { outline: none; border-bottom-color: var(--accent); }
.status { font-family: var(--mono); font-size: 12px; color: var(--muted); min-height: 1.4em; }
.status.err { color: var(--err); }

/* sign in */
.auth { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; }
.auth form { display: flex; flex-direction: column; gap: 16px; }

/* resources */
.bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.res { padding: 14px 16px 14px 0; }
.res b { display: block; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.res span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.res .fill { height: 3px; background: var(--line); margin-top: 8px; border-radius: 2px; overflow: hidden; }
.res .fill div { height: 100%; background: var(--accent); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.res.chest { display: flex; flex-direction: column; justify-content: center; gap: 6px; align-items: flex-start; }
.res.chest .btn { font-size: 13px; padding: 9px 14px; }

/* the lane and the mine, under the scene */
.stagewrap { display: flex; flex-direction: column; gap: 12px; }
.scene { cursor: pointer; touch-action: manipulation; }
.lane { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.lane-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lane-info h2 { font-size: 30px; }
.lane-acts { display: flex; gap: 16px; align-items: center; }
.minebar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.minebar .label { flex: 1; min-width: 160px; }
.minebar .btn { font-size: 13px; padding: 9px 14px; }
.haul { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border-radius: 6px; background: var(--accent-soft); }
.haul .label { flex: 1; min-width: 200px; color: var(--ink); }
.btn.tiny { font-size: 11px; padding: 5px 9px; margin-top: 6px; align-self: flex-start; }
.btn.alt:disabled { opacity: .45; }
.boss { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; }
.boss-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.boss-head h2 { font-size: 26px; }
.bossbar { height: 10px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bossbar div { height: 100%; background: var(--r-mythic); border-radius: 3px; transition: width .4s ease; }
.boss .lb td { padding: 6px 10px 6px 0; font-size: 14px; }
.rally { border-color: var(--r-legendary, var(--line)); }
.rally-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rally-last { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.claim { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.result-win { color: var(--r-uncommon); }
.result-lose { color: var(--err); }

/* pixel scene and icons */
.scene { display: block; width: 100%; aspect-ratio: 160 / 54; image-rendering: pixelated; image-rendering: crisp-edges; border-radius: 6px; background: #151227; }
.ico { width: 36px; height: 36px; image-rendering: pixelated; flex: none; }
.slot .ico { width: 30px; height: 30px; }

/* hero */
.hero { display: flex; flex-direction: column; gap: 14px; }
.herohead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.power b { font-family: var(--serif); font-weight: 400; font-size: 56px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.power span { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 6px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.stats b { color: var(--ink); font-weight: 500; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.slot { border: 1px dashed var(--line); border-radius: 6px; padding: 10px; min-height: 76px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.slot .row { display: flex; gap: 8px; align-items: center; }
.slot .label { font-size: 10px; }
.slot.filled { border-style: solid; border-left: 3px solid var(--rc, var(--line)); background: var(--panel); }
.slot .nm { font-weight: 500; line-height: 1.25; }

/* forge */
.forge { display: flex; flex-direction: column; gap: 16px; }
.forgebtns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.odds { display: flex; height: 10px; gap: 2px; border-radius: 3px; overflow: hidden; }
.odds div { height: 100%; }
.oddkeys { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.oddkeys i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.upg { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.upg .label { display: block; }

/* items */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.item { border: 1px solid var(--line); border-left: 3px solid var(--rc); border-radius: 6px; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.item.new { animation: pop .35s ease-out; box-shadow: 0 0 0 1px var(--rc); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.item .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.item .head { display: flex; gap: 10px; align-items: center; }
.item .head > div { flex: 1; min-width: 0; }
.item .nm { font-weight: 500; line-height: 1.25; }
.item .rar { font-family: var(--mono); font-size: 11px; color: var(--rc); white-space: nowrap; }
.pips { letter-spacing: 1px; }
.item .meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.item .st { font-family: var(--mono); font-size: 12px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.delta { font-family: var(--mono); font-size: 12px; }
.delta.up { color: var(--r-uncommon); }
.delta.down { color: var(--err); }
.item .acts { display: flex; gap: 8px; margin-top: 2px; }
.item .acts .btn { font-size: 12px; padding: 7px 12px; }
.bagtools { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.empty { font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* leaderboard */
.lb { width: 100%; border-collapse: collapse; font-size: 15px; }
.lb th { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--muted); text-align: left; padding: 0 10px 8px 0; border-bottom: 1px solid var(--line); }
.lb td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); }
.lb td.m { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lb tr.you td:nth-child(2) { color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 13px; padding: 10px 16px; border-radius: 6px; z-index: 10; max-width: calc(100% - 32px); }

@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .page { gap: 28px; }
}
@media (max-width: 520px) {
  .items { grid-template-columns: 1fr 1fr; gap: 8px; }
  .item { padding: 10px; gap: 4px; }
  .item .top { flex-direction: column; gap: 0; }
  .item .acts { flex-direction: column; gap: 6px; }
  .item .acts .btn { width: 100%; }
  .slots { grid-template-columns: repeat(2, 1fr); }
  .res b { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .item.new { animation: none; } }
