/* EnabledTC — site styles */
@font-face { font-family: "Orbitron"; src: url("../fonts/Orbitron-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/Orbitron-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Michroma"; src: url("../fonts/Michroma-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --night: #0b0614; --night-2: #120a22; --panel: #170e2b; --panel-2: #1e1238; --line: #2e2150;
  --text: #ece8fa; --muted: #b3a9d4; --faint: #8a7fb0;
  --pink: #ff2e88; --orange: #ff8a3d; --cyan: #9fe8ff; --grid: #e0207a;
  --grad: linear-gradient(90deg, var(--pink), var(--orange));
  --radius: 14px; --wrap: 1160px;
  --head: "Orbitron", "Arial Black", sans-serif; --label: "Michroma", "Arial", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--text); font: 17px/1.65 var(--body); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--cyan); color: var(--night); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }

/* type */
h1, h2, h3 { font-family: var(--head); font-weight: 900; line-height: 1.15; letter-spacing: .01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.3rem); }
h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: .02em; }
p { margin: 0 0 1em; }
.eyebrow { font-family: var(--label); font-size: .74rem; letter-spacing: .28em; text-transform: uppercase; color: var(--orange); margin: 0 0 14px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* header */
.site-head { position: sticky; top: 0; z-index: 50; background: rgba(11, 6, 20, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.brand img { width: 210px; height: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text); text-decoration: none; font-family: var(--label); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; padding: 12px 12px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; background: var(--panel-2); }
.nav a.btn { margin-left: 8px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 10px; width: 46px; height: 44px; cursor: pointer; }
.menu-btn svg { margin: auto; }
@media (max-width: 1140px) {
  .menu-btn { display: block; }
  .nav { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 10px 20px 20px; background: var(--night-2); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 10px; }
  .nav a.btn { margin: 8px 0 0; text-align: center; }
  .brand img { width: 170px; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 24px; border-radius: 10px; font-family: var(--label); font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; border: 0; cursor: pointer; }
.btn-primary { background: var(--grad); color: var(--night) !important; font-weight: 700; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: rgba(255, 255, 255, .02); }
.btn-ghost:hover { border-color: var(--cyan); color: #fff; }
.nav a.btn-primary { padding: 10px 18px; min-height: 42px; }
.nav a.btn-primary:hover, .nav a.btn-primary[aria-current="page"] { background: var(--grad); color: var(--night); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* hero with rolling grid */
.hero { position: relative; overflow: hidden; padding: clamp(70px, 11vw, 130px) 0 clamp(150px, 18vw, 210px); text-align: center;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 46, 136, .18), transparent 60%), linear-gradient(#0b0614, #1a0b2e 78%, #0b0614); }
.hero .wrap { position: relative; z-index: 2; }
.hero-logo { width: min(640px, 92%); margin: 0 auto 26px; }
.hero .lead { margin: 0 auto; }
.hero .actions { justify-content: center; }
.grid-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; perspective: 300px; perspective-origin: 50% 0; overflow: hidden; z-index: 1;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%); mask-image: linear-gradient(to bottom, transparent, #000 45%); }
.grid-floor::before { content: ""; position: absolute; left: -100%; right: -100%; top: -40%; bottom: 0; transform-origin: 50% 100%; transform: rotateX(62deg);
  background-image: linear-gradient(var(--grid) 2px, transparent 2px), linear-gradient(90deg, var(--grid) 2px, transparent 2px);
  background-size: 64px 64px; opacity: .55; animation: roll 1.1s linear infinite; }
.grid-floor::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: #ff7ad9; box-shadow: 0 0 18px 4px rgba(255, 46, 136, .6); }
@keyframes roll { to { background-position: 0 64px; } }
.page-hero { padding: 72px 0 56px; border-bottom: 1px solid var(--line); background: linear-gradient(#0b0614, #160b29); position: relative; overflow: hidden; }
.page-hero .grid-floor { height: 60%; opacity: .5; }
.page-hero .wrap { position: relative; z-index: 2; }

/* sections */
section { padding: clamp(60px, 8vw, 96px) 0; }
.section-alt { background: var(--night-2); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; position: relative; }
.card p { color: var(--muted); margin: 0; }
.card .icon { width: 42px; height: 42px; margin-bottom: 16px; color: var(--orange); }
.card a.more { display: inline-block; margin-top: 14px; font-family: var(--label); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; }
.card.feature { border-color: rgba(255, 46, 136, .5); background: linear-gradient(160deg, rgba(255, 46, 136, .10), rgba(255, 138, 61, .04) 60%), var(--panel); }
.badge { display: inline-block; font-family: var(--label); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: var(--grad); color: var(--night); margin-bottom: 14px; font-weight: 700; }

.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 18px 0 0; list-style: none; }
.chips li { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 14px; font-size: .9rem; color: var(--text); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checks li { padding-left: 32px; position: relative; color: var(--muted); }
.checks li strong { color: var(--text); }
.checks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 16px; border-radius: 4px; background: var(--grad); clip-path: polygon(0 0, 50% 0, 50% 50%, 100% 50%, 100% 100%, 50% 100%, 50% 50%, 0 50%); }

/* tables of engines / models */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); }
th { font-family: var(--label); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--orange); background: var(--panel-2); font-weight: 400; }
tr:last-child td { border-bottom: 0; }
td strong { font-family: var(--head); font-weight: 700; letter-spacing: .02em; }

.models { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.model { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; overflow: hidden; position: relative; }
.model::after { content: ""; position: absolute; right: -10px; top: 18px; width: 70px; height: 28px; opacity: .35;
  background: conic-gradient(#fff 25%, transparent 0 50%, #fff 0 75%, transparent 0) 0 0 / 14px 14px; transform: skewX(-10deg); }
.model .chassis { font-family: var(--label); font-size: .7rem; letter-spacing: .2em; color: var(--orange); }
.model h3 { font-size: 1.3rem; margin: 6px 0 8px; font-weight: 900; }
.model p { color: var(--muted); margin: 0; font-size: .95rem; }

.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; color: var(--muted); }
.steps li::before { content: "0" counter(s); display: block; font-family: var(--head); font-weight: 900; font-size: 1.6rem; margin-bottom: 8px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.steps li strong { display: block; color: var(--text); margin-bottom: 4px; }

.callout { border-radius: 18px; padding: clamp(30px, 5vw, 52px); background: linear-gradient(120deg, rgba(255, 46, 136, .16), rgba(255, 138, 61, .10)), var(--panel); border: 1px solid rgba(255, 46, 136, .4); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.callout h2 { margin: 0 0 6px; }
.callout p { margin: 0; color: var(--muted); }
.note { border-left: 3px solid var(--orange); background: var(--panel); padding: 16px 20px; border-radius: 0 10px 10px 0; color: var(--muted); font-size: .95rem; }
.gif-band { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); image-rendering: auto; }

/* contact form */
.form { display: grid; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 4vw, 36px); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form .row { grid-template-columns: 1fr; } }
label { display: block; font-family: var(--label); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
input, select, textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--night); border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; min-height: 48px; }
textarea { min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(159, 232, 255, .2); }
.req { color: var(--pink); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; margin: 0; font-weight: 600; }
.form-status.ok { color: #7dffb5; } .form-status.err { color: #ff8fa8; }
.small { font-size: .88rem; color: var(--faint); }

/* footer */
.site-foot { border-top: 1px solid var(--line); background: var(--night-2); padding: 52px 0 30px; font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 1000px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }
.site-foot h3 { font-family: var(--label); font-weight: 400; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--orange); }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-foot a { color: var(--text); text-decoration: none; }
.site-foot a:hover { color: var(--cyan); }
.foot-logo { width: 220px; margin-bottom: 14px; }
.legal { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 20px; color: var(--faint); font-size: .82rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.coin { font-family: var(--label); letter-spacing: .14em; font-size: .72rem; color: var(--faint) !important; }
.coin:hover { color: #fff060 !important; }

/* fun pages */
.arcade { text-align: center; padding: 60px 0 80px; background: #000; }
.arcade img { margin: 0 auto; width: min(880px, 100%); height: auto; image-rendering: pixelated; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  .grid-floor::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* car landing pages */
a.model { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.model:hover { border-color: var(--pink); transform: translateY(-2px); color: inherit; }
a.model .more { display: inline-block; margin-top: 14px; font-family: var(--label); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 22px; }
.faq details[open] { border-color: rgba(255, 46, 136, .45); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 30px 18px 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 14px; font-family: var(--head); font-size: 1.3rem; color: var(--orange); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 0 0 18px; }
.related a { color: var(--text); text-decoration: none; }
.related li:hover { border-color: var(--cyan); }
@media (max-width: 600px) {
  th, td { padding: 12px 9px; font-size: .88rem; }
  th { font-size: .6rem; letter-spacing: .1em; }
}

/* finishing touch: quick color fades on interactive elements (no delays, nothing on page load) */
a, .btn, .nav a, .menu-btn, .card, .chips li, .faq details, input, select, textarea {
  transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, filter .15s ease;
}
a.model { transition: color .15s ease, border-color .15s ease, transform .15s ease; }
.card:has(a.more:hover) { border-color: rgba(255, 46, 136, .6); }
@media (prefers-reduced-motion: reduce) {
  a, .btn, .nav a, .menu-btn, .card, .chips li, .faq details, input, select, textarea, a.model { transition: none; }
  a.model:hover { transform: none; }
}

/* Tune Rush game */
@font-face { font-family: "PS2P"; src: url("../fonts/PressStart2P-Regular.ttf") format("truetype"); font-display: swap; }
.tr { position: relative; width: min(960px, 100%); margin: 0 auto; }
.tr canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; image-rendering: crisp-edges; background: #000; border-radius: 10px; border: 1px solid var(--line); touch-action: manipulation; cursor: pointer; }
.tr canvas:focus-visible { outline: 3px solid var(--cyan); }
.tr-name { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(11, 6, 20, .95); border: 2px solid var(--pink); border-radius: 12px; padding: 20px; display: grid; gap: 12px; text-align: center; width: min(320px, 90%); }
.tr-name[hidden] { display: none; }
.tr-name label { font-family: "PS2P", var(--label); font-size: .62rem; letter-spacing: .05em; color: #ffd23f; margin: 0; }
.tr-name input { font-family: "PS2P", monospace; font-size: 1.4rem; text-align: center; text-transform: uppercase; letter-spacing: .3em; }
.tr-name button { font-family: "PS2P", monospace; }
.tr-touch { display: none; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 12px; }
.tr.touch .tr-touch { display: grid; }
.tr-touch button { min-height: 64px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-family: "PS2P", monospace; font-size: .8rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.tr-touch button:active { background: var(--pink); color: var(--night); }
.tr-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: .85rem; color: var(--faint); }
.tr-mute { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 10px 14px; min-height: 44px; cursor: pointer; font: inherit; }
.tr-mute:hover { border-color: var(--cyan); }
.tr.touch .tr-keys { display: none; }
a.card.friend { display: block; text-decoration: none; color: inherit; }
a.card.friend:hover { border-color: var(--cyan); }
a.card.friend .more { display: inline-block; margin-top: 14px; font-family: var(--label); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }

/* header "Insert coin" easter egg */
.brand-wrap { display: flex; align-items: center; gap: 16px; }
.coin-top { font-family: "PS2P", monospace; font-size: .5rem; letter-spacing: .08em; text-transform: uppercase; color: #fff060; opacity: .75; text-decoration: none; padding: 8px 4px; white-space: nowrap; animation: coinBlink 1.6s steps(1) infinite; }
.coin-top:hover, .coin-top:focus-visible { opacity: 1; color: #fff060; animation: none; }
@keyframes coinBlink { 0%, 60% { opacity: .75; } 61%, 100% { opacity: .12; } }
@media (max-width: 420px) { .brand-wrap { gap: 10px; } .coin-top { font-size: .42rem; } .brand img { width: 150px; } }
@media (prefers-reduced-motion: reduce) { .coin-top { animation: none; } }

/* ---- Tune Rush v2: name entry, leaderboard, 404 ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tr-name { width: min(360px, 92%); }
.tr-name .tr-row { display: flex; gap: 10px; justify-content: center; }
.tr-name .tr-row .btn { flex: 1; min-height: 44px; padding: 10px 14px; font-size: .62rem; }
.tr-err { margin: 0; min-height: 1.2em; font-size: .85rem; color: #ff6b6b; }
.tr-hint { margin: 0; font-size: .78rem; color: var(--faint); }
.tr-scores { width: min(560px, 100%); margin: 34px auto 0; text-align: left; }
.tr-scores h2 { font-family: "PS2P", var(--head); font-size: 1rem; text-align: center; color: #ffd23f; margin-bottom: 16px; }
.tr-board { list-style: none; margin: 0 0 10px; padding: 0; counter-reset: rk; font-family: "PS2P", monospace; font-size: .72rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tr-board li { counter-increment: rk; display: grid; grid-template-columns: 2.6em 5em 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.tr-board li:last-child { border-bottom: 0; }
.tr-board li::before { content: counter(rk); color: var(--faint); }
.tr-board li:nth-child(odd) { background: rgba(255, 255, 255, .02); }
.tr-board .c { color: var(--faint); font-family: var(--body); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-board .s { text-align: right; }
.tr-board li.champ { background: linear-gradient(90deg, rgba(255, 210, 63, .16), rgba(255, 138, 61, .06)); color: #ffd23f; }
.tr-board li.champ::before { content: "★"; color: #ffd23f; }
.tr-scores p { text-align: center; }
.tr-about { max-width: 70ch; margin: 22px auto 0; }
.lost-title { font-family: "PS2P", var(--head); font-size: clamp(1.2rem, 4vw, 2rem); color: #ff2e88; margin-bottom: 10px; }
.lost-sub { color: var(--muted); margin: 0 0 26px; }

/* ---- Special projects ---- */
.projects { display: grid; gap: 40px; }
.project { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 48px); align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 4vw, 40px); }
.proj-img { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(#140932, #5e1a88 55%, #ff6a5e); }
.proj-img img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.proj-text h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.proj-text p { color: var(--muted); }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 10px; margin: 22px 0; }
.specs div { background: var(--night); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.specs dt { font-family: var(--label); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--orange); }
.specs dd { margin: 4px 0 0; color: var(--text); font-weight: 600; }
.project .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
@media (max-width: 820px) { .project { grid-template-columns: 1fr; } }
/* nav fits six items */
.nav a { white-space: nowrap; }
@media (min-width: 1141px) and (max-width: 1260px) { .nav a { padding: 12px 8px; letter-spacing: .1em; } .nav { gap: 2px; } }
.brand-wrap { flex-shrink: 0; }
.legal .glory { flex-basis: 100%; width: 100%; order: 2; text-align: center; font-style: italic; color: var(--muted); margin: 4px 0 0; }
.stack { display: grid; gap: 16px; align-content: start; }
.tr-mute:disabled { opacity: .4; cursor: default; }
.tr-board li .d { grid-column: 2 / -1; font-family: var(--body); font-size: .78rem; color: var(--faint); margin-top: -4px; }
/* touch controls: taller, no text selection or long-press menu */
.tr canvas, .tr-touch, .tr-touch button { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.tr-touch { grid-template-columns: 1.35fr 1fr 1.35fr; }
.tr-touch button { min-height: clamp(88px, 14vh, 130px); font-size: 1.15rem; touch-action: none; }
/* leaderboard trophies */
.tr-board .n { display: inline-flex; align-items: center; gap: 6px; }
.tr-board .trophy { flex: none; margin-right: 8px; }
.tr-board li.bot .d { color: #3fa9ff; }
/* iPhone: no selection, callout or double-tap zoom anywhere in the game box */
.tr, .tr * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.tr input { -webkit-user-select: text; user-select: text; }
.tr, .tr button, .tr canvas, .arcade h1 { touch-action: manipulation; }
.tr-touch button { touch-action: none; }
.tr.touch .tr-bar { margin-top: 34px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }

/* ---- Tune Rush landscape play on phones: the game takes the whole screen, edges steer ---- */
html.tr-landplay, html.tr-landplay body { overflow: hidden; }
html.tr-landplay .site-head { display: none; }
.tr.tr-land { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; margin: 0; z-index: 100; background: #000; display: flex; align-items: center; justify-content: center; touch-action: none; }
.tr.tr-land canvas { width: min(100vw, calc(100vh * 16 / 9)); width: min(100vw, calc(100dvh * 16 / 9)); height: auto; border: 0; border-radius: 0; touch-action: none; }
.tr.tr-land .tr-touch, .tr.tr-land .tr-bar { display: none; }
.tr-lpause, .tr-lhint { display: none; }
.tr.tr-land .tr-lpause { display: block; position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(11, 6, 20, .55); color: #fff; font-family: "PS2P", monospace; font-size: .7rem; z-index: 3; touch-action: none; }
.tr.tr-land .tr-lhint { display: flex; position: absolute; inset: 0; align-items: center; justify-content: space-between; padding: 0 max(4vw, env(safe-area-inset-left)); pointer-events: none; opacity: 0; transition: opacity .6s; color: #fff; text-shadow: 0 2px 0 #000; z-index: 2; }
.tr.tr-land .tr-lhint.ghost { opacity: .2; }
.tr.tr-land .tr-lhint.ghost b { opacity: 0; transition: opacity .6s; }
.tr.tr-land .tr-lhint.on { opacity: .85; }
.tr.tr-land .tr-lhint.on b { opacity: 1; }
.tr-lhint span { font-family: "PS2P", monospace; font-size: 2.4rem; opacity: .75; }
.tr-lhint b { font-family: "PS2P", monospace; font-size: .62rem; font-weight: 400; align-self: flex-end; margin-bottom: 14vh; background: rgba(11, 6, 20, .6); padding: 8px 12px; border-radius: 8px; }
/* phones: no sticky header over a sideways game, and a slightly larger game in portrait */
@media (orientation: landscape) and (pointer: coarse) and (max-height: 600px) { .site-head { position: static; } }
@media (max-width: 600px) { .arcade { padding-top: 14px; } .arcade .wrap { width: calc(100% - 16px); } }

/* Friends of EnabledTC: compact name list on the home page, smaller footer list */
.friend-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start; max-width: 900px; }
.friend-chips a { display: inline-block; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); text-decoration: none; font-size: .92rem; }
.friend-chips a:hover { border-color: var(--cyan); color: var(--cyan); }
.friend-more { margin-top: 26px; }
.friends-foot { font-size: .88rem; }
.site-foot h3 a, footer h3 a { color: inherit; text-decoration: none; }

/* End race button (pause screen) */
.tr-end { border-color: #ff8a3d !important; color: #ffd8b8 !important; }
.tr-end[hidden] { display: none; }
.tr-lend { display: none; }
.tr.tr-land .tr-lend.on { display: block; position: absolute; top: max(10px, env(safe-area-inset-top)); right: calc(max(12px, env(safe-area-inset-right)) + 58px); height: 46px; padding: 0 16px; border-radius: 23px; border: 1px solid #ff8a3d; background: rgba(11, 6, 20, .7); color: #ffd8b8; font-family: "PS2P", monospace; font-size: .6rem; z-index: 3; touch-action: none; }
/* Legend: a top-3 score unbeaten for two weeks */
.tr-board li.legend { background: linear-gradient(90deg, rgba(255, 210, 63, .13), rgba(255, 210, 63, .03) 60%, rgba(255, 255, 255, .02)); box-shadow: inset 3px 0 0 #ffd23f; }
.legend-badge { display: inline-block; margin: 2px 6px 4px 0; padding: 3px 7px 2px; border-radius: 4px; font-family: "PS2P", monospace; font-size: .5rem; letter-spacing: .08em; text-transform: uppercase; color: #2a1600;
  background: linear-gradient(110deg, #b8860b 0%, #ffd23f 30%, #fff6c8 45%, #ffd23f 60%, #c98a1a 100%); background-size: 250% 100%; animation: legend-shine 3.2s ease-in-out infinite; box-shadow: 0 0 10px rgba(255, 210, 63, .45); vertical-align: middle; }
@keyframes legend-shine { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .legend-badge { animation: none; } }
.tr-board li.legend .s { color: #ffd23f; text-shadow: 0 0 8px rgba(255, 210, 63, .35); }
.legend-days { color: #ffd23f; font-weight: 600; }

/* ---- Hall of Legends: record holders, kept forever ---- */
.tr-hall { width: min(760px, 100%); margin: 8px auto 0; padding: 0; text-align: left; }
.hall-head { display: flex; align-items: center; justify-content: center; gap: 14px; }
.hall-head h2 { margin: 0; font-family: "PS2P", var(--head); font-size: clamp(1rem, 3.4vw, 1.35rem); letter-spacing: .04em; color: transparent;
  background: linear-gradient(100deg, #b8860b 0%, #ffd23f 28%, #fff6c8 46%, #ffd23f 62%, #c98a1a 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text;
  animation: legend-shine 4s ease-in-out infinite; filter: drop-shadow(0 0 12px rgba(255, 210, 63, .35)); text-align: center; text-wrap: balance; }
.hall-laurel { width: 34px; height: 22px; flex: none; background:
  radial-gradient(ellipse 5px 3px at 30% 30%, #ffd23f 98%, transparent) , radial-gradient(ellipse 5px 3px at 55% 50%, #e0b52f 98%, transparent),
  radial-gradient(ellipse 5px 3px at 78% 74%, #c98a1a 98%, transparent), linear-gradient(160deg, transparent 46%, #b8860b 47% 53%, transparent 54%); }
.hall-laurel.r { transform: scaleX(-1); }
.hall-sub { margin: 8px 0 18px; text-align: center; font-family: var(--label); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: #ff8a3d; }
.hall-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hall-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px 14px 14px; border-radius: 14px;
  background: linear-gradient(120deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); border: 1px solid var(--line); position: relative; overflow: hidden; }
.hall-card.gold { border-color: rgba(255, 210, 63, .7); background: linear-gradient(120deg, rgba(255, 210, 63, .16), rgba(255, 138, 61, .05) 55%, rgba(255, 255, 255, .02));
  box-shadow: 0 0 0 1px rgba(255, 210, 63, .25), 0 10px 40px -18px rgba(255, 210, 63, .6); }
.hall-card.gold::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 246, 200, .14) 50%, transparent 65%); background-size: 260% 100%; animation: legend-shine 5s ease-in-out infinite; pointer-events: none; }
.hall-card.silver { border-color: rgba(207, 214, 224, .55); background: linear-gradient(120deg, rgba(207, 214, 224, .10), rgba(255, 255, 255, .015)); }
.hall-card.bronze { border-color: rgba(208, 138, 74, .55); background: linear-gradient(120deg, rgba(208, 138, 74, .11), rgba(255, 255, 255, .015)); }
.hall-card.honor { border-color: rgba(255, 46, 136, .4); }
.hall-medal { display: grid; place-items: center; }
.hall-trophy, .hall-ribbon { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.hall-main { min-width: 0; }
.hall-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.hall-name { font-family: "PS2P", monospace; font-size: 1.05rem; color: var(--text); letter-spacing: .04em; }
.gold .hall-name { color: #ffd23f; } .silver .hall-name { color: #e6ebf2; } .bronze .hall-name { color: #f0a868; } .honor .hall-name { color: #ff9ec9; }
.hall-label { font-family: var(--label); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.hall-car { margin: 4px 0 0; font-size: .92rem; color: var(--text); }
.hall-stats, .hall-since { margin: 3px 0 0; font-size: .8rem; color: var(--faint); }
.hall-since b { color: #3dff9e; font-weight: 600; }
.hall-score { font-family: "PS2P", monospace; font-size: clamp(.8rem, 2.6vw, 1.05rem); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.gold .hall-score { color: #ffd23f; text-shadow: 0 0 10px rgba(255, 210, 63, .45); }
@media (max-width: 520px) {
  .hall-card { grid-template-columns: 42px minmax(0, 1fr); padding: 12px; }
  .hall-score { grid-column: 2; text-align: left; margin-top: 2px; }
  .hall-trophy { width: 34px; height: 34px; } .hall-ribbon { width: 30px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .hall-head h2, .hall-card.gold::after { animation: none; } }

/* Hall of Legends: founders pinned, newest season open, older seasons folded */
.hall-sub.founders { color: #ffd23f; }
.hall-divider { height: 1px; margin: 26px auto 4px; width: min(420px, 80%); background: linear-gradient(90deg, transparent, rgba(255, 210, 63, .5), transparent); }
.hall-fold { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.hall-fold[open] { padding-bottom: 12px; }
.hall-fold > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 16px; }
.hall-fold > summary::-webkit-details-marker { display: none; }
.hall-fold > summary::after { content: "+"; margin-left: auto; font-family: "PS2P", monospace; font-size: .7rem; color: var(--faint); }
.hall-fold[open] > summary::after { content: "−"; }
.hall-fold > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 10px; }
.hall-fold-t { font-family: "PS2P", monospace; font-size: .7rem; color: #ff8a3d; }
.hall-fold-w { font-size: .82rem; color: var(--faint); }
.hall-fold-c { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: #ffd23f; }
.hall-fold-c .hall-trophy { width: 18px; height: 18px; }
.hall-fold .hall-list { padding: 0 12px; }

/* Hall of Legends heading: premiere searchlights sweeping behind the title (replaces the laurels) */
.hall-laurel { display: none; }
.hall-head { position: relative; isolation: isolate; padding-top: 128px; overflow: hidden; }
.hall-head::before, .hall-head::after { content: ""; position: absolute; bottom: 0; width: 150px; height: 300px; margin-left: -75px; transform-origin: 50% 100%; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(255, 240, 190, .05), rgba(255, 236, 170, .30) 18%, rgba(255, 236, 170, .14) 60%, rgba(255, 236, 170, 0) 96%);
  clip-path: polygon(47% 100%, 53% 100%, 100% 0, 0 0); filter: blur(2px); }
.hall-head::before { left: 30%; animation: hall-beam-l 8s ease-in-out infinite alternate; }
.hall-head::after { left: 70%; animation: hall-beam-r 8s ease-in-out infinite alternate; animation-delay: -4s; }
@keyframes hall-beam-l { from { transform: rotate(-30deg); } to { transform: rotate(24deg); } }
@keyframes hall-beam-r { from { transform: rotate(30deg); } to { transform: rotate(-24deg); } }
@media (prefers-reduced-motion: reduce) { .hall-head::before, .hall-head::after { animation: none; } }
