* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #120a2a; touch-action: none; }
body { color: #fff; font-weight: 900; }
#stage { position: absolute; left: 50%; top: 50%; width: 396px; height: 704px; transform-origin: 50% 50%; overflow: hidden; background: #1a0f3a; }
#cv { position: absolute; left: 0; top: 0; width: 396px; height: 704px; image-rendering: auto; }
.hidden { display: none !important; }
.screen { position: absolute; inset: 0; }
img { image-rendering: pixelated; }

.ol { text-shadow: -2px 0 #1b0b3b, 2px 0 #1b0b3b, 0 -2px #1b0b3b, 0 2px #1b0b3b, -2px -2px #1b0b3b, 2px 2px #1b0b3b, -2px 2px #1b0b3b, 2px -2px #1b0b3b, 0 3px 0 #000; }
.panel {
  border-style: solid; border-width: 14px;
  border-image: url(assets/ui-panel.webp) 16% fill / 14px stretch;
  background-clip: padding-box;
}
.btn {
  position: relative; border: 0; color: #fff; font: inherit; font-weight: 900; cursor: pointer;
  border-style: solid; border-width: 10px 14px;
  border-image: url(assets/ui-button.webp) 34% 20% fill / 10px 14px stretch;
  background: transparent; padding: 0 4px; min-height: 44px; min-width: 44px;
  text-shadow: -2px 0 #5a0a3a, 2px 0 #5a0a3a, 0 -2px #5a0a3a, 0 2px #5a0a3a, 0 3px 0 #2a0420;
  transition: transform .08s, filter .12s; line-height: 1.1;
}
.btn:active, .btn.pressed { transform: scale(0.93); }
.btn.focus, .nav.focus { filter: brightness(1.25) drop-shadow(0 0 6px #7fe0ff); transform: scale(1.04); }
.btn.dim { filter: grayscale(0.85) brightness(0.7); }
.btn.cyan { filter: hue-rotate(160deg); }
.btn.cyan.focus { filter: hue-rotate(160deg) brightness(1.25) drop-shadow(0 0 6px #ff7eb6); }
.btn.small { font-size: 15px; }
.btn.big { font-size: 20px; }

/* Title */
#logo { position: absolute; left: 50%; top: 9%; width: 82%; max-height: 30%; object-fit: contain; transform: translateX(-50%); animation: logoIn .7s cubic-bezier(.2,1.6,.4,1) both, floaty 3.2s ease-in-out .7s infinite; image-rendering: auto; }
@keyframes logoIn { from { transform: translateX(-50%) scale(.3) translateY(-60px); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes floaty { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-6px); } }
#startPrompt { position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; font-size: 20px; color: #fff; animation: pulse 1.4s ease-in-out infinite; padding: 0 16px; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.96); } }
.iconBtn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,126,182,.7); background: rgba(27,11,59,.6); color: #ffd27a; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
#trophyBtn { top: 10px; right: 10px; }

/* HUD */
#hud { position: absolute; left: 6px; top: 6px; width: 318px; padding: 0 2px; display: flex; flex-direction: column; gap: 2px; animation: dropIn .3s cubic-bezier(.2,1.5,.4,1) both; }
.hudRow { display: flex; gap: 6px; align-items: center; }
.chip { display: flex; align-items: center; gap: 4px; font-size: 16px; white-space: nowrap; }
.chip img { width: 22px; height: 22px; object-fit: contain; }
.weekChip { background: #ff5fa8; color: #fff; border-radius: 4px; padding: 1px 8px; box-shadow: 0 2px 0 #7a1350; font-size: 15px; }
@keyframes dropIn { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Cards */
#cards { position: absolute; left: 6px; right: 6px; top: calc(302px + var(--ex, 0px)); bottom: 74px; display: flex; flex-direction: column; gap: 4px; }
.card { position: relative; display: flex; align-items: center; gap: 8px; height: 76px; padding: 0 2px; cursor: pointer; animation: slideIn .3s cubic-bezier(.2,1.4,.4,1) both; transition: transform .08s, filter .12s; }
.card:active { transform: scale(.97); }
@keyframes slideIn { from { transform: translateX(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
.portrait { width: 48px; height: 48px; flex: none; border: 2px solid #ff7eb6; background-color: #2b1b5c; background-repeat: no-repeat; image-rendering: auto; border-radius: 4px; }
.cardMid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cardName { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.cardName .f { font-size: 12px; color: #ffd27a; display: flex; align-items: center; gap: 2px; }
.cardName .f img { width: 14px; height: 14px; }
.bar { position: relative; height: 9px; background: #120a2a; border: 1px solid #000; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; }
.barRow { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.barRow img { width: 14px; height: 14px; }
.barRow .bar { flex: 1; }
.jobTag { flex: none; width: 104px; min-height: 44px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; border: 2px solid #fff; border-radius: 6px; box-shadow: 0 3px 0 rgba(0,0,0,.5); padding: 2px 4px; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.jobTag.risk { border-color: #ff4b6e; box-shadow: 0 0 0 2px #ff4b6e, 0 3px 0 rgba(0,0,0,.5); }

/* Bottom bar */
#bottomBar { position: absolute; left: 8px; right: 8px; bottom: 10px; height: 58px; display: flex; gap: 8px; }
#bottomBar .small { width: 90px; font-size: 14px; white-space: nowrap; padding: 0; letter-spacing: -0.5px; }
#bottomBar .big { flex: 1; }

/* Week show caption */
#showCap { position: absolute; left: 0; right: 0; top: calc(410px + var(--ex, 0px)); bottom: 0; }
#showPanel { position: absolute; left: 10px; right: 10px; top: 0; min-height: 150px; padding: 2px 6px; font-size: 15px; animation: popIn .25s cubic-bezier(.2,1.6,.4,1) both; }
#showSkip { position: absolute; right: 14px; bottom: 18px; width: 120px; height: 52px; }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Modal */
#modalWrap { position: absolute; inset: 0; background: rgba(10,4,30,.62); display: flex; align-items: center; justify-content: center; }
#modal { width: 372px; max-height: 660px; padding: 4px 6px; animation: popIn .25s cubic-bezier(.2,1.6,.4,1) both; display: flex; flex-direction: column; gap: 6px; }
.mTitle { font-size: 20px; text-align: center; color: #ffd27a; }
.mBody { font-size: 14px; line-height: 1.45; white-space: pre-line; font-weight: 700; }
.mBtns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mBtns .btn { flex: 1; min-width: 120px; height: 50px; font-size: 15px; }
.scroll { overflow-y: auto; max-height: 470px; display: flex; flex-direction: column; gap: 6px; }

.jobBtn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 54px; padding: 4px 8px; border: 2px solid #fff; border-radius: 6px; color: #fff; font: inherit; cursor: pointer; text-align: left; box-shadow: 0 3px 0 rgba(0,0,0,.5); transition: transform .08s, filter .12s; }
.jobBtn:active { transform: scale(.97); }
.jobBtn .jn { font-size: 16px; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.jobBtn .jd { font-size: 12px; font-weight: 700; opacity: .95; text-shadow: 0 1px 0 #000; }
.jobBtn.sel { outline: 3px solid #ffd27a; }
.jobBtn.locked { filter: grayscale(1) brightness(.6); }

.statGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 13px; }
.statGrid div { display: flex; align-items: center; gap: 4px; }
.statGrid img { width: 18px; height: 18px; }
.itemRow { display: flex; gap: 6px; }
.itemBtn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 64px; border: 2px solid #7fe0ff; border-radius: 6px; background: rgba(27,11,59,.8); color: #fff; font: inherit; font-size: 11px; cursor: pointer; padding: 2px; }
.itemBtn img { width: 30px; height: 30px; object-fit: contain; }
.itemBtn:active { transform: scale(.95); }

.scoutCard { display: flex; gap: 8px; align-items: center; padding: 4px; border: 2px solid #c39bff; border-radius: 6px; background: rgba(27,11,59,.7); }
.scoutCard .portrait { width: 64px; height: 64px; }
.scoutCard .info { flex: 1; font-size: 12px; font-weight: 700; }
.scoutCard .info b { font-size: 15px; font-weight: 900; }
.scoutCard .btn { width: 92px; height: 50px; font-size: 14px; }

.sumRow { display: flex; justify-content: space-between; font-size: 15px; padding: 2px 4px; }
.pos { color: #8fe388; } .neg { color: #ff6b6b; }
.big2 { font-size: 30px; text-align: center; color: #ffd27a; }

#subtitle { position: absolute; left: 16px; right: 16px; top: 80px; z-index: 5; text-align: center; font-size: 15px; background: rgba(10,4,30,.78); border: 2px solid #ff7eb6; border-radius: 6px; padding: 6px 8px; animation: popIn .2s both; pointer-events: none; }
#toast { position: absolute; left: 30px; right: 30px; top: 200px; text-align: center; font-size: 16px; background: rgba(255,95,168,.92); border: 2px solid #fff; border-radius: 6px; padding: 8px; animation: popIn .2s both; pointer-events: none; }

#introWrap { position: absolute; inset: 0; background: #000 url(assets/cover-bg.webp) center/cover; }
#introVid { width: 100%; height: 100%; object-fit: cover; }
#introSub { position: absolute; left: 16px; right: 16px; bottom: 110px; text-align: center; font-size: 16px; }
#introSkip { position: absolute; right: 16px; bottom: 24px; width: 120px; height: 52px; }
