/* Inner pages: leaderboards, replay, story, the retro desktop, privacy, errors; and the PC window. */

/* ===================== page scaffold ===================== */

.page { padding: calc(var(--top) + env(safe-area-inset-top, 0px) + 28px) 0 90px; min-height: 80vh; }
.page-sky { background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom) 380px, var(--paper-2) 381px); position: relative; isolation: isolate; }
.page-head { position: relative; text-align: center; padding-bottom: 26px; }
.page-head .section-title { font-size: clamp(34px, 6vw, 58px); }
.page-head .section-lead { margin: 12px auto 0; color: var(--ink); text-shadow: 0 0 8px rgba(255, 255, 255, .9), 0 0 2px #fff; }
.page-scenery { position: absolute; left: 0; right: 0; top: 0; height: 381px; width: 100%; z-index: -1; }

/* chips / segmented controls */
.seg { display: inline-flex; padding: 5px; gap: 4px; border-radius: 999px; background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--pop); }
.seg button {
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: 17px; color: var(--ink-soft);
  transition: background .2s, color .2s, transform .25s var(--spring);
}
.seg button[aria-selected='true'] { background: linear-gradient(180deg, #8ff07f, var(--go) 60%); color: #fff; -webkit-text-stroke: 3px rgba(30, 30, 80, .55); paint-order: stroke fill; box-shadow: inset 0 -4px 0 var(--go-dark); }
.seg button:active { transform: scale(.94); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 12px; scrollbar-width: thin; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2.5px solid var(--ink);
  background: var(--paper); font-weight: 600; font-size: 15.5px; color: var(--ink); box-shadow: 0 3px 0 var(--ink); transition: transform .2s var(--spring), background .2s;
}
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed='true'] { background: var(--chip-c, var(--gold)); color: #fff; -webkit-text-stroke: 3px rgba(30, 30, 80, .55); paint-order: stroke fill; }
.chip .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--chip-c, var(--gold)); border: 2px solid var(--ink); }
.chip[aria-pressed='true'] .dot { background: #fff; }

/* ===================== leaderboards ===================== */

.boards { display: grid; gap: 18px; }
.boards-tabs { display: flex; justify-content: center; }
.board-filters { display: grid; gap: 4px; }
.board-card { padding: 10px; overflow: hidden; }
.board-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.board-table th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); padding: 4px 10px; font-weight: 600; }
.board-table td { padding: 8px 10px; background: var(--paper-2); font-weight: 600; vertical-align: middle; }
.board-table tr td:first-child { border-radius: 14px 0 0 14px; }
.board-table tr td:last-child { border-radius: 0 14px 14px 0; }
.board-table tbody tr { transition: transform .25s var(--spring); animation: row-in .45s var(--spring) both; animation-delay: calc(var(--i, 0) * 30ms); }
.board-table tbody tr:hover { transform: translateX(4px) scale(1.01); }
.board-table tbody tr.top-1 td { background: linear-gradient(180deg, #fff6c8, #ffe27a); }
.board-table tbody tr.top-2 td { background: #eef1f7; }
.board-table tbody tr.top-3 td { background: #fbe6d6; }
@keyframes row-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score-cell { font-size: 19px; font-weight: 700; }
.name-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.stars { display: inline-flex; gap: 1px; vertical-align: -3px; }
.stars svg { width: 18px; height: 18px; }
.cleared { color: var(--go-dark); }
.crashed { color: var(--berry-dark); }
.watch-btn { min-height: 38px; padding: 0 12px 2px; font-size: 15px; border-radius: 12px; }
.watch-btn svg { width: 16px !important; height: 16px !important; }
.board-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 34px 16px; }
.board-empty .mascot-box { width: 110px; animation: bob 2.6s ease-in-out infinite; }
.board-more { display: flex; justify-content: center; margin-top: 8px; }
.level-chip { --chip-c: var(--plum); }
@media (max-width: 640px) {
  .board-table .hide-sm { display: none; }
  .board-table td { padding: 8px 6px; }
  .score-cell { font-size: 17px; }
  .name-cell { max-width: 120px; }
  .watch-btn .btn-label { display: none; }
  .watch-btn { width: 40px; padding: 0 0 2px; }
}

/* ===================== replay ===================== */

.replay-page { padding-bottom: 60px; }
.replay-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 26px; align-items: start; }
.replay-stage { position: relative; padding: 12px; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--rsky, #7fd4ff), var(--rsky2, #c9f2ff)); border: 3px solid var(--ink); box-shadow: var(--pop-lg); }
.replay-hud { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 10px; }
.hud-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px; background: var(--paper); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-chip small { font-weight: 500; color: var(--ink-soft); font-size: 13px; }
.hud-chip.is-bump { animation: chip-pop .3s var(--out); }
.hud-gold { background: linear-gradient(180deg, #fff6c8, #ffe27a); }
.replay-canvas { width: 100%; aspect-ratio: 1; cursor: pointer; }
.replay-controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.replay-controls .btn-round { width: 50px; height: 50px; }
.scrub { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; height: 14px; border-radius: 999px; border: 2.5px solid var(--ink); background: linear-gradient(90deg, var(--go) var(--p, 0%), var(--paper) var(--p, 0%)); }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); border: 3px solid var(--ink); box-shadow: 0 2px 0 var(--ink); cursor: grab; }
.scrub::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); border: 3px solid var(--ink); cursor: grab; }
.speed-btn { min-width: 64px; font-variant-numeric: tabular-nums; }
.replay-time { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 92px; text-align: right; font-size: 15px; }
.replay-side { display: grid; gap: 16px; }
.replay-info { padding: 20px; display: grid; gap: 10px; }
.replay-info .who { font-size: 26px; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.replay-info .big { font-size: 40px; font-weight: 700; color: #ffd23f; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; line-height: 1; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fact { padding: 8px 10px; border-radius: 14px; background: var(--paper-2); }
.fact b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.fact span { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.replay-cta { padding: 20px; text-align: center; display: grid; gap: 12px; justify-items: center; background: linear-gradient(180deg, #fff6c8, #ffe9a8); }
.replay-cta .mascot-box { width: 80px; animation: bob 2.6s ease-in-out infinite; }
.replay-end {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; border-radius: var(--r-lg);
  background: rgba(30, 28, 70, .45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade-in .3s ease both;
}
.replay-end .card { padding: 22px 26px; text-align: center; display: grid; gap: 10px; justify-items: center; animation: pop-in .5s var(--spring) both; }
.replay-end h2 { font-size: 30px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.82); } }
.replay-msg { min-height: 30px; text-align: center; margin-top: 8px; font-weight: 700; font-size: 18px; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.replay-msg.is-in { animation: pop-in .4s var(--spring); }
.replay-note { font-size: 14px; color: var(--ink-soft); }
@media (max-width: 900px) { .replay-layout { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .replay-stage { padding: 8px; border-radius: 24px; }
  .replay-controls { gap: 6px; flex-wrap: wrap; }
  .replay-controls .scrub { order: 5; flex-basis: 100%; }
  .replay-time { margin-left: auto; }
}

/* ===================== story ===================== */

.story { max-width: 760px; display: grid; gap: 22px; }
.story-card { padding: 24px 26px; display: grid; gap: 12px; }
.story-card h2 { font-size: 26px; }
.story-card p { font-size: 17.5px; }
.story-hero { text-align: center; justify-items: center; }
.story-logo { width: min(320px, 86%); height: auto; image-rendering: auto; }
.story-kicker { font-weight: 700; color: var(--ink-soft); }
.story-shot { position: relative; display: block; width: 100%; min-height: 160px; padding: 0; border: 0; background: none; cursor: pointer; }
.story-shot > .xp-window { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.story-caption { color: var(--ink-soft); font-size: 15px; }
.story-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.awards { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; }
.awards img { max-height: 84px; width: auto; transition: transform .35s var(--spring); }
.awards img:hover { transform: rotate(-6deg) scale(1.12); }
.hof { display: grid; gap: 8px; }
.hof li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--paper-2); font-weight: 600; }
.hof li.is-playing { background: linear-gradient(180deg, #fff6c8, #ffe27a); }
.hof .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hof .who small { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); }
.hof-player { position: relative; min-height: 160px; }
.hof-player > .xp-window { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.desktop-note { display: none; padding: 12px 16px; border-radius: 16px; background: var(--paper-2); border: 2.5px dashed var(--ink-faint); font-weight: 600; text-align: center; }
html.is-touch .desktop-note { display: block; }

/* ===================== the retro desktop ===================== */

.retro-body { overflow: hidden; background: #2a73dc; }
.retro-body main { position: fixed; inset: 0; }
.desk { position: absolute; inset: 0; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; touch-action: none; }
.desk-wall { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.desk-icons { position: absolute; left: 14px; top: 14px; z-index: 1; display: grid; gap: 18px; }
.desk-icon { display: grid; justify-items: center; gap: 4px; width: 84px; padding: 6px 4px; border-radius: 4px; color: #fff; text-decoration: none; font: 12px Tahoma, Verdana, 'Segoe UI', sans-serif; text-align: center; text-shadow: 1px 1px 2px rgba(0, 0, 0, .9); border: 1px dashed transparent; }
.desk-icon:hover, .desk-icon:focus-visible { background: rgba(49, 106, 197, .45); border-color: rgba(255, 255, 255, .5); outline: none; }
.desk-icon img, .desk-icon svg { width: 38px; height: 38px; image-rendering: pixelated; filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .4)); }
.desk-stage { position: relative; z-index: 1; flex: 1; min-height: 0; display: grid; place-items: center; padding: 14px 8px 8px; }
.pc-sizer { position: relative; }
.pc-sizer > .xp-window { position: absolute; top: 0; left: 0; transform-origin: 0 0; animation: win-open .35s var(--out) both; }
@keyframes win-open { from { opacity: 0; transform: scale(.85); } }
.desk-help { position: absolute; right: 14px; top: 14px; z-index: 1; max-width: 250px; padding: 10px 12px; background: #ffffe1; color: #000; border: 1px solid #000; border-radius: 6px; font: 12px/1.4 Tahoma, Verdana, sans-serif; box-shadow: 2px 2px 4px rgba(0, 0, 0, .35); }
.desk-help b { display: block; margin-bottom: 4px; }
.desk-help kbd { display: inline-block; min-width: 18px; padding: 0 4px; border: 1px solid #888; border-bottom-width: 2px; border-radius: 3px; background: #fff; font: 11px Tahoma, sans-serif; text-align: center; }
.desk-help button { float: right; margin: -4px -4px 0 6px; border: 0; background: none; font: bold 13px Tahoma, sans-serif; cursor: pointer; }
.desk-touch { display: none; position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); z-index: 2; padding: 6px 12px; border-radius: 4px; background: #ffffe1; border: 1px solid #000; font: 12px Tahoma, sans-serif; color: #000; white-space: nowrap; }
html.is-touch .desk-touch { display: block; }
/* XP's taskbar: a blue bar with the start button (Windows' flag, as in the game) and a clock. */
.taskbar {
  position: relative; z-index: 2; display: flex; align-items: stretch; height: calc(30px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: linear-gradient(180deg, #1f2f86 0%, #3165c4 3%, #3682e5 6%, #4490e6 10%, #3883e5 12%, #2b71e0 15%, #2663da 18%,
    #235bd6 20%, #2258d5 23%, #2157d6 38%, #245ddb 54%, #2562df 86%, #245fdc 89%, #2158d4 92%, #1d4ec0 95%, #1941a5 98%);
  font: 11px Tahoma, Verdana, 'Segoe UI', sans-serif; color: #fff;
}
.task-start {
  display: flex; align-items: center; gap: 5px; padding: 0 20px 0 8px; border: 0; border-radius: 0 12px 12px 0; color: #fff; text-decoration: none;
  background: linear-gradient(180deg, #3d8f3d 0%, #4ca64c 6%, #3c9a3c 14%, #2f8a2f 50%, #388e3c 86%, #2a6e2a 100%);
  box-shadow: inset -3px 0 4px rgba(0, 0, 0, .25), inset 0 1px 1px rgba(255, 255, 255, .35);
}
.task-start:hover { filter: brightness(1.1); }
.task-start .task-flag { width: 20px; height: 18px; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .35)); }
.task-start i { font: italic bold 17px/1 'Trebuchet MS', Tahoma, sans-serif; text-shadow: 1px 1px 1px rgba(0, 0, 0, .55); }
.task-list { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 6px; }
.task-btn { display: flex; align-items: center; gap: 5px; width: min(160px, 100%); height: 24px; padding: 0 8px; border-radius: 3px; background: #1e52b7; box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .55), inset -1px -1px 1px rgba(255, 255, 255, .12); }
.task-btn img { width: 16px; height: 16px; image-rendering: pixelated; }
.task-btn span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task-tray {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; border-left: 1px solid #1042af;
  background: linear-gradient(180deg, #0c59b9 1%, #139ee9 6%, #18b5f2 10%, #139beb 14%, #1290e8 19%, #0d8dea 63%, #0d9ff1 81%, #0f9eed 88%, #119be9 91%, #1392e2 94%, #137ed7 97%, #095bc9 100%);
  box-shadow: inset 1px 0 1px #18bbff;
}
.task-tray button { width: 20px; height: 20px; padding: 0; border: 0; background: none; color: #fff; display: grid; place-items: center; }
.task-tray svg { width: 16px; height: 16px; }

/* The window (XP Luna blue) and the VB form inside it. */
.xp-window {
  display: inline-flex; flex-direction: column; padding: 0 4px 4px; background: #0831d9; border-radius: 8px 8px 0 0; text-align: left;
  box-shadow: inset 0 0 0 1px #001ea0, 0 12px 32px rgba(0, 0, 0, .45);
}
.xp-title {
  height: 27px; margin: 0 -4px; padding: 0 5px 0 7px; display: flex; align-items: center; gap: 5px; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #0997ff 0%, #0053ee 8%, #0050ee 40%, #0066ff 88%, #0066ff 93%, #005bff 95%, #003dd7 96%, #003dd7 100%);
  color: #fff; font: bold 13px 'Trebuchet MS', Tahoma, sans-serif; text-shadow: 1px 1px 0 #0f1089;
}
.xp-icon { width: 16px; height: 16px; image-rendering: pixelated; }
.xp-caption { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.xp-btns { display: flex; gap: 2px; }
.xp-btn {
  width: 21px; height: 21px; padding: 0; display: grid; place-items: center; border: 1px solid #fff; border-radius: 3px;
  background: radial-gradient(circle at 90% 90%, #0054e9 0%, #2263d5 55%, #4479e4 70%, #a3bbec 90%, #fff 100%); box-shadow: inset 0 -1px 2px 1px #4646ff;
}
.xp-btn svg { width: 10px; height: 10px; fill: none; stroke: #fff; stroke-width: 2; }
.xp-btn:disabled { cursor: default; }
.xp-close { background: radial-gradient(circle at 90% 90%, #cc4600 0%, #dc6527 55%, #cd7546 70%, #ffccb2 90%, #fff 100%); box-shadow: inset 0 -1px 2px 1px #da4600; }
.xp-close:not(:disabled) { cursor: pointer; }
.xp-close:not(:disabled):active { filter: brightness(.85); }
.pc-form {
  position: relative; width: 309px; height: 361px; overflow: hidden; background: #000; color: #d5e9d1; text-align: left;
  font: 11px/normal Tahoma, Verdana, 'MS Sans Serif', sans-serif; user-select: none; -webkit-user-select: none;
}
.pc-field { position: absolute; left: 0; top: 0; width: 310px; height: 310px; image-rendering: pixelated; max-width: none; }
.pc-form > span { position: absolute; box-sizing: border-box; white-space: nowrap; overflow: hidden; }
.pc-press { left: 56px; top: 88px; width: 193px; height: 17px; text-align: center; font-weight: bold; color: #9fd0f9; text-shadow: 1px 1px 0 #000; }
.pc-press[hidden] { display: none; }
.pc-info { left: 0; top: 294px; width: 305px; height: 15px; text-align: center; font: 11px Arial, sans-serif; color: #c0ffc0; text-shadow: 1px 1px 0 #000; }
.pc-best-label, .pc-worst-label { left: 0; width: 97px; height: 17px; padding-top: 1px; background: #2f3957; color: #c8c9df; border: 1px solid #0d1022; }
.pc-best-label { top: 312px; }
.pc-worst-label { top: 328px; }
.pc-best, .pc-worst { left: 40px; width: 57px; height: 17px; padding-top: 2px; text-align: center; color: #c8c9df; }
.pc-best { top: 312px; }
.pc-worst { top: 328px; }
.pc-died { left: 0; top: 344px; width: 97px; height: 17px; padding-top: 1px; text-align: center; background: #000; color: #c0c0ff; border: 1px solid #5a5a7a; }
.pc-score-box { left: 104px; top: 312px; width: 161px; height: 33px; padding: 1px 0 0 1px; background: #000040; border: 1px solid #2a2a6a; }
.pc-bank { left: 109px; top: 328px; width: 49px; height: 15px; }
.pc-big { font: 29px/31px Arial, Helvetica, sans-serif; text-align: center; }
.pc-points { left: 160px; top: 313px; width: 97px; height: 33px; }
.pc-streak { left: 264px; top: 312px; width: 45px; height: 32px; background: #000040; border: 1px solid #d5e9d1; }
.pc-long { left: 104px; top: 344px; width: 206px; height: 17px; padding-top: 1px; text-align: center; background: #000040; }
.pc-form > .pc-line { overflow: visible; }
.pc-timer-track, .pc-timer { top: 310px; height: 2px; }
.pc-timer-track { left: 0; width: 310px; background: #800000; }
.pc-timer { background: #c0ffc0; }
.pc-timer[hidden] { display: none; }
.pc-length-track, .pc-length { top: 358px; height: 3px; }
.pc-length-track { left: 0; width: 310px; background: #800000; }

/* ===================== privacy, errors ===================== */

.prose { max-width: 760px; padding: 26px 28px; display: grid; gap: 14px; }
.prose h2 { font-size: 24px; margin-top: 10px; }
.prose ul { list-style: disc; padding-left: 22px; display: grid; gap: 6px; }
.error-page { text-align: center; display: grid; justify-items: center; gap: 18px; padding-top: 30px; }
.error-page .mascot-box { width: 150px; animation: bob 2.6s ease-in-out infinite; }
.error-code { font-size: 110px; line-height: 1; font-weight: 700; color: #ffd23f; -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink); }
@media (max-width: 1180px), (max-height: 560px) { .desk-help { display: none; } }
