* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0d2416; color: #f2f5ef; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
button { white-space: nowrap; font: inherit; border: 0; border-radius: 8px; padding: 7px 12px; background: #2c5a3a; color: #fff; cursor: pointer; touch-action: manipulation; }
button:hover { background: #3a7550; }
button.primary { background: #e8b923; color: #1c1c1c; font-weight: 700; }
button.primary:hover { background: #f5cb3e; }
button:disabled { opacity: .45; cursor: default; }
.hidden { display: none !important; }

/* game page */
body.game { overflow: hidden; overscroll-behavior: none; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); background: #14351f; border-bottom: 2px solid #e8b923; flex: 0 0 auto; }
#bar .back { color: #e8b923; text-decoration: none; font-size: 18px; padding: 4px 6px; }
#bar .titles { flex: 1 1 auto; min-width: 0; line-height: 1.15; }
#bar .t1 { font-weight: 800; font-size: 15px; letter-spacing: .3px; }
#bar .t2 { font-size: 12px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bar .clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; min-width: 70px; text-align: right; }
#panes { flex: 1 1 auto; display: flex; min-height: 0; }
#panes.landscape { flex-direction: row; }
#panes.portrait { flex-direction: column; }
.pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#chasePane { flex: 1 1 58%; }
#side { flex: 1 1 42%; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #1b3a24; }
#panes.landscape #side { border-left: 2px solid #14351f; }
#panes.portrait #chasePane { flex-basis: 54%; }
#panes.portrait #side { flex-basis: 46%; border-top: 2px solid #14351f; }
#mapPane { flex: 1 1 auto; }
#boardPane { flex: 0 1 auto; max-height: 48%; overflow-y: auto; background: #102a19; border-top: 1px solid #2c5a3a; }
#chase, #chase canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#chase canvas { touch-action: none; cursor: grab; }
#map { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - 28px); display: block; touch-action: manipulation; }
#strip { position: absolute; left: 0; bottom: 0; width: 100%; height: 28px; display: block; background: #102a19; }
.paneLabel { position: absolute; right: 8px; top: 6px; z-index: 2; font-size: 11px; padding: 3px 7px; border-radius: 10px; background: rgba(0,0,0,.45); pointer-events: none; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#camCtl { position: absolute; left: 8px; bottom: 8px; z-index: 3; display: flex; gap: 6px; }
#camCtl button { background: rgba(10,25,15,.72); padding: 6px 12px; font-size: 15px; line-height: 1.1; border: 1px solid rgba(255,255,255,.18); }
#camCtl button.primary { background: #e8b923; color: #1c1c1c; border-color: #e8b923; font-size: 13px; }
#camCtl #btnPrev, #camCtl #btnNext { font-size: 20px; padding: 3px 13px 5px; }
#camCtl #btnLeader { font-size: 13px; }
#board { display: grid; grid-auto-flow: column; grid-template-columns: repeat(2, 1fr); gap: 0 4px; margin: 0; padding: 3px 4px; list-style: none; font-size: 12.5px; }
#board li { display: flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 5px; cursor: pointer; white-space: nowrap; min-width: 0; }
#board li:hover { background: rgba(255,255,255,.12); }
#board li.follow { background: rgba(232,185,35,.35); }
#board .pos { width: 14px; text-align: right; font-weight: 700; opacity: .9; }
#board .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.6); flex: 0 0 auto; }
#board .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#board .gap { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; opacity: .85; }
.banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: 34px; font-weight: 900; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.7); pointer-events: none; text-align: center; }
.banner small { display: block; font-size: 15px; font-weight: 600; }
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); z-index: 10; padding: 12px; }
.modal .card { background: #14351f; border: 2px solid #e8b923; border-radius: 12px; padding: 16px 18px; min-width: 260px; max-width: 94vw; max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 4px; }
.modal .sub { opacity: .8; font-size: 13px; margin-bottom: 10px; }
.modal table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.modal td { padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,.1); }
.modal .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 520px), (max-height: 500px) { #bar { padding-top: max(3px, env(safe-area-inset-top)); padding-bottom: 3px; } #bar .t1 { font-size: 14px; } #bar .t2 { font-size: 11px; } #board { font-size: 11.5px; } #board li { padding: 1px 5px; } #camCtl button { padding: 4px 10px; } #camCtl #btnPrev, #camCtl #btnNext { padding: 1px 12px 3px; } .banner { font-size: 26px; } .banner small { font-size: 12px; } #bar .clock { font-size: 15px; min-width: 56px; } button { padding: 6px 9px; } }

/* track list */
body.list { overflow: auto; }
.listHead { padding: 18px 16px 6px; max-width: 980px; margin: 0 auto; }
.listHead h1 { margin: 0 0 6px; color: #e8b923; }
.listHead p { margin: 0; opacity: .85; }
#tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 16px; max-width: 980px; margin: 0 auto; }
.trackCard { display: block; background: #14351f; border-radius: 12px; overflow: hidden; color: inherit; text-decoration: none; border: 1px solid #2c5a3a; }
.trackCard:hover { border-color: #e8b923; }
.trackCard img { width: 100%; height: 180px; object-fit: cover; display: block; }
.trackCard .info { padding: 10px 12px 14px; }
.trackCard h2 { margin: 0; font-size: 19px; }
.trackCard .subt { opacity: .8; font-size: 13px; }
.trackCard .stats { font-size: 12px; color: #e8b923; margin: 6px 0; }
.trackCard p { font-size: 13px; opacity: .85; margin: 0 0 10px; }
.trackCard .go { display: inline-block; background: #e8b923; color: #1c1c1c; font-weight: 700; padding: 6px 12px; border-radius: 8px; }
.foot { text-align: center; font-size: 11px; opacity: .6; padding: 10px 10px 20px; }
.empty { opacity: .8; }
#mapPane .paneLabel { top: auto; bottom: 34px; }
