/* The picture (eth.jpg, upscaled) is the scene. Live parts sit on top of it, in the picture's own
   coordinates (1672 x 941 design pixels), and the whole layer is scaled from JS. */
:root {
  --panel: #00060a;
  --green: #22e8b8;
  --ink: #eef3f0;
  --shot: url('/img/scene3.jpg');
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #050607; color: var(--ink); }
body { overflow: hidden; font-family: 'JetBrains Mono', ui-monospace, monospace; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }

.backdrop { position: fixed; inset: -8%; background: var(--shot) center / cover no-repeat; filter: blur(34px) brightness(.42) saturate(1.15); }

.app { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.win { position: relative; overflow: hidden; flex: none; }
.layer { position: absolute; left: 0; top: 0; width: 1672px; height: 941px; transform-origin: 0 0; }
.scene { position: absolute; left: 0; top: 0; width: 1672px; height: 941px; display: block; user-select: none; -webkit-user-drag: none; }
/* the picture continued past its edges (work/extend.py), so it fills any screen shape */
.scene-ext { position: absolute; left: -500px; top: -250px; width: 2672px; height: 1441px; display: block; user-select: none; pointer-events: none; }

/* ---------------------------------------------------------------- game screen (mapped onto the glass by JS) */
.screen { position: absolute; left: 0; top: 0; width: 742px; height: 416px; transform-origin: 0 0; border-radius: 9px; overflow: hidden; background: #1d4fb8; isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); }
#game { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.scan { position: absolute; inset: 0; pointer-events: none; z-index: 8; background: repeating-linear-gradient(180deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.screen-glass { position: absolute; inset: 0; pointer-events: none; z-index: 9; border-radius: inherit;
  background: linear-gradient(115deg, rgba(255,255,255,.1) 0%, rgba(255,255,255,.03) 24%, transparent 25%), radial-gradient(130% 120% at 50% 50%, transparent 70%, rgba(0,0,0,.3) 100%);
  box-shadow: inset 0 0 14px 2px rgba(0,0,0,.55), inset 0 0 0 2px rgba(0,0,0,.5); }

/* ---------------------------------------------------------------- hardware buttons (copies of the picture) */
.hw, .dpad .face { position: absolute; border: 0; padding: 0; background: var(--shot) no-repeat; background-size: 1672px 941px; }
.hw { transition: transform .06s, filter .06s; }
.hw:focus-visible, .dpad .arm:focus-visible { outline: 2px solid rgba(255,255,255,.35); outline-offset: 2px; }
.round { border-radius: 50%; }
/* X (Twitter) and CA: the picture already has the icons printed on them */
.btn-b { left: 950px; top: 617px; width: 82px; height: 82px; background-position: -950px -617px; }
.btn-a { left: 1064px; top: 583px; width: 82px; height: 82px; background-position: -1064px -583px; }
.btn-link { display: block; cursor: pointer; }
.btn-link:hover { filter: brightness(1.08); }
.btn-link.down, .btn-link:active { transform: translateY(2px) scale(.985); filter: brightness(.82); }
.pill { cursor: default; }
.select { left: 688px; top: 653px; width: 80px; height: 55px; background: none; }
.start { left: 795px; top: 653px; width: 78px; height: 55px; background: none; }
.dpad { position: absolute; left: 447px; top: 574px; width: 166px; height: 153px; }
.dpad .face { inset: 0; background: url('/img/dpad.png') center / 100% 100% no-repeat; transition: transform .06s, filter .06s; } /* the clean d-pad of the first picture (the new one had a stray white cross) */
.dpad .arm { position: absolute; border: 0; padding: 0; background: transparent; cursor: pointer; }
.dpad .up { left: 33%; top: 0; width: 34%; height: 33%; }
.dpad .down { left: 33%; bottom: 0; width: 34%; height: 33%; }
.dpad .left { left: 0; top: 33%; width: 33%; height: 34%; }
.dpad .right { right: 0; top: 33%; width: 33%; height: 34%; }
.dpad.p-up .face { transform: perspective(200px) rotateX(9deg); filter: brightness(.9); }
.dpad.p-down .face { transform: perspective(200px) rotateX(-9deg); filter: brightness(.9); }
.dpad.p-left .face { transform: perspective(200px) rotateY(-9deg); filter: brightness(.9); }
.dpad.p-right .face { transform: perspective(200px) rotateY(9deg); filter: brightness(.9); }
.hw-toast { left: 1048px; top: 562px; transform: translateX(-50%); font: 700 11px/1 'JetBrains Mono', monospace; color: #fff; background: rgba(10,12,14,.85); padding: 4px 7px; border-radius: 4px; letter-spacing: .08em; pointer-events: none; }
.hw-toast[hidden] { display: none; }

/* ---------------------------------------------------------------- left panel overlays */
.ov { position: absolute; }
.patch { background: var(--panel); box-shadow: 0 0 3px 2px var(--panel); border-radius: 2px; }

.lp-bar { left: 201.5px; top: 268.5px; width: 188px; height: 10.5px; border-radius: 7px; background: var(--panel); border: 1.4px solid rgba(96,128,134,.7); box-shadow: 0 0 2px 2px var(--panel); overflow: hidden; }
.lp-bar i { position: absolute; left: 1.5px; top: 1.5px; bottom: 1.5px; width: 0; border-radius: 5px; background: linear-gradient(90deg, #10e0b4, #13f6ca 80%, #7dffe2); box-shadow: 0 0 8px rgba(19,246,202,.7); transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.lp-now { left: 201px; top: 282px; width: 191px; height: 9px; display: flex; justify-content: space-between; align-items: center; font: 400 7.4px/1 'JetBrains Mono', monospace; color: #7d9894; letter-spacing: .02em; background: var(--panel); box-shadow: 0 0 2px 2px var(--panel); }
.lp-now #mcPct { color: var(--green); font-weight: 700; }
.led { left: 381px; top: 247px; width: 5px; height: 5px; border-radius: 50%; background: #2a3432; }
.led.live { background: #13f6ca; box-shadow: 0 0 6px #13f6ca; animation: ledPulse 1.6s infinite; }
.led.warn { background: #ffb23e; box-shadow: 0 0 6px #ffb23e; }
.led.sim { background: #9b7bff; box-shadow: 0 0 6px #9b7bff; }
@keyframes ledPulse { 50% { opacity: .4 } }

.lp-goal { left: 196px; top: 292px; width: 192px; height: 52px; display: flex; align-items: baseline; gap: 8px; padding-left: 2px; }
.lp-goal b { font: 400 64px/50px 'Russo One', sans-serif; color: #fbfdfc; letter-spacing: .3px; }
.lp-goal span { font: 700 28px/1 'JetBrains Mono', monospace; color: #1fe8b6; }
.lp-goal b[data-len='4'] { font-size: 50px; }
.lp-goal b[data-len='5'], .lp-goal b[data-len='6'] { font-size: 41px; }
.lp-goal b.pop { animation: goalPop .9s cubic-bezier(.2,1.6,.4,1); display: inline-block; }
@keyframes goalPop { 0% { transform: scale(.6); color: #13f6ca } 100% { transform: scale(1) } }

/* winners list: the latest three goals and who was drawn for each */
.lp-winners { left: 189px; top: 393px; width: 203px; height: 116px; }
.lp-winners .wn-title { display: none; } /* the picture already prints WINNERS */
.wn-list { list-style: none; margin: 0; padding: 0; position: absolute; left: 5px; right: 4px; top: 0; }
.wn-list li { display: grid; grid-template-columns: 58px 23px 1fr; align-items: center; gap: 6px; height: 38.5px; border-bottom: 1px solid rgba(62,224,160,.1); }
.wn-list li:last-child { border-bottom: 0; }
.wn-goal { font: 500 19px/1 'JetBrains Mono', monospace; color: #f1f4f3; letter-spacing: -.5px; }
.wn-list li.won .wn-goal { color: #f5b50f; }
.wn-av { width: 22px; height: 21px; display: block; border-radius: 3px; }
.wn-empty { border: 1.4px dashed rgba(150,160,160,.5); box-sizing: border-box; }
.wn-addr { font: 500 13px/1 'JetBrains Mono', monospace; color: #dce8f1; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; }
.wn-pending { color: #c8d0d0; letter-spacing: .35em; font-size: 12px; }
.wn-list li.enter { animation: wnIn .6s ease-out both; }
.wn-list li.flash .wn-addr { animation: pcFlash 1.2s; }
.wn-list li.leave { animation: wnOut .45s ease-in forwards; }
@keyframes wnIn { from { opacity: 0; transform: translateY(8px) } }
@keyframes wnOut { to { opacity: 0; transform: translateY(-8px) } }

/* ---------------------------------------------------------------- right panel overlays */
.rp-jack { left: 1302px; top: 266px; width: 136px; height: 30px; display: flex; align-items: center; padding-left: 5px; }
.rp-jack b { font: 700 30.5px/1 'JetBrains Mono', monospace; color: #f4f7f8; white-space: nowrap; letter-spacing: -.5px; }
.rp-fiat { left: 1305px; top: 300.5px; width: 128px; height: 9.5px; display: flex; align-items: center; padding-left: 3px; font: 400 7.6px/1 'JetBrains Mono', monospace; color: #9aa7a6; white-space: nowrap; background: var(--panel); box-shadow: 0 0 2px 2px var(--panel); }
.rp-refresh { left: 1475.5px; top: 337.5px; width: 18px; height: 17px; border-radius: 50%; box-shadow: 0 0 1px 1px var(--panel); }
.rp-refresh img { width: 18px; height: 17px; display: block; }
.rp-refresh img.spin { animation: spin .8s linear; }
@keyframes spin { to { transform: rotate(360deg) } }

.rp-rows { left: 1261px; top: 367px; width: 247px; height: 180px; }
.holders { list-style: none; margin: 0; padding: 0; transform: skewX(2.8deg); transform-origin: 0 0; }
.holders li { position: relative; display: grid; grid-template-columns: 22px 28px 1fr auto; align-items: center; gap: 0 5px; height: 35.8px; padding: 0 9px 0 5px; will-change: transform; }
.holders .rk { font: 700 17px/1 'JetBrains Mono', monospace; color: #f2f5f7; text-align: center; }
.holders li:first-child .rk { color: #f5b50f; }
.holders .av canvas { width: 25px; height: 25px; display: block; border-radius: 4px; }
.holders .ad { font: 600 17px/1 'JetBrains Mono', monospace; color: #eef3f6; letter-spacing: -.6px; white-space: nowrap; overflow: hidden; }
.holders .pc { font: 700 17px/1 'JetBrains Mono', monospace; color: #22e8b8; text-align: right; letter-spacing: -.4px; }
.holders li.empty { display: block; color: #5d6e67; font: 400 11px/32.9px 'JetBrains Mono', monospace; letter-spacing: .06em; padding-left: 10px; }
.holders li.enter { animation: rowIn .6s ease-out both; }
.holders li.flash .pc { animation: pcFlash 1s; }
@keyframes rowIn { from { opacity: 0; transform: translateX(10px) } }
@keyframes pcFlash { 0% { color: #fff; text-shadow: 0 0 6px var(--green) } }

/* ---------------------------------------------------------------- contract chip */
.ca-chip { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 7px 8px 7px 14px; border-radius: 999px; background: rgba(8,12,11,.72); border: 1px solid rgba(34,232,184,.28); backdrop-filter: blur(8px);
  font: 700 12px 'JetBrains Mono', monospace; max-width: calc(100vw - 32px); }
.ca-chip[hidden], .ca-link[hidden] { display: none; }
.ca-sym { color: var(--green); }
.ca-addr { background: none; border: 0; padding: 4px 6px; cursor: pointer; color: #dfe7e3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 6px; font-weight: 400; }
.ca-addr:hover, .ca-addr:focus-visible { background: rgba(255,255,255,.08); outline: none; }
.ca-addr.copied { color: var(--green); }
.ca-link { color: #06100c; background: var(--green); text-decoration: none; padding: 5px 12px; border-radius: 999px; }

/* ---------------------------------------------------------------- phone: console, then each panel, cropped from the same picture */
body.m { overflow-y: auto; }
body.m .app { position: relative; inset: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 10px 0 76px; min-height: 100svh; }
body.m .win { border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.55); }

@media (prefers-reduced-motion: reduce) {
  .led.live, .rp-refresh img.spin { animation: none !important; }
}
