/* Skate Dash: a night-blue room around a bright street, amber for what matters. */
:root {
    --bg: #0f1a30; --card: #17264a; --text: #f4f1e8; --dim: #a9b8d6; --line: rgba(244,241,232,.18); --amber: #ffb02e; --ink: #101a33;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--text); min-height: 100vh;
    background-color: var(--bg);
    background-image: radial-gradient(1000px 520px at 50% -10%, #28418a 0%, transparent 70%);
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.site-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 18px; min-height: 46px; background: #003a7a; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.site-bar a { text-decoration: none; color: #dbe7fb; font-weight: 700; font-size: 14px; }
.site-bar a:hover { color: #fff; }
.site-bar .brand { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: .2px; white-space: nowrap; }
.site-bar nav { display: flex; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.site-bar nav a.on { color: #fff; box-shadow: 0 3px 0 var(--amber); }

.shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 960px) minmax(0, 1fr); gap: 18px; max-width: 1700px; margin: 0 auto; padding: 14px 12px 0; align-items: start; }
.rail { max-width: 300px; width: 100%; justify-self: center; margin-top: 8px; }
.stage { grid-column: 2; min-width: 0; display: grid; gap: 12px; }

.btn { border: 0; border-radius: 12px; background: var(--text); color: var(--ink); font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-weight: 700; font-size: 17px; padding: 10px 18px; box-shadow: 0 4px 0 rgba(0,0,0,.5); transition: transform .08s, box-shadow .08s, filter .15s; text-decoration: none; display: inline-block; text-align: center; line-height: 1.25; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.5); }
.btn.go { background: #5ad17a; font-size: 22px; padding: 12px 34px; }
.btn.sun { background: var(--amber); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn.small { font-size: 14px; padding: 8px 14px; font-family: 'Nunito', sans-serif; font-weight: 800; }
.btn.wa { background: #25d366; color: #05361a; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.wa svg { width: 22px; height: 22px; flex: 0 0 auto; }

.head { text-align: center; padding: 6px 0 0; }
.logo { margin: 0; font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-weight: 700; font-size: clamp(40px, 8vw, 68px); line-height: 1.05; letter-spacing: .5px; text-shadow: 0 4px 0 rgba(0,0,0,.35); }
.logo span { color: var(--amber); }
.tag { margin: 4px auto 0; max-width: 620px; color: var(--dim); font-size: 16px; line-height: 1.5; }

/* the game */
.wrap { position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 0 rgba(0,0,0,.4), 0 18px 40px rgba(0,0,0,.45); background: #4fb7ee; }
#cv { display: block; width: 100%; aspect-ratio: 960 / 600; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.fsbox { display: block; }
.fsbtn { position: absolute; right: 10px; bottom: 10px; z-index: 5; width: 42px; height: 42px; border-radius: 12px; border: 2px solid rgba(255,255,255,.55); background: rgba(15,26,48,.55); color: #fff; padding: 8px; display: grid; place-items: center; backdrop-filter: blur(2px); }
.fsbtn:hover { background: rgba(15,26,48,.8); }
.fsbtn svg { width: 100%; height: 100%; display: block; }
.fsbtn .i-close { display: none; }
.fs .fsbtn .i-open { display: none; } .fs .fsbtn .i-close { display: block; }
.fsbox.fs { position: fixed; inset: 0; z-index: 500; width: 100vw; height: 100vh; height: 100dvh; display: grid; place-items: center; background: #0a1224; }
.fsbox.fs .wrap { width: min(100vw, 160vh); width: min(100vw, 160dvh); border-radius: 0; box-shadow: none; }
.fsbox.fs .fsbtn { right: 14px; bottom: 14px; }
body.fs-lock { overflow: hidden; }
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 14px; pointer-events: none; }
.score { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 700; font-size: clamp(30px, 6vw, 52px); line-height: 1; color: #fff; text-shadow: 0 3px 0 rgba(16,26,51,.55), 0 0 12px rgba(16,26,51,.4); font-variant-numeric: tabular-nums; }
.best { font-weight: 800; font-size: clamp(12px, 2vw, 15px); color: #fff; text-shadow: 0 2px 0 rgba(16,26,51,.6); margin-top: 2px; }
.lvl { margin-top: 2px; font-weight: 800; font-size: clamp(12px, 2vw, 15px); color: #ffe08a; text-shadow: 0 2px 0 rgba(16,26,51,.7); white-space: pre; }
.bonus { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: clamp(24px, 5vw, 34px); color: #fff; margin: 10px 0 4px; }
.card .small { font-size: 13px; opacity: .85; }
.perks { display: grid; gap: 4px; margin-top: 6px; justify-items: start; }
.perk { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 5px; border-radius: 999px; background: rgba(15,26,48,.66); border: 2px solid #7fe3ff; color: #fff; font-weight: 800; font-size: clamp(10px, 1.7vw, 13px); letter-spacing: .3px; text-shadow: 0 1px 0 rgba(0,0,0,.5); white-space: nowrap; }
.perk i { width: clamp(13px, 2.2vw, 18px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e2f8ff, #3cbcf2 60%, #0b78ad); box-shadow: inset 0 0 0 2px #06577f; flex: 0 0 auto; }
.perk small { opacity: .85; font-weight: 700; }
.perk.lj { animation: perkpulse 1s ease-in-out infinite; }
.perk.ff { border-color: #ffb066; }
.perk.lj.charge { animation-duration: .3s; border-color: #fff; background: rgba(35,120,170,.85); }
.perk.ff i { background: radial-gradient(circle at 35% 30%, #ffe3b8, #ff8a3d 60%, #c2410c); box-shadow: inset 0 0 0 2px #8a2f06; }
.perk b { font-variant-numeric: tabular-nums; min-width: 2ch; }
.perk em { display: block; width: clamp(28px, 6vw, 50px); height: 6px; border-radius: 4px; background: rgba(255,255,255,.28); overflow: hidden; }
.perk u { display: block; height: 100%; width: 100%; background: #ffb066; text-decoration: none; }
@keyframes perkpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(127,227,255,.0); } 50% { box-shadow: 0 0 12px 3px rgba(127,227,255,.65); } }
@media (prefers-reduced-motion: reduce) { .perk.lj { animation: none; } }
.card { position: relative; }
.gear { position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px; border-radius: 12px; border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; padding: 8px; display: grid; place-items: center; }
.gear:hover { background: rgba(255,255,255,.18); border-color: var(--amber); color: var(--amber); }
.gear svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.modal { position: fixed; inset: 0; z-index: 600; display: grid; place-items: center; background: rgba(8,14,30,.8); padding: 12px; overflow: auto; }
.modal-card { position: relative; width: min(100%, 660px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; background: #101a33; border: 3px solid var(--amber); border-radius: 20px; padding: 14px 18px 18px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.modal-card h2 { margin: 6px 36px 8px; font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 700; font-size: clamp(20px, 4vw, 26px); color: var(--amber); }
.modal-card .x { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border-radius: 10px; border: 2px solid rgba(255,255,255,.3); background: transparent; color: #fff; font-size: 24px; line-height: 1; padding: 0; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 14px; }
.tile { position: relative; display: grid; justify-items: center; gap: 1px; padding: 6px 4px 8px; border: 3px solid rgba(255,255,255,.2); border-radius: 14px; background: rgba(255,255,255,.06); color: #fff; }
.tile canvas { width: 100%; max-width: 120px; aspect-ratio: 130 / 170; height: auto; border-radius: 10px; display: block; }
.tile b { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 700; font-size: 17px; }
.tile small { color: var(--dim); font-weight: 700; font-size: 12px; }
.tile:hover { border-color: rgba(255,176,46,.6); }
.tile.on { border-color: var(--amber); background: rgba(255,176,46,.16); box-shadow: 0 0 0 2px rgba(255,176,46,.35); }
.tile.on::after { content: '\2713'; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--amber); color: #13221a; font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.savednote { margin: 0 0 10px; color: var(--dim); font-size: 13px; font-weight: 700; }
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile canvas { max-width: 96px; } .gear { width: 34px; height: 34px; padding: 6px; top: 6px; right: 6px; } .modal-card { padding: 12px 12px 14px; } }
.lives { display: flex; gap: 4px; }
.lives i { width: clamp(20px, 4vw, 30px); aspect-ratio: 24 / 22; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 20.500C4 15 1 11 1 7.500A5.500 5.500 0 0 1 12 5A5.500 5.500 0 0 1 23 7.500C23 11 20 15 12 20.500Z' fill='%23ff4d5e' stroke='%23ffffff' stroke-width='1.600'/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(0 2px 0 rgba(16,26,51,.55)); }
.lives i.off { opacity: .28; filter: grayscale(1) drop-shadow(0 2px 0 rgba(16,26,51,.4)); }
.over, .overlay { z-index: 8; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15,26,48,.62); padding: 14px; text-align: center; }
.card { width: min(100%, 470px); background: rgba(15,26,48,.94); border: 3px solid var(--amber); border-radius: 20px; padding: 18px 20px 20px; box-shadow: 0 10px 30px rgba(0,0,0,.55); }
.card h2 { margin: 0 0 6px; font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 700; font-size: clamp(26px, 5vw, 36px); color: var(--amber); }
.card p { margin: 6px 0; color: var(--dim); font-weight: 700; line-height: 1.45; }
.howto { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; gap: 8px; text-align: left; }
.howto li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: center; background: rgba(255,255,255,.06); border-radius: 12px; padding: 8px 10px; font-weight: 700; font-size: 14.5px; line-height: 1.35; }
.howto b { font-family: 'Fredoka', sans-serif; font-size: 22px; color: var(--amber); text-align: center; line-height: 1.1; overflow-wrap: anywhere; }
.howto b.long { font-size: 16px; }
.bigscore { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 700; font-size: 64px; line-height: 1; color: #fff; margin: 4px 0; }
.card .row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.pausemsg { z-index: 8; cursor: pointer; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15,26,48,.55); font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 40px; color: #fff; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.tip { margin: 0; text-align: center; color: var(--dim); font-size: 14px; line-height: 1.5; }

/* ads and the footer */
.adbox { background: rgba(255,255,255,.06); border-radius: 12px; padding: 6px 8px 8px; overflow: hidden; min-width: 0; }
.adbox small { display: block; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.adbox ins { min-height: 90px; }
.rail .adbox ins { min-height: 250px; }
.adbottom { width: calc(100% - 24px); max-width: 980px; margin: 18px auto 0; }
.site-foot { background: #0a1224; color: #a9b8d6; text-align: center; padding: 22px 16px 26px; font-size: 14px; line-height: 1.6; }
.site-foot p { margin: 4px 0; }
.site-foot a { color: #fff; text-decoration: none; font-weight: 700; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .copy { font-size: 12px; opacity: .7; }

/* the text under the game */
.about { background: #f2f4fa; color: #1c2742; margin-top: 30px; padding: 30px 16px 40px; }
.abwrap { max-width: 760px; margin: 0 auto; }
.about h2 { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 700; font-size: 26px; margin: 26px 0 10px; }
.about h2:first-child { margin-top: 0; }
.about p, .rules { line-height: 1.65; }
.rules { padding-left: 22px; } .rules li { margin: 6px 0; }
details { border: 2px solid #d9deec; background: #fff; border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
summary { font-weight: 800; cursor: pointer; }
details p { margin: 8px 0 2px; color: #4a5776; }
.note { margin-top: 24px; color: #5d6a88; font-size: 14px; }

@media (max-width: 1500px) {
    .shell { grid-template-columns: minmax(0, 960px); justify-content: center; }
    .rail { display: none; }
    .stage { grid-column: 1; }
}
@media (max-width: 480px) {
    .site-bar { padding: 0 12px; }
    .site-bar nav a:first-child { display: none; }
    .site-bar nav { gap: 4px 12px; flex-wrap: nowrap; } .site-bar nav a { font-size: 13px; } .site-bar .brand { font-size: 17px; }
    .howto li { grid-template-columns: 46px 1fr; font-size: 13.5px; padding: 6px 8px; }
    .card { padding: 12px 14px 14px; } .howto { margin: 6px 0 10px; gap: 5px; } .bigscore { font-size: 48px; }
    .btn.go { font-size: 19px; padding: 10px 26px; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
/* a small screen: the canvas is only about 230 px high, so the cards over it are compact (and the rules are one line) */
.howto-short { display: none; }
@media (max-width: 860px), (max-height: 480px) {
    .over, .overlay { padding: 8px; }
    .card { padding: 8px 12px 10px; border-width: 2px; border-radius: 16px; }
    .card h2 { font-size: 21px; margin: 0 0 2px; }
    .card p { font-size: 12.5px; margin: 2px 0; line-height: 1.35; }
    .howto { display: none; }
    .howto-short { display: block; }
    .bigscore { font-size: 34px; margin: 0; }
    .bonus { font-size: 20px; margin: 4px 0 0; }
    .card .row { margin-top: 6px; gap: 8px; }
    .btn.go { font-size: 17px; padding: 8px 22px; }
    .card .btn.small { font-size: 12.5px; padding: 8px 10px; }
    .card .small { font-size: 11px; }
    .card h2 { font-size: 19px; }
    .bigscore { font-size: 30px; }
    #overStats { display: none; }
    .card .row .btn.go { font-size: 16px; padding: 7px 18px; }
}
@media (max-width: 380px) { .over { padding: 5px; } #over .card h2 { display: none; } #over .card { padding-top: 6px; } .card p { font-size: 11.5px; margin: 1px 0; } .bigscore { font-size: 28px; } }

