:root {
  --bg: #0b1220;
  --panel: #111a2c;
  --panel2: #16223a;
  --line: #24324f;
  --text: #e8f1ee;
  --muted: #8ea3b8;
  --dim: #5d6f86;
  --mint: #6ef0b0;
  --mint2: #2fd18a;
  --red: #ff5a4e;
  --amber: #ffc857;
  --blue: #5aa9ff;
  --pix: 'Press Start 2P', monospace;
  --vt: 'VT323', monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --type: 'Special Elite', 'Courier New', monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
a { color: inherit; }
button { font: inherit; cursor: pointer; color: inherit; }
[hidden] { display: none !important; }
img { image-rendering: pixelated; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: rgba(11, 18, 32, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--pix); font-size: 14px; letter-spacing: .02em; }
.logo img { border-radius: 8px; }
.coin { display: flex; align-items: center; gap: 8px; font-family: var(--vt); font-size: 22px; }
.coin .tick { color: var(--mint); }
.coin .mc { min-width: 64px; }
.pill { font-family: var(--pix); font-size: 9px; padding: 5px 8px; border-radius: 4px; background: #2a3550; color: var(--muted); }
.pill.live { background: rgba(110, 240, 176, .16); color: var(--mint); }
.pill.live::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--mint); animation: blink 1.2s infinite; }
.ca { font-family: var(--vt); font-size: 18px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; color: var(--muted); }
.links { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ghost, .icon { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 14px; text-decoration: none; color: var(--muted); }
.icon { min-width: 36px; text-align: center; }
.icon.off { opacity: .45; text-decoration: line-through; }
.buy { font-family: var(--pix); font-size: 11px; background: var(--mint); color: #062015; text-decoration: none; padding: 10px 14px; border-radius: 8px; box-shadow: 0 3px 0 #1d9a63; }
.buy:active { transform: translateY(2px); box-shadow: 0 1px 0 #1d9a63; }
.banner { background: linear-gradient(90deg, #1b3b2e, #13263a); color: var(--mint); text-align: center; font-family: var(--vt); font-size: 22px; padding: 6px 12px; border-bottom: 1px solid var(--line); }

/* ---------- layout ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 430px; grid-template-areas: "office desk" "lower desk"; gap: 16px; padding: 16px 18px; max-width: 1640px; margin: 0 auto; align-items: start; }
.office { grid-area: office; }
.desk { grid-area: desk; position: sticky; top: 74px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lower { grid-area: lower; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- the office scene ---------- */
.scene { position: relative; aspect-ratio: 16 / 9; background: #0a1020 url(../img/office.webp) center / cover no-repeat; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); container-type: inline-size; image-rendering: pixelated; }
.scene::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.08) 0 2px, transparent 2px 4px); }
.title-badge, .plaque { position: absolute; top: 3%; background: rgba(8, 14, 26, .86); border: 2px solid var(--line); border-radius: 8px; padding: 1.1cqw 1.4cqw; z-index: 3; }
.title-badge { left: 2%; }
.title-badge small, .plaque small { display: block; font-family: var(--pix); font-size: max(7px, .75cqw); color: var(--muted); letter-spacing: .05em; }
.title-badge b { display: block; margin-top: .6cqw; font-family: var(--pix); font-size: max(10px, 1.35cqw); color: var(--amber); }
.plaque { right: 2%; text-align: right; border-color: #6b5520; background: linear-gradient(180deg, rgba(60, 45, 12, .92), rgba(30, 22, 6, .92)); }
.plaque b { display: block; margin-top: .6cqw; font-family: var(--vt); font-size: max(18px, 2.2cqw); color: var(--amber); line-height: 1; }
.plaque em { display: block; font-style: normal; font-family: var(--vt); font-size: max(14px, 1.4cqw); color: #d9c38a; }
.plaque.flash { animation: plaque 1.2s ease; }
@keyframes plaque { 0%, 100% { transform: none; } 20% { transform: scale(1.08) rotate(-1deg); box-shadow: 0 0 30px rgba(255, 200, 87, .6); } }
.screen { position: absolute; left: 52.6%; top: 31.5%; width: 11.6%; height: 25%; padding: .5cqw .6cqw; background: rgba(4, 22, 14, .78); color: var(--mint); font-family: var(--vt); overflow: hidden; z-index: 2; }
.screen small { display: block; font-size: max(8px, .95cqw); opacity: .75; }
.screen b { display: block; font-size: max(14px, 2.1cqw); font-weight: 400; line-height: 1; margin-top: .3cqw; word-break: break-all; }
.caret { display: inline-block; width: .7cqw; height: 1.3cqw; background: var(--mint); animation: blink .8s steps(1) infinite; }
.screen.done b { color: #fff; }
.bubble { position: absolute; left: 7%; top: 18%; width: 31%; padding: 1.1cqw 1.4cqw; background: #f4f1e6; color: #142018; border: 3px solid #142018; border-radius: 10px; font-family: var(--vt); font-size: max(15px, 1.75cqw); line-height: 1.05; z-index: 3; box-shadow: 4px 4px 0 rgba(0,0,0,.35); transition: transform .2s; }
.bubble::after { content: ''; position: absolute; right: -16px; bottom: 18%; border: 9px solid transparent; border-left-color: #142018; }
.bubble.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: none; } }
.cups { position: absolute; left: 63.5%; top: 79%; display: flex; align-items: baseline; gap: .5cqw; background: rgba(8, 14, 26, .86); border: 2px solid var(--line); border-radius: 8px; padding: .5cqw 1cqw; font-family: var(--vt); z-index: 3; }
.cups .cup { font-size: max(14px, 1.6cqw); }
.cups b { font-size: max(18px, 2.3cqw); color: var(--amber); font-weight: 400; }
.cups small { font-size: max(12px, 1.3cqw); color: var(--muted); }
.cups.bump { animation: pop .4s ease; }
.fly { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.fly .c { position: absolute; font-size: max(18px, 2.4cqw); animation: fly 1.1s cubic-bezier(.3, .7, .4, 1) forwards; }
.fly .c.big { font-size: max(30px, 4.5cqw); }
.fly .tag { position: absolute; font-family: var(--vt); font-size: max(14px, 1.6cqw); color: #fff; background: rgba(0,0,0,.6); padding: 0 .5cqw; border-radius: 4px; white-space: nowrap; animation: rise 2.2s ease forwards; }
.fly .tag.sell { color: #ffb1aa; }
@keyframes fly { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(10px); } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px); } }
.sim { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); white-space: nowrap; font-family: var(--pix); font-size: max(7px, .8cqw); color: var(--amber); background: rgba(0,0,0,.65); padding: .6cqw 1cqw; border-radius: 6px; z-index: 3; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- application bar ---------- */
.app { margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px 14px; }
.app-head, .app-foot { display: flex; justify-content: space-between; gap: 10px; font-family: var(--vt); font-size: 20px; color: var(--muted); }
.app-head b, .app-foot b { color: var(--text); font-weight: 400; }
.next { color: var(--amber); }
.bar { position: relative; height: 26px; margin: 8px 0 6px; background: #0a1222; border: 2px solid var(--line); border-radius: 6px; overflow: visible; }
.fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: repeating-linear-gradient(90deg, var(--mint2) 0 10px, var(--mint) 10px 20px); border-radius: 4px; transition: width 1s ease; }
.ticks { position: absolute; inset: 0; }
.ticks i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #3a4a6a; }
.ticks i.on { background: var(--amber); }
.ticks i span { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); font-family: var(--vt); font-size: 15px; color: var(--dim); white-space: nowrap; }
.ticks i.on span { color: var(--amber); }
.app-foot { margin-top: 18px; }
#mcNow { color: var(--mint); }

/* ---------- review desk ---------- */
.desk-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 6px; }
.desk-head h2 { margin: 0; font-family: var(--pix); font-size: 13px; color: var(--mint); }
.count { font-family: var(--vt); font-size: 19px; color: var(--muted); }
.count b { color: var(--text); font-weight: 400; }
.req { display: flex; gap: 6px; padding: 6px 16px; }
.req input { flex: 1; min-width: 0; background: #0a1222; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 9px 10px; font: 14px var(--sans); }
.req button { background: var(--amber); color: #2a1d00; border: 0; border-radius: 8px; padding: 0 10px; font-family: var(--pix); font-size: 8px; line-height: 1.4; }
.reqmsg { min-height: 18px; padding: 0 16px; font-family: var(--vt); font-size: 18px; color: var(--muted); }
.reqmsg.err { color: var(--red); }
.reqmsg.ok { color: var(--mint); }
.best { margin: 6px 16px 4px; padding: 8px 10px; border: 1px dashed var(--amber); border-radius: 10px; font-family: var(--vt); font-size: 18px; color: #f3dfa6; cursor: pointer; }
.best b { color: var(--amber); font-weight: 400; }
.reviews { list-style: none; margin: 0; padding: 6px 12px 14px; overflow-y: auto; flex: 1; }
.reviews .empty, .orders .empty { color: var(--dim); font-family: var(--vt); font-size: 18px; padding: 10px 4px; }
.rv { position: relative; display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: start; padding: 10px; margin-bottom: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; }
.rv.fresh { animation: slidein .5s ease; border-color: var(--mint2); }
.rv.req::before { content: 'REQUESTED'; position: absolute; top: -7px; left: 70px; font-family: var(--pix); font-size: 7px; background: var(--amber); color: #2a1d00; padding: 2px 5px; border-radius: 3px; }
@keyframes slidein { from { opacity: 0; transform: translateY(-12px); } }
.rv img { width: 52px; height: 52px; border-radius: 8px; background: #0a1222; object-fit: cover; }
.rv .who { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.rv .who a { font-family: var(--vt); font-size: 22px; color: var(--mint); text-decoration: none; }
.rv .who span { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.rv p { margin: 3px 0 5px; font-family: var(--type); font-size: 14px; line-height: 1.3; color: #dfe8e4; }
.rv .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-family: var(--vt); font-size: 16px; color: var(--muted); }
.rv .meta .up { color: var(--mint); }
.rv .meta .down { color: var(--red); }
.rv .share { background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-family: var(--vt); font-size: 16px; color: var(--muted); }
.rv .share:hover { color: var(--text); border-color: var(--mint2); }
.grade { width: 54px; height: 54px; display: grid; place-items: center; font-family: var(--pix); font-size: 17px; border: 3px solid currentColor; border-radius: 50%; transform: rotate(-12deg); opacity: .92; }
.rv.fresh .grade { animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp { 0% { transform: rotate(-12deg) scale(2.4); opacity: 0; } 100% { transform: rotate(-12deg) scale(1); opacity: .92; } }
.g-a { color: var(--mint); } .g-b { color: var(--blue); } .g-c { color: var(--amber); } .g-d { color: #ff9d4e; } .g-f { color: var(--red); }

/* ---------- lower panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.panel h3 { margin: 0 0 8px; font-family: var(--pix); font-size: 11px; color: var(--mint); }
.panel h3 small { display: block; margin-top: 6px; font-family: var(--vt); font-size: 16px; color: var(--dim); }
.orders { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow-y: auto; font-family: var(--vt); font-size: 18px; }
.orders li { display: flex; gap: 8px; align-items: baseline; padding: 4px 2px; border-bottom: 1px dashed #1e2a44; }
.orders li.fresh { animation: slidein .4s ease; }
.orders .w { color: var(--text); }
.orders .s { margin-left: auto; color: var(--mint); }
.orders .side-sell .s { color: var(--red); }
.orders .big { background: rgba(255, 200, 87, .08); }
.orders .t { color: var(--dim); font-size: 15px; min-width: 32px; }
.orders .sim { position: static; transform: none; font-size: 7px; padding: 2px 4px; }
.orders a { text-decoration: none; }
.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li { display: grid; grid-template-columns: 74px 1fr auto; gap: 8px; align-items: center; padding: 6px 2px; border-bottom: 1px dashed #1e2a44; font-family: var(--vt); font-size: 18px; color: var(--dim); }
.ladder li .at { color: var(--muted); }
.ladder li.on { color: var(--text); }
.ladder li.on .at { color: var(--amber); }
.ladder li.on b::after { content: ' ✓'; color: var(--mint); }
.ladder li.next { color: var(--amber); }
.ladder b { font-weight: 400; }
.ladder button { background: transparent; border: 1px solid var(--line); border-radius: 6px; font-family: var(--vt); font-size: 15px; color: var(--muted); padding: 0 6px; }

.foot { max-width: 1640px; margin: 0 auto; padding: 4px 18px 30px; color: var(--dim); font-size: 12px; }

/* ---------- promotion set piece ---------- */
.promo { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(47, 209, 138, .25), rgba(5, 9, 18, .95) 60%); }
.promo-in { position: relative; width: min(760px, 92vw); text-align: center; }
.promo .hero { width: min(240px, 42vw); opacity: 0; transform: translateY(40px) scale(.8); }
.stamp-big { font-family: var(--pix); font-size: clamp(22px, 5vw, 46px); color: var(--red); border: 6px solid var(--red); display: inline-block; padding: 10px 18px; transform: rotate(-8deg) scale(3); opacity: 0; margin-top: -20px; background: rgba(5, 9, 18, .4); }
.promo-title { font-family: var(--pix); font-size: clamp(16px, 3.4vw, 30px); color: var(--amber); margin-top: 22px; opacity: 0; line-height: 1.4; }
.letter { margin: 20px auto 0; max-width: 620px; background: #f4f1e6; color: #142018; padding: 16px 20px; border-radius: 6px; text-align: left; font-family: var(--type); font-size: clamp(14px, 2vw, 18px); line-height: 1.45; opacity: 0; box-shadow: 6px 6px 0 rgba(0, 0, 0, .4); min-height: 120px; }
.letter p { margin: 0 0 10px; }
.letter .sig { font-size: 14px; color: #3c5444; }
.promo .skip { position: absolute; right: 20px; bottom: 20px; background: transparent; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); padding: 6px 12px; }
.confetti { position: fixed; top: -20px; width: 10px; height: 14px; z-index: 51; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- modal, toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(3, 6, 12, .78); padding: 16px; }
.modal-card { position: relative; width: min(680px, 100%); max-height: 90vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.modal-card h2 { margin: 0 0 10px; font-family: var(--pix); font-size: 15px; color: var(--mint); }
.modal-card .lead { font-size: 17px; }
.how li { margin-bottom: 8px; line-height: 1.45; color: #cfdbe0; }
.fine { font-size: 12px; color: var(--dim); }
.close { position: absolute; right: 10px; top: 8px; background: transparent; border: 0; font-size: 26px; color: var(--muted); }
.cardimg { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; image-rendering: auto; }
.cardbtns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cardbtns a, .cardbtns button { flex: 1; text-align: center; text-decoration: none; padding: 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); font-family: var(--pix); font-size: 10px; }
.cardbtns .x { background: #f4f1e6; color: #111; border-color: #f4f1e6; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(80px); background: #f4f1e6; color: #111; font-family: var(--vt); font-size: 20px; padding: 8px 16px; border-radius: 8px; transition: transform .3s; z-index: 70; }
.toast.on { transform: translateX(-50%); }
.tap-hint { position: fixed; right: 16px; bottom: 16px; z-index: 30; font-family: var(--vt); font-size: 17px; color: var(--muted); background: rgba(11, 18, 32, .9); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; transition: opacity .4s; }
.tap-hint.gone { opacity: 0; pointer-events: none; }

/* ---------- phones and narrow screens ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "office" "desk" "lower"; }
  .desk { position: static; max-height: 640px; }
}
@media (max-width: 720px) {
  .top { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .logo span { display: none; }
  .top { flex-wrap: nowrap; }
  .pill { font-size: 7px; padding: 4px 6px; }
  .coin { font-size: 19px; }
  .ghost, #tgLink { display: none; }
  .links { gap: 6px; }
  .buy { padding: 8px 10px; font-size: 9px; }
  .grid { padding: 10px 12px; gap: 12px; }
  .lower { grid-template-columns: minmax(0, 1fr); }
  .bubble { left: 3%; top: 22%; width: 40%; }
  .screen { display: none; }
  .plaque em { display: none; }
  .app-head, .app-foot { font-size: 17px; flex-direction: column; gap: 2px; }
  .ticks i span { display: none; }
  .app-foot { margin-top: 6px; }
  .sim { font-size: 6px; }
  .hide-m { display: none; }
  .bubble { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; width: 42%; left: 2%; }
  .bubble::after { display: none; }
  .rv { grid-template-columns: 44px 1fr auto; }
  .rv img { width: 44px; height: 44px; }
  .grade { width: 46px; height: 46px; font-size: 14px; }
}
