/* THE DESK. The game is a collage on kraft card: torn newspaper, coloured strips, labels, tape and stickers.
   Three real layers: card, pasted sheets, labels on the sheets. All tear and shadow is baked into 9-slice images. */
:root, :root[data-sec] { --sheet-img: url(../img/sheet-cream.png); --strip: url(../img/strip-red.png); --strip-ink: #fff6e2; --accent: #a81c12; }
:root[data-sec="bets"] { --sheet-img: url(../img/sheet-green.png); --strip: url(../img/strip-green.png); --accent: #135a31; }
:root[data-sec="stocks"] { --sheet-img: url(../img/sheet-salmon.png); --strip: url(../img/strip-red.png); --accent: #8c1c10; }
:root[data-sec="crypto"] { --sheet-img: url(../img/sheet-yellow.png); --strip: url(../img/strip-ink.png); --accent: #17110a; }
:root[data-sec="team"], :root[data-sec="broker"], :root[data-sec="infra"] { --sheet-img: url(../img/sheet-mint.png); --strip: url(../img/strip-teal.png); --accent: #0d5850; }
:root[data-sec="rating"], :root[data-sec="shady"] { --sheet-img: url(../img/sheet-rose.png); --strip: url(../img/strip-violet.png); --accent: #552174; }
:root[data-sec="profile"], :root[data-sec="skills"] { --strip: url(../img/strip-orange.png); --accent: #94400f; }
:root, :root[data-sec] { --sheet: transparent; }

body { background: url(../img/kraft.png), #c49b68; }
.main { background: linear-gradient(90deg, rgba(40, 22, 4, 0.28), transparent 26px, transparent calc(100% - 26px), rgba(40, 22, 4, 0.2)) scroll, url(../img/kraft.png) local, #c49b68; padding: 18px 26px 40px; }
.page { animation-duration: 0.22s; }
.grid { gap: 24px 26px; }
.g2, .g2e, .g3, .g4, .gmarket, .gbets, .gcrypto { align-items: start; }
.stack { gap: 22px; }

/* ---------- pasted sheets ---------- */
.panel, .sheet, .live-card, .coin, .teambar, .modeline, .issue, .mypos, .cartoon, .trophy.got, .need, .statcard, .clip-host {
  position: relative; background: none; box-shadow: none; outline: 0;
  border: 20px solid transparent; border-image: var(--sheet-img) 40 fill / 20px round; background-clip: border-box; margin: -9px;
}
.panel { padding: 0 0 2px; min-width: 0; }
.sheet { padding: 0 2px 2px; }
.panel:nth-child(odd) > .ph, .panel:nth-child(odd) > h2 { transform: rotate(-0.35deg); }
.panel:nth-child(even) > .ph, .panel:nth-child(even) > h2 { transform: rotate(0.3deg); }
/* tape holds the larger sheets */
.sheet::before {
  content: ''; position: absolute; left: 50%; top: -30px; width: 96px; height: 28px; margin-left: -48px; background: url(../img/tape.png) center / 100% 100% no-repeat; transform: rotate(-2.2deg); pointer-events: none; z-index: 3;
}
.grid > :nth-child(even) > .sheet::before, .stack > .sheet:nth-child(even)::before { transform: rotate(1.8deg); margin-left: -18px; }

/* ---------- section titles: coloured strips ripped by hand ---------- */
.panel > h2, .ph {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--strip-ink); background: none; -webkit-mask: none; mask: none;
  border: 14px solid transparent; border-image: var(--strip) 28 fill / 14px round; padding: 0 6px; margin: -24px -26px 6px; font: 400 15px/1.3 var(--deco); letter-spacing: 0.04em; min-height: 22px;
}
.panel > h2::after, .ph::after { content: none; }
.panel > h2::before { display: none; }
.panel > h2 .term, .ph .term { color: inherit; }
.ph .num { color: inherit; font: 800 13px var(--serif); }
.ph > .row { gap: 4px; }
.panel > h2 .btn, .ph .btn { color: var(--ink); border: 0; border-image: none; background: #fbf4df; padding: 0 8px; font: 800 13px/1.5 var(--serif); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.panel > h2 .btn::after, .ph .btn::after { content: none; }
.panel > h2 .btn:hover:not(:disabled), .ph .btn:hover:not(:disabled) { background: #fff; color: var(--ink); transform: translateY(-1px); }
.sheet > h2, .sheet > .ph { border: 0; border-image: none; background: var(--o-fleuron) center bottom / 150px 10px no-repeat; color: var(--accent); margin: 0 0 8px; padding: 0 0 10px; transform: none; min-height: 0; font-size: 17px; }
.sheet > .ph .btn { background: none; box-shadow: none; border: 1px solid var(--ink); }

/* the page title is the loudest strip on the desk */
.rubric { background: none; padding: 0; margin: 0 0 22px; gap: 10px; align-items: center; flex-wrap: wrap; }
.rubric > div:not(.rub-right) { display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 0; }
.rubric h1, .tabloid-title {
  display: inline-block; color: var(--strip-ink); font: 400 44px/1.02 var(--head); filter: none; border: 14px solid transparent; border-image: var(--strip) 28 fill / 14px round; padding: 0 12px; transform: rotate(-1.1deg); transform-origin: left center; position: relative; z-index: 1; margin-left: -6px;
}
.rubric p { display: inline-block; font: italic 500 15px/1.2 var(--serif); color: var(--ink); background: url(../img/label.png) 0 0 / 0 0; border: 8px solid transparent; border-image: url(../img/label.png) 16 fill / 8px round; margin: -9px 0 0 16px; position: relative; z-index: 2; transform: rotate(0.5deg); padding: 0 4px; }
.rub-right { margin-left: auto; }
.rub-right .seg { border: 10px solid transparent; border-image: url(../img/label.png) 16 fill / 10px round; }

/* art becomes die-cut stickers */
.rubric .art, .clf .art, .clip .art, .heroblock .art, .modal .art, .start-top .art, .live-empty .art, .shadycard .art, .br-head .art {
  filter: drop-shadow(1.5px 0 0 #fbf6e6) drop-shadow(-1.5px 0 0 #fbf6e6) drop-shadow(0 1.5px 0 #fbf6e6) drop-shadow(0 -1.5px 0 #fbf6e6) drop-shadow(1px 3px 2px rgba(30, 15, 0, 0.5));
  background: none;
}
.rubric .art { width: 82px; height: 68px; transform: rotate(-4deg); }

/* ---------- masthead: a long strip of newspaper over the desk ---------- */
.mast { background: url(../img/paper.png), #f6eed6; position: relative; z-index: 4; padding: 6px 18px 5px; }
.logo { color: #17110a; filter: none; background: none; border: 12px solid transparent; border-image: url(../img/strip-yellow.png) 28 fill / 12px round; padding: 0 6px; margin: -6px 0; transform: rotate(-1.4deg); font-size: 31px; }
.kpi.lead { border: 10px solid transparent; border-image: url(../img/label.png) 16 fill / 10px round; margin: -5px 0; transform: rotate(0.6deg); }
.kpi.lead b { width: auto; min-width: 120px; }
/* file tabs */
.nav { background: linear-gradient(#6f4a22, #5c3c1a); border: 0; box-shadow: 0 6px 12px rgba(40, 20, 0, 0.5); position: relative; z-index: 3; margin: 0; }
.nav-main { padding: 7px 14px 0; gap: 3px; }
.nav-main > button, .nav-main > button.on { color: #f8ecd0; background: linear-gradient(#a57a44, #8d6534); border-radius: 8px 10px 0 0 / 11px 12px 0 0; padding: 4px 18px 3px; font-size: 15px; box-shadow: inset 0 1px 0 rgba(255, 235, 190, 0.45), 0 -1px 2px rgba(0, 0, 0, 0.3); transition: transform 0.12s var(--ease), background 0.12s; transform: translateY(2px); }
.nav-main > button::before, .nav-main > button::after, .nav-main > button.on::after { content: none !important; }
.nav-main > button:hover { background: linear-gradient(#b78a50, #9d733c); transform: translateY(0); }
.nav-main > button.on { color: #17110a; background: #f6eed6; transform: none; box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.35); }
.navrank { color: #f8ecd0; }
.nav-sub { background: url(../img/paper.png), #f6eed6; border-top: 0; padding: 1px 14px 3px; box-shadow: 0 2px 3px rgba(40, 20, 0, 0.25); }

/* ---------- the feed: a pile of notes on the right ---------- */
.feed { background: linear-gradient(90deg, rgba(30, 16, 0, 0.3), transparent 14px), url(../img/kraft.png), #b98f5e; border-left: 0; box-shadow: none; padding: 8px 8px 4px 10px; gap: 2px; z-index: 2; }
.feed-sec { border: 20px solid transparent; border-image: var(--sheet-img) 40 fill / 20px round; margin: -7px -7px -9px; min-height: 40px; }
.feed-head { border: 0 !important; background: none; color: var(--accent); padding: 0 2px 2px; border-bottom: 3px double var(--ink) !important; }
.feed-list, .dock { background: none; padding-left: 2px; padding-right: 2px; }
.feed-list { padding-bottom: 8px; }
.cal-box { padding: 2px; }

/* ticker tape runs along the bottom edge */
.tape { background: repeating-linear-gradient(90deg, transparent 0 16px, rgba(40, 20, 0, 0.26) 16px 18px, transparent 18px 34px) 0 2px / 34px 2px repeat-x, url(../img/paper.png), #f8f1dc; color: var(--ink); box-shadow: 0 -5px 10px rgba(40, 20, 0, 0.45); font-weight: 800; }
.tape .up { color: var(--green); }
.tape .down { color: var(--red); }
.tape span.mine b { color: var(--red); text-decoration: underline; }

/* ---------- controls are little labels you can press ---------- */
.btn { border: 7px solid transparent; border-image: url(../img/label.png) 16 fill / 7px round; background: none; padding: 0 5px; transition: transform 0.12s var(--ease); }
.btn.sm { border-width: 6px; border-image-width: 6px; padding: 0 3px; }
.btn:hover:not(:disabled) { color: var(--ink); border-image: url(../img/label.png) 16 fill / 7px round; transform: translateY(-2px) rotate(-0.6deg); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn::after { content: none; }
.btn:disabled { opacity: 0.55; }
.btn.primary, .btn.buy, .btn.sell { border: 12px solid transparent; border-image: var(--strip) 28 fill / 12px round; color: var(--strip-ink); padding: 0 8px; font: 400 16px/1.2 var(--head); }
.btn.primary.sm { border-width: 9px; border-image-width: 9px; font-size: 14px; }
.btn.buy { border-image-source: url(../img/strip-green.png); color: #fff6e2; }
.btn.sell { border-image-source: url(../img/strip-red.png); color: #fff6e2; }
.btn.primary:hover:not(:disabled), .btn.buy:hover:not(:disabled), .btn.sell:hover:not(:disabled) { border-image: var(--strip) 28 fill / 12px round; color: var(--strip-ink); }
.btn.buy:hover:not(:disabled) { border-image-source: url(../img/strip-green.png); }
.btn.sell:hover:not(:disabled) { border-image-source: url(../img/strip-red.png); }
.btn.primary:disabled, .btn.buy:disabled, .btn.sell:disabled { border: 7px solid transparent; border-image: url(../img/label.png) 16 fill / 7px round; color: var(--ink-3); opacity: 0.7; }

/* odds: stubs torn from a betting book */
.odd, .oddbtn { border: 8px solid transparent; border-image: url(../img/label.png) 16 fill / 8px round; background: none; transition: transform 0.12s var(--ease); }
.odd:hover:not(:disabled), .oddbtn:hover:not(:disabled) { color: var(--ink); border-image: url(../img/label.png) 16 fill / 8px round; transform: translateY(-3px) rotate(-1deg); }
.odd:hover:not(:disabled) small { color: var(--ink-2); }
.odd::after, .oddbtn::after { inset: -4px -3px; }
.odd:hover:not(:disabled)::after, .oddbtn:hover:not(:disabled)::after { opacity: 0; }
.odd.sel, .oddbtn.sel { border: 8px solid transparent; border-image: url(../img/strip-ink.png) 28 fill / 8px round; color: #fff6e2; }
.odd.bet, .oddbtn.bet, .odd.bet:hover:not(:disabled), .oddbtn.bet:hover:not(:disabled) { border: 8px solid transparent; border-image: url(../img/strip-red.png) 28 fill / 8px round; color: #fff6e2; }
.odd.sel::after, .oddbtn.sel::after, .odd.bet::after, .oddbtn.bet::after, .odd.bet:hover::after, .oddbtn.bet:hover::after { opacity: 0 !important; }
.odd.sel small, .odd.bet small, .odd.bet:hover small { color: #fff6e2 !important; }
.odd.value { box-shadow: none; border-image-source: url(../img/strip-yellow.png); border-image-slice: 28 fill; }
.oddbtn.best { box-shadow: none; text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 3px; text-underline-offset: 3px; }

.seg button.on, .speeds button.on { color: #fff6e2; }
input.field { background: rgba(255, 252, 240, 0.55); box-shadow: inset 0 1px 3px rgba(40, 20, 0, 0.3); border: 0; border-bottom: 2px solid var(--ink); }

/* ---------- match rows: slips of paper in a pile ---------- */
.match { position: relative; padding: 6px 8px; margin: 0 -8px 2px; border-bottom: 0; background: rgba(255, 252, 238, 0.42); box-shadow: 0 1px 2px rgba(40, 20, 0, 0.32), 0 3px 5px -2px rgba(40, 20, 0, 0.22); overflow: visible; transition: transform 0.14s var(--ease), box-shadow 0.14s; }
.match:nth-child(3n) { transform: rotate(0.14deg); }
.match:nth-child(3n + 1) { transform: rotate(-0.1deg); }
.match:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(40, 20, 0, 0.38); z-index: 2; }
.match.mine { background: rgba(240, 190, 70, 0.62); }
.match.open { border: 0; border-image: none; background: rgba(255, 252, 238, 0.82); box-shadow: 0 4px 14px rgba(40, 20, 0, 0.42); margin: 6px -10px; padding: 10px 12px; transform: none; z-index: 2; }
.match.open.mine { background: rgba(244, 204, 110, 0.8); }
.detail { background: var(--o-swell) center top / 100% 8px no-repeat; }
.mystake { transform: rotate(-1.5deg); background: rgba(255, 246, 226, 0.5); }

/* live cards and coins are the hero objects: they tilt under the cursor */
.live-card, .coin { margin: 0; will-change: auto; }
.live-rail { padding: 6px 6px 14px; height: 304px; }
.live-card { flex-basis: 330px; }
.live-card.mine, .coin.mine { border: 20px solid transparent; border-image: url(../img/sheet-yellow.png) 40 fill / 20px round; background: none; }
.coin { flex: 0 0 186px; padding: 0; }
.coin.mine { flex-basis: 196px; }
.coin:hover { background: none; }
.coin.sel, .coin.sel.mine { -webkit-mask: none; mask: none; background: none; border: 20px solid transparent; border-image: url(../img/strip-ink.png) 28 fill / 20px round; color: #fff6e2; padding: 0; }
.hrail { gap: 2px; padding: 4px 4px 10px; overflow-y: hidden; }
.board { -webkit-mask: none; mask: none; background: #17110a; box-shadow: 0 2px 4px rgba(30, 15, 0, 0.5); transform: rotate(-0.4deg); padding: 5px 9px 6px; }
.memecard { -webkit-mask: none; mask: none; background: none; color: #fff6e2; border: 18px solid transparent; border-image: url(../img/strip-ink.png) 28 fill / 18px round; padding: 0 2px; box-shadow: none; margin: -4px; }
.memecard.mine { box-shadow: none; border-image-source: url(../img/strip-orange.png); }

/* hero number on black ripped paper */
.inv { -webkit-mask: none; mask: none; background: none; border: 22px solid transparent; border-image: url(../img/strip-ink.png) 28 fill / 22px round; padding: 0 6px; margin: -6px -10px 0; outline: 0; color: #fff6e2; }
.watch-head { -webkit-mask: none; mask: none; background: #17110a; }

/* charts live on taped graph paper */
.cvwrap { position: relative; background: linear-gradient(rgba(60, 90, 110, 0.13) 1px, transparent 1px) 0 0 / 100% 20px, linear-gradient(90deg, rgba(60, 90, 110, 0.13) 1px, transparent 1px) 0 0 / 20px 100%, #fbf6e4; border: 0; padding: 6px 4px 4px; box-shadow: 0 2px 5px rgba(40, 20, 0, 0.42), 0 0 0 1px rgba(40, 20, 0, 0.12); transform: rotate(0.12deg); margin: 4px 0 10px; }
.cvwrap::before, .cvwrap::after { content: ''; position: absolute; top: -9px; width: 62px; height: 20px; background: url(../img/tape.png) center / 100% 100% no-repeat; pointer-events: none; }
.cvwrap::before { left: 14px; transform: rotate(-4deg); }
.cvwrap::after { right: 14px; transform: rotate(3deg); }
.dyn { background: none; }

/* stat cards */
.statcard { padding: 0; }

/* ads: little cuttings glued in, each at its own angle */
.clf-strip { background: none; padding-top: 6px; }
.clf-title { color: #17110a; }
.clf { background: none; }
.clf.f-scroll, .clf.f-sign, .clf.f-beads, .clf.f-rope { border: 20px solid transparent; border-image: var(--sheet-img) 40 fill / 20px round; padding: 0 2px; }
.clf.f-black { -webkit-mask: none; mask: none; background: none; border: 20px solid transparent; border-image: url(../img/strip-ink.png) 28 fill / 20px round; padding: 0 2px; margin: 0; outline: 0; }
.clf:nth-child(1) { transform: rotate(-0.8deg); }
.clf:nth-child(2) { transform: rotate(0.5deg); }
.clf:nth-child(3) { transform: rotate(-0.3deg); }

/* anything that would sit on bare card gets a sheet of its own, so coloured numbers stay readable */
div:has(> .cvwrap), .start-box, .subtabs, .clips:empty {
  position: relative; border: 20px solid transparent; border-image: var(--sheet-img) 40 fill / 20px round; margin: -9px;
}
.cvwrap { margin: 8px 0 4px; }
.start { background: url(../img/kraft.png), #c49b68; }
.start-box { padding: 4px 8px; }
.subtabs { display: inline-flex; margin: -6px -6px 12px; border-width: 10px; border-image: url(../img/label.png) 16 fill / 10px round; }
.bgs, .modes { background: none; }
.live-rail { height: 292px; }

/* online */
.online-start { align-items: flex-start; padding: 26px 26px 60px; }
.online-box { width: 1120px; max-width: 100%; }
.online-err { color: var(--red); font-weight: 800; margin-bottom: 12px; background: #fbf4df; display: inline-block; padding: 3px 10px; box-shadow: 0 1px 3px rgba(40, 20, 0, 0.45); }
.room-chat { height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 4px 2px; margin-bottom: 8px; }
.chat-form { display: flex; gap: 6px; align-items: center; width: 100%; }
.chat-form .field { min-width: 0; flex: 1; font-size: 15px; font-weight: 500; }
.race-board { flex: none; max-height: 190px; }

/* shared market */
.shared-chip { line-height: 1.15; border-left: 3px double var(--ink); padding-left: 12px; white-space: nowrap; }
.shared-chip b { display: block; font: 400 15px var(--deco); color: var(--red); }
.shared-chip small { font: italic 500 13px var(--serif); }
.mute-link { font: italic 500 11px var(--serif); margin-left: 4px; color: var(--ink-3); }

/* start page: three clear doors */
.start-home { width: 1100px; }
.start-sub { font: 400 24px/1.1 var(--head); color: var(--accent); }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 6px 0 18px; }
.mode-card { display: flex; flex-direction: column; background: rgba(255, 252, 238, 0.65); box-shadow: 0 2px 7px rgba(40, 20, 0, 0.4); padding: 12px 14px 14px; transition: transform 0.14s var(--ease), box-shadow 0.14s; }
.mode-card:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(40, 20, 0, 0.42); }
.mode-card:nth-child(1) { transform: rotate(-0.35deg); }
.mode-card:nth-child(3) { transform: rotate(0.35deg); }
.mode-card:nth-child(1):hover, .mode-card:nth-child(3):hover { transform: translateY(-3px); }
.mode-art { display: flex; justify-content: center; height: 78px; }
.mode-art .art { width: 92px; height: 76px; filter: drop-shadow(1.5px 0 0 #fbf6e6) drop-shadow(-1.5px 0 0 #fbf6e6) drop-shadow(0 1.5px 0 #fbf6e6) drop-shadow(0 -1.5px 0 #fbf6e6) drop-shadow(1px 3px 2px rgba(30, 15, 0, 0.45)); }
.mode-card h2 { font: 400 28px/1.1 var(--head); text-align: center; margin-top: 4px; }
.mode-who { font: italic 500 15px/1.2 var(--serif); text-align: center; color: var(--accent); margin-bottom: 8px; padding-bottom: 8px; border-bottom: 3px double var(--ink); }
.mode-card ul { margin: 0 0 12px; padding-left: 18px; font-size: 15px; line-height: 1.3; flex: 1; }
.mode-card li { margin-bottom: 4px; }
.mode-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.age-note { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--ink); font-size: 14px; line-height: 1.25; }
.age-badge { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 3px double var(--red); color: var(--red); font: 800 17px/1 var(--serif); transform: rotate(-6deg); }

/* guided tour: everything dims except the lit target */
#tour { display: none; position: fixed; inset: 0; z-index: 90; }
#tour.on { display: block; }
.tour-block { position: absolute; inset: 0; }
.tour-hole { position: fixed; border-radius: 6px; box-shadow: 0 0 0 9999px rgba(18, 10, 2, 0.72); outline: 3px solid #f4c430; outline-offset: 1px; transition: left 0.28s var(--ease), top 0.28s var(--ease), width 0.28s var(--ease), height 0.28s var(--ease); pointer-events: none; animation: tourPulse 1.8s ease-in-out infinite; }
@keyframes tourPulse { 50% { outline-color: #fff2b8; } }
.tour-box { position: fixed; width: 440px; max-width: calc(100vw - 16px); background: url(../img/paper.png), #f8efd6; border: 3px double var(--ink); box-shadow: 0 12px 30px rgba(10, 5, 0, 0.6); padding: 12px 14px; color: var(--ink); transition: left 0.28s var(--ease), top 0.28s var(--ease), opacity 0.14s; }
#tour.moving .tour-box { opacity: 0; }
.tour-count { font: italic 500 13px var(--serif); color: var(--ink-3); }
.tour-box h3 { margin: 1px 0 4px; font: 400 23px/1.1 var(--head); color: var(--red); }
.tour-text { font-size: 15.5px; line-height: 1.34; margin: 0 0 9px; }
.tour-text ul { margin: 0; padding: 0; list-style: none; }
.tour-text li { margin: 0 0 7px; padding-left: 14px; position: relative; }
.tour-text li::before { content: ''; position: absolute; left: 1px; top: 8px; width: 6px; height: 6px; background: var(--red); transform: rotate(45deg); }
.tour-art { margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--ink); background: rgba(255, 250, 232, 0.55); }
.tour-svg { display: block; width: 100%; height: auto; font: 500 13px var(--serif); fill: var(--ink); }
.tour-cap { font: italic 500 13px var(--serif); color: var(--ink-2); margin-top: 2px; }
.tour-rowh { display: flex; justify-content: space-between; font: italic 500 13px var(--serif); color: var(--ink-2); margin-bottom: 4px; }
.tour-row { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; font-size: 15px; margin-top: 3px; }
.tour-row em { font-style: normal; font-weight: 800; text-align: right; }
.tour-meter { height: 11px; border: 1px solid var(--ink); }
.tour-meter i { display: block; height: 100%; background: var(--ink); }
.tour-meter.red i { background: var(--red); }
.tour-bar { height: 4px; background: rgba(18, 11, 5, 0.15); margin-bottom: 9px; }
.tour-bar i { display: block; height: 100%; background: var(--red); transition: width 0.25s; }
.tour-btns { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-links { display: flex; gap: 12px; }
.tour-move { white-space: nowrap; }
.tour-skip { background: none; border: 0; padding: 0; font: 500 14px var(--serif); text-decoration: underline; cursor: pointer; color: var(--ink-2); }
.tour-btns .btn:disabled { visibility: hidden; }
.tour-hand { position: fixed; width: 38px; height: 38px; margin-left: -12px; pointer-events: none; animation: tourTap 1.3s ease-in-out infinite; transition: left 0.28s var(--ease), top 0.28s var(--ease); }
@keyframes tourTap { 50% { transform: translateY(-8px); } }

/* the door nobody advertises */
.bm-wrap { display: flex; justify-content: flex-end; margin-top: 10px; }
.bm-door { background: #17110a; color: #8d7f66; border: 0; padding: 3px 10px 4px; font: italic 500 11.5px var(--serif); cursor: pointer; transform: rotate(-1.5deg); clip-path: polygon(0 12%, 6% 0, 40% 8%, 72% 0, 100% 10%, 97% 92%, 60% 100%, 22% 92%, 2% 100%); opacity: 0.62; transition: opacity 0.2s, color 0.2s; }
.bm-door:hover, .bm-door:focus-visible { opacity: 1; color: #f0e4c4; }

/* the way out of the phone is written on it */
.phone-x { position: absolute; left: -104px; top: 18px; width: 92px; padding: 7px 4px; background: url(../img/paper.png), #f8efd6; color: var(--ink); border: 2px solid var(--ink); box-shadow: 3px 3px 0 rgba(18, 11, 5, 0.75); font: 800 14px var(--serif); cursor: pointer; }
.phone-x:hover { background: var(--ink); color: #f8efd6; }
@media (max-width: 720px) { .phone-x { left: auto; right: 14px; top: -44px; } }

/* big overlays are thick sheets */
.modal, .ticket, .watch { background: none; border: 20px solid transparent; border-image: url(../img/sheet-white.png) 40 fill / 20px round; box-shadow: none; }
.watch { max-height: calc(100vh - 16px); }
.comic { border: 0; }

/* ---------- the lamp: warm light follows the hand across the desk, ink stays black ---------- */
#lamp { position: fixed; left: 0; top: 0; width: 1500px; height: 1500px; margin: -750px 0 0 -750px; z-index: 29; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 228, 170, 0.5), rgba(255, 228, 170, 0.14) 45%, transparent 72%); mix-blend-mode: soft-light; will-change: transform; }

@media (max-width: 1040px) {
  .main { padding: 16px 16px 40px; }
}
@media (max-width: 1040px) {
  .mode-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .rubric h1, .tabloid-title { font-size: 30px; }
  .logo { font-size: 24px; }
  .match { margin: 0 0 2px; }
  #lamp { display: none; }
  .main, .shell, body { overflow-x: clip; }
  .panel, .sheet { margin-left: -4px; margin-right: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  #lamp { display: none; }
}

/* the front door explains itself, under the fold */
.about { width: 1100px; max-width: calc(100% - 32px); margin: 0 auto 30px; padding: 24px 30px; background: url(../img/paper.png), #f8efd6; box-shadow: 0 8px 24px rgba(30, 15, 0, 0.4); font: 500 16px/1.4 var(--serif); color: var(--ink); }
.about h2 { font: 400 28px/1.15 var(--head); color: var(--red); margin: 0 0 8px; }
.about h3 { font: 400 20px/1.2 var(--head); margin: 10px 0 5px; }
.about p { margin: 0 0 8px; }
.about-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 8px 0; }
.about-links { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 20px; margin: 0 0 12px; padding-left: 18px; }
.about a { color: var(--red); }
.about-note { font-size: 14px; font-style: italic; }
body.in-game .about { display: none; }
@media (max-width: 760px) { .about-cols, .about-links { grid-template-columns: 1fr; } .about { padding: 16px; } }
.lang-box { width: 560px; text-align: center; padding: 18px 24px; background: url(../img/paper.png), #f8efd6; box-shadow: 0 8px 24px rgba(30, 15, 0, 0.4); }
.lang-box h1 { font-size: 66px; }
.lang-btns { display: flex; justify-content: center; gap: 12px; }
.lang-btns .btn { font-size: 19px; padding: 10px 26px; }
.lang-switch { text-align: center; margin-top: 8px; font: italic 500 15px var(--serif); }

/* disciplines are drawn */
.sport-ic { display: inline-block; width: 27px; height: 27px; vertical-align: middle; color: var(--ink); }
.sport-ic svg { display: block; width: 100%; height: 100%; }
.board .sport-ic { width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; color: #17110a; }

/* sections and tabs carry a drawing, and the tabs are big enough to be seen */
.nav-ic { display: inline-block; width: 17px; height: 17px; vertical-align: -3px; margin-right: 6px; flex: none; }
.nav-main > button { display: inline-flex; align-items: center; }
.nav-sub { padding: 3px 14px 4px; gap: 4px; }
.nav-sub button, .nav-sub button.on { display: inline-flex; align-items: center; font: 800 16px/1.2 var(--serif); padding: 4px 13px; border-radius: 3px; text-decoration: none; }
.nav-sub button + button::before { content: none; }
.nav-sub button:hover { background: #ecdcb0; }
.nav-sub button.on { color: #17110a; background: #efd98f; box-shadow: inset 0 -3px 0 var(--red); }
.nav-sub .nav-ic { width: 18px; height: 18px; }
.mine-coin { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-bottom: 1px solid rgba(18, 11, 5, 0.25); cursor: pointer; }
.mine-coin:hover { background: rgba(244, 196, 48, 0.18); }
.mine-coin.on { background: rgba(244, 196, 48, 0.35); box-shadow: inset 3px 0 0 var(--red); }
.alert-card { margin-bottom: 14px; box-shadow: 0 0 0 3px var(--red); }

/* live board: a long name wraps beside its crest, never under it */
.scoreline { height: auto; min-height: 42px; }
.scoreline .nm { display: flex; align-items: center; gap: 6px; min-width: 0; font: 800 13.5px/1.12 var(--serif); overflow: visible; -webkit-line-clamp: unset; }
.scoreline .nm:last-child { justify-content: flex-end; text-align: right; }
.scoreline .nm > * { flex: none; }
/* the name is the one thing that may shrink: a single long word breaks instead of running into the score */
.scoreline { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px; }
.scoreline .nm { gap: 4px; }
.scoreline .nm > .nm-t { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; hyphens: manual; }
.scoreline .nm-t.sm { font-size: 11.5px; }
.scoreline .nm-t.xs { font-size: 10px; letter-spacing: -0.01em; }
.scoreline .nm .crest, .scoreline .nm svg { width: 16px; height: 16px; }

/* the channel looks like a channel: masthead, feed, editor */
.ch-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 14px 18px; margin-bottom: 14px; background: url(../img/paper.png), #f8efd6; border-bottom: 4px double var(--ink); box-shadow: 0 6px 14px rgba(30, 15, 0, 0.35); }
.ch-ava { width: 74px; height: 74px; flex: none; border-radius: 50%; border: 3px solid var(--ink); background: #efd98f; overflow: hidden; }
.ch-ava .art { width: 100%; height: 100%; }
.ch-id h1 { margin: 0; font: 400 30px/1.1 var(--head); color: var(--ink); }
.ch-subs { font: italic 500 15px var(--serif); }
.ch-subs b { font: 800 20px var(--serif); font-style: normal; }
.ch-stats { display: flex; gap: 20px; margin-left: auto; }
.ch-stats div { text-align: center; }
.ch-stats b { display: block; font: 800 20px/1.1 var(--serif); }
.ch-stats small { font: italic 500 13px var(--serif); color: var(--ink-2); }
.ch-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ch-post { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px dashed rgba(18, 11, 5, 0.4); }
.ch-pmain { min-width: 0; font-size: 16px; }
.ch-say { margin-top: 3px; font: italic 500 14px var(--serif); color: var(--ink-2); }
.ch-say::before { content: '— '; }
.ch-res { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; }
.ch-res small { font: 800 14px var(--serif); }
.ch-stamp { flex: none; padding: 1px 8px; border: 2px solid currentColor; border-radius: 3px; font: 400 12px var(--deco); text-transform: uppercase; transform: rotate(-4deg); }
.ch-stamp.won { color: #0f6233; }
.ch-stamp.lost { color: var(--red); }
.ch-stamp.wait { color: var(--ink-2); transform: none; }
.ch-match { padding: 8px 0 6px; border-bottom: 1px solid rgba(18, 11, 5, 0.3); }
.ch-mhead { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.ch-match .odds { justify-content: flex-start; flex-wrap: wrap; margin-bottom: 3px; }
.ch-match .odd { flex: 0 1 92px; }
.ch-mk { margin: 6px 0 2px; }
@media (max-width: 760px) { .ch-stats { margin-left: 0; } }

/* ---------- the run: a loud page, still printed on paper ---------- */
.run-hero { display: flex; align-items: center; gap: 16px; padding: 12px 18px; margin: 6px 0 14px; background: #efd98f; border: 3px double var(--ink); }
.run-hero h2 { margin: 0; font: 400 30px/1.1 var(--head); color: var(--red); }
.run-hero p { margin: 2px 0 0; font-size: 15px; line-height: 1.3; }
.run-hero .btn { flex: none; font-size: 19px; padding: 9px 22px; }
.run-hero-art { width: 84px; height: 68px; flex: none; }
.run-hero-art .art { width: 100%; height: 100%; }
.run-intro { width: 980px; max-width: 100%; }
.run-rules { margin: 0 0 12px; padding-left: 20px; font-size: 15px; line-height: 1.35; }
.run-rules li { margin-bottom: 4px; }
.run-me { background: #efd98f; }
.run { position: relative; min-height: 100vh; padding: 10px 14px 20px; background: url(../img/kraft.png), #c49b68; }
.run-hud { display: grid; grid-template-columns: auto minmax(0, 1fr) 150px auto; gap: 18px; align-items: center; padding: 8px 16px; background: url(../img/paper.png), #f8efd6; border-bottom: 4px double var(--ink); box-shadow: 0 5px 12px rgba(30, 15, 0, 0.35); }
.run-round b { display: block; font: 400 25px/1 var(--head); color: var(--red); white-space: nowrap; }
.run-round small { font: italic 500 13px var(--serif); }
.run-worth { font: 800 30px/1 var(--serif); }
.run-q { font: 800 17px var(--serif); align-self: flex-end; }
.run-time b { font: 800 22px/1 var(--serif); }
.run-bar { height: 11px; margin-top: 4px; border: 1px solid var(--ink); background: rgba(255, 250, 232, 0.6); }
.run-bar i { display: block; height: 100%; background: var(--ink); }
.run-bar.ok i { background: #0f6233; }
.run-bar.time i { background: #8a5c00; }
.run-bar.red i { background: var(--red); }
.run-boss { margin: 8px 0 0; padding: 5px 14px; background: #17110a; color: #f0e4c4; font-size: 15px; }
.run-boss b { color: #f4c430; font-weight: 800; }
.run-wifi { background: var(--red); color: #fff5dc; font-weight: 800; }
.run-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; margin-top: 10px; align-items: start; }
.run-left, .run-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.run-assets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.run-asset { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 6px 9px; text-align: left; background: url(../img/paper.png), #f8efd6; border: 1px solid rgba(18, 11, 5, 0.5); cursor: pointer; font: 500 14px var(--serif); color: var(--ink); }
.run-asset:hover { background: #f3e3b4; }
.run-asset.on { box-shadow: inset 0 -4px 0 var(--red); background: #f3e3b4; }
.run-asset.mine { border: 2px solid #8a5c00; }
.run-a-top { display: flex; gap: 6px; align-items: baseline; width: 100%; }
.run-a-top b { font: 800 16px var(--serif); }
.run-a-top .faint { margin-left: auto; }
.run-a-name { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: italic 500 12.5px var(--serif); }
.run-a-price { font: 800 15px var(--serif); }
.run-tag { padding: 0 4px; background: var(--red); color: #fff5dc; font: 800 10.5px var(--serif); }
.run-chart { padding-bottom: 12px; }
.run-sel { font: 800 19px var(--serif); }
.run-sel small { font: italic 500 14px var(--serif); }
.run-ctl { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; }
.run-go { display: flex; gap: 8px; }
.run-go .btn { font-size: 18px; padding: 8px 26px; }
.run-pos { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(18, 11, 5, 0.25); font-size: 15px; }
.run-match { padding: 7px 0; border-bottom: 1px solid rgba(18, 11, 5, 0.25); }
.run-match.mine { background: rgba(244, 196, 48, 0.2); }
.run-m-head { display: flex; justify-content: space-between; font: italic 500 13px var(--serif); }
.run-m-teams { display: grid; grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr); gap: 6px; align-items: center; margin: 2px 0 4px; font: 800 14px/1.12 var(--serif); }
.run-m-teams span:last-child { text-align: right; }
.run-m-teams b { text-align: center; font-size: 19px; }
.run-tip { margin-top: 3px; color: #8a5c00; font-weight: 800; }
.run-news { padding: 4px 0; border-bottom: 1px dashed rgba(18, 11, 5, 0.3); font-size: 14px; line-height: 1.25; color: var(--ink); }
.run-news b { font: 800 11px var(--serif); text-transform: uppercase; }
.run-news.up b { color: #0f6233; }
.run-news.down b { color: var(--red); }
.run-hand { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.run-chip { padding: 2px 10px; background: #efd98f; border: 1px solid var(--ink); font: 800 13px var(--serif); }
.run-moment { position: fixed; left: 50%; bottom: 18px; z-index: 40; width: 560px; max-width: calc(100vw - 20px); transform: translateX(-50%); padding: 10px 16px 14px; background: url(../img/paper.png), #f8efd6; border: 3px double var(--ink); box-shadow: 0 12px 30px rgba(10, 5, 0, 0.6); }
.run-moment p { margin: 6px 0 8px; font: 800 17px/1.25 var(--serif); }
.run-stamp { position: fixed; left: 50%; top: 26%; z-index: 41; padding: 6px 22px; transform: translateX(-50%) rotate(-4deg); background: url(../img/paper.png), #f8efd6; border: 4px solid currentColor; font: 400 30px/1.1 var(--head); text-align: center; pointer-events: none; animation: runStamp 0.18s ease-out; }
.run-stamp.won { color: #0f6233; }
.run-stamp.lost { color: var(--red); }
.run-stamp.wait { color: var(--ink); }
@keyframes runStamp { from { transform: translateX(-50%) rotate(-4deg) scale(1.5); opacity: 0; } }
.run-pause { position: fixed; left: 50%; top: 40%; z-index: 39; transform: translateX(-50%); padding: 8px 30px; background: var(--ink); color: #f0e4c4; font: 400 30px var(--head); }
.run-shop { display: flex; justify-content: center; align-items: flex-start; padding-top: 24px; }
.run-shopbox { width: 900px; max-width: 100%; padding: 16px 22px 20px; background: url(../img/paper.png), #f8efd6; box-shadow: 0 10px 26px rgba(30, 15, 0, 0.45); }
.run-h { margin: 8px 0 10px; font: 400 40px/1.08 var(--head); color: var(--red); text-transform: none; }
.run-lede { font-size: 16px; }
.run-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.run-sum div { padding: 7px 10px; border: 1px solid rgba(18, 11, 5, 0.5); }
.run-sum small { display: block; font: italic 500 13px var(--serif); }
.run-sum b { font: 800 23px/1.15 var(--serif); }
.run-sub { margin: 14px 0 6px; font: 400 22px/1.1 var(--head); }
.run-sub small { font: italic 500 14px var(--serif); }
.run-offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.run-card { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 10px 12px; background: #fff9e8; border: 2px solid var(--ink); box-shadow: 3px 3px 0 rgba(18, 11, 5, 0.6); }
.run-card b { font: 400 19px/1.1 var(--head); color: var(--red); }
.run-card p { flex: 1; margin: 0; font-size: 14px; line-height: 1.28; }
.run-card .btn { align-self: flex-start; }
.run-next { display: block; width: 100%; margin-top: 14px; font-size: 20px; padding: 10px; }
.run-marks { display: flex; gap: 4px; margin: 8px 0; }
.run-marks i { width: 22px; height: 12px; border: 1px solid var(--ink); }
.run-marks i.ok { background: #0f6233; }
.run-marks i.no { background: var(--red); }
@media (max-width: 980px) {
  .run-grid { grid-template-columns: minmax(0, 1fr); }
  .run-hud { grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; }
  .run-assets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .run-offers, .run-sum { grid-template-columns: minmax(0, 1fr); }
  .run-hero { flex-wrap: wrap; }
  .run-worth { font-size: 24px; }
  .run-h { font-size: 30px; }
}

.watch-tools { display: flex; align-items: center; gap: 10px; }
.watch-speed { display: flex; gap: 2px; }
.watch-speed button { background: none; border: 1px solid transparent; color: #f0e4c4; font: 800 12px var(--serif); padding: 5px 7px; cursor: pointer; white-space: nowrap; }
.watch-speed button:hover { border-color: #f0e4c4; }
.watch-speed button.on { background: #f8efd6; color: #120b05; }
.run { overflow-x: clip; }
