* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; font-family: system-ui, sans-serif; color: #fff; }
/* game.js sets the size and place so the picture keeps its shape and whole pixels */
#game { position: fixed; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#hud { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; font-size: 20px; font-weight: 700; background: rgba(0, 0, 0, .5); padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
#power { color: #6fe0ff; }
#hint { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .65); padding: 8px 16px; border-radius: 999px; font-weight: 700; white-space: nowrap; pointer-events: none; }
#minimap { position: fixed; top: 58px; right: 10px; width: min(38vw, 200px); height: auto; image-rendering: pixelated; border: 3px solid #4fd2ff; border-radius: 8px; box-shadow: 0 0 16px #4fd2ff; }
.back { position: fixed; top: 10px; left: 10px; z-index: 5; color: #ffe08a; background: rgba(0, 0, 0, .5); padding: 6px 10px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px 20px 24px; gap: 4px; overflow-y: auto; }
.screen p { max-width: 34em; margin: 4px 0; font-size: 18px; line-height: 1.4; }
.screen button { margin-top: 14px; font: inherit; font-size: 26px; font-weight: 800; padding: 12px 34px; border: 0; border-radius: 999px; background: #5dff6e; color: #12301a; cursor: pointer; box-shadow: 0 5px 0 #2a9a3a; }
#start { background: radial-gradient(circle at 50% 30%, #6b2fa3, #2a0f45 60%, #12051f); }
#start h1 { font-size: clamp(40px, 11vw, 72px); margin: 0 0 6px; color: #ffd23b; text-shadow: 3px 3px 0 #ff3b6b, 6px 6px 0 #3bd1ff; }
.warn { background: #ff3b6b; font-weight: 800; padding: 6px 14px; border-radius: 999px; }
#win { background: radial-gradient(circle, #ffe680, #ff9f3b); color: #3a1a00; }
#win h1 { font-size: clamp(40px, 11vw, 80px); margin: 0; }
#over { background: transparent; }
#over h1 { font-size: clamp(48px, 13vw, 110px); margin: 0; color: #e00000; text-shadow: 0 4px 0 #500, 0 0 30px #f00; letter-spacing: 2px; }
#over p { color: #ffd0d0; }
#controls { position: fixed; bottom: 16px; left: 0; right: 0; display: none; justify-content: space-between; padding: 0 14px; pointer-events: none; }
@media (hover: none), (pointer: coarse) { #controls { display: flex; } }
.pad { display: flex; gap: 12px; pointer-events: auto; }
#controls button { width: 74px; height: 74px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .15); color: #fff; font-size: 30px; touch-action: none; }

.menu { background: radial-gradient(circle at 50% 30%, #6b2fa3, #2a0f45 60%, #12051f); justify-content: flex-start; }
.menu > :first-child { margin-top: auto; }
.menu > :last-child { margin-bottom: auto; }
.menu h1 { font-size: clamp(32px, 9vw, 56px); margin: 0 0 6px; color: #ffd23b; text-shadow: 3px 3px 0 #ff3b6b, 6px 6px 0 #3bd1ff; }
#start h1 { font-size: clamp(40px, 11vw, 72px); }
.row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }
.screen button.alt { background: #ffd23b; color: #3a2400; box-shadow: 0 5px 0 #b8901a; }
.wallet { font-weight: 800; color: #ffe08a; }
#win .wallet { color: #3a1a00; }
.notice { color: #ffb0c0; font-weight: 700; }
.list, .players { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; width: min(100%, 420px); }
.list button { width: 100%; margin: 0; font-size: 20px; padding: 10px 16px; background: #3bd1ff; color: #06283a; box-shadow: 0 4px 0 #1a7fa0; }
.players { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.players li { background: rgba(255, 255, 255, .12); border-radius: 16px; padding: 6px 12px; font-weight: 700; display: flex; flex-direction: column; align-items: center; }
.players canvas { width: 72px; height: 72px; }
#lookPreview { width: 128px; height: 128px; flex-shrink: 0; background: rgba(255, 255, 255, .12); border-radius: 20px; }
#shop { touch-action: pan-y; }
#shop > * { flex-shrink: 0; }
.shop-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 520px; margin: 12px 0; }
.shop-filters button { margin: 0; padding: 9px 14px; min-height: 44px; font-size: 16px; background: #e7ddfa; box-shadow: none; color: #34204e; }
.shop-filters button[aria-pressed="true"] { background: #ffd23b; outline: 2px solid white; }
button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
#colorOptions { max-width: 520px; }
#clothingHint { font-size: 14px; }
.picks { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.picks button { margin: 0; width: 46px; height: 46px; padding: 0; font-size: 24px; border-radius: 50%; background: rgba(255, 255, 255, .15); box-shadow: none; border: 3px solid transparent; }
.picks button.on { border-color: #fff; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; width: min(100%, 520px); margin: 12px 0 0; }
.item { background: rgba(255, 255, 255, .12); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; }
.item .icon { font-size: 34px; }
.item button { margin: 4px 0 0; font-size: 16px; padding: 8px 14px; box-shadow: 0 3px 0 #2a9a3a; }
.item button:disabled { background: #777; color: #ddd; box-shadow: none; cursor: default; }
.item button.wearing { background: #ffd23b; color: #3a2400; box-shadow: 0 3px 0 #b8901a; }
#team { font-size: 16px; }
#spec { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: rgba(80, 0, 0, .75); padding: 8px 18px; border-radius: 18px; font-weight: 700; text-align: center; pointer-events: none; }
.players .kick { margin: 6px 0 0; font-size: 14px; padding: 6px 10px; background: #ff3b6b; color: #fff; box-shadow: 0 3px 0 #a01a3a; }

/* Nickname and high score table on the start screen */
.nick button { margin: 0 0 0 6px; font-size: 16px; padding: 6px 14px; box-shadow: 0 3px 0 #b8901a; }
.screen h2 { margin: 18px 0 0; color: #ffd23b; }
.top { list-style: none; padding: 0; margin: 6px 0; width: min(100%, 360px); }
.top li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 12px; border-radius: 10px; font-size: 18px; }
.top li:nth-child(odd) { background: rgba(255, 255, 255, .1); }
.top li.mine { background: rgba(255, 210, 59, .35); }
.nick input { width: 10em; font: inherit; font-size: 17px; padding: 5px 10px; border: 2px solid #ffd23b; border-radius: 10px; background: rgba(0, 0, 0, .35); color: #fff; }

/* Profile card and secret code */
#cardCanvas { width: min(100%, 480px); height: auto; border-radius: 22px; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
.screen a.btn { margin-top: 12px; font-size: 18px; font-weight: 800; padding: 10px 22px; border-radius: 999px; background: #5dff6e; color: #12301a; text-decoration: none; box-shadow: 0 4px 0 #2a9a3a; }
.code { font-family: ui-monospace, monospace; font-size: 22px !important; font-weight: 800; letter-spacing: 1px; background: rgba(0, 0, 0, .35); border: 2px dashed #ffd23b; border-radius: 12px; padding: 8px 14px; word-break: break-all; user-select: text; -webkit-user-select: text; }
#codeIn { width: 14em; text-transform: uppercase; user-select: text; -webkit-user-select: text; }
#useCode { font-size: 16px; padding: 6px 14px; margin: 0 0 0 6px; box-shadow: 0 3px 0 #2a9a3a; }
