/* TunerOS web — MiniMod Tuners design language:
   hot-pink frame, black panel under a cyan rule, dark striped rows,
   cyan data / pink actions, italic display headings. Mobile-first. */

:root {
  --pink: #ec1e8c;
  --pink-hover: #ff44a6;
  --cyan: #29b9e8;
  --cyan-dark: #1a94bd;
  --bg: #0b0b0d;
  --row: #141417;
  --row-alt: #1c1c21;
  --border: #2a2a30;
  --ink: #f5f5f7;
  --muted: #9a9aa2;
  --good: #35d07f;
  --warn: #ffb020;
  --bad: #ff5560;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--pink); color: var(--ink); }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--pink-hover); }

/* ---- frame ---- */
.site-header {
  background: #000; padding: 12px 18px; display: flex;
  align-items: center; justify-content: space-between;
  column-gap: 12px; row-gap: 14px; flex-wrap: wrap;
}
.logo { font-size: 30px; font-weight: 800; font-style: italic; letter-spacing: 1px; color: #fff; cursor: pointer; user-select: none; }
.logo b { color: var(--cyan); }
.logo .os { color: var(--pink); }
.brand-row { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; }
.side-nav { display: flex; gap: 4px; margin-left: auto; }
.side-nav a { color: #fff; font-weight: 600; font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.side-nav a:hover { color: var(--cyan); }
.side-nav a.active { background: var(--cyan); color: #000; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: #fff; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 8px;
}
.main-nav a:hover { color: var(--cyan); }
.main-nav a.active { background: var(--cyan); color: #000; }

.content-wrap {
  background: var(--bg); border-top: 12px solid var(--cyan);
  margin: 0 10px; flex: 1 1 auto; display: flex; flex-direction: column;
}
main { padding: 18px 16px 60px; flex: 1 0 auto; max-width: 1060px; width: 100%; margin: 0 auto; }
.site-footer {
  background: var(--cyan); color: #000; padding: 10px 18px; font-weight: 600; font-size: 14px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ---- type ---- */
h1, h2, h3 { font-style: italic; letter-spacing: 0.5px; margin: 0 0 14px; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
h1 span, h2 span { color: var(--cyan); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; font-family: Consolas, monospace; }

/* ---- buttons: BIG, obvious, one pink per screen ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 700; font-style: italic; letter-spacing: 0.5px;
  padding: 14px 22px; font-size: 16px; color: #fff; background: var(--row-alt);
  transition: transform 0.06s, background 0.15s; min-height: 48px;
}
.btn:hover { background: #26262c; }
.btn:active { transform: scale(0.97); }
.btn-pink { background: var(--pink); }
.btn-pink:hover { background: var(--pink-hover); }
.btn-cyan { background: var(--cyan); color: #000; }
.btn-cyan:hover { background: #4fcaf2; }
.btn-ghost { background: transparent; border: 1px solid var(--border); font-weight: 600; }
.btn-danger { background: transparent; border: 1px solid var(--bad); color: var(--bad); }
.btn-sm { padding: 8px 14px; font-size: 14px; min-height: 36px; border-radius: 9px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ---- home tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile {
  background: var(--row); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px 14px; text-align: center; cursor: pointer; transition: border-color 0.15s, transform 0.06s;
}
.tile:hover { border-color: var(--cyan); }
.tile:active { transform: scale(0.97); }
.tile .ico { font-size: 40px; display: block; margin-bottom: 8px; }
.tile .t { font-weight: 700; font-style: italic; font-size: 16px; color: #fff; }
.tile .d { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---- cards / rows ---- */
.card {
  background: var(--row); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; margin-bottom: 12px;
}
.card.accent { border-left: 4px solid var(--cyan); }
.rows .r {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
}
.rows .r:nth-child(odd) { background: var(--row); }
.rows .r:nth-child(even) { background: var(--row-alt); }
.rows .r .grow { flex: 1; min-width: 0; }

/* ---- car cards ---- */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.car-card {
  background: var(--row); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; cursor: pointer; transition: border-color 0.15s;
}
.car-card:hover { border-color: var(--pink); }
.car-card .ph {
  height: 110px; background: var(--row-alt); display: flex; align-items: center;
  justify-content: center; font-size: 44px; overflow: hidden;
}
.car-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.car-card .nm { padding: 10px 12px 12px; font-weight: 700; font-style: italic; }
.car-card .nm .small { font-style: normal; font-weight: 400; }

/* ---- forms ---- */
label.f { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 13px 14px;
  background: var(--row-alt); color: var(--ink); border: 1px solid var(--border);
  border-radius: 10px; font: inherit; font-size: 16px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); border-color: transparent; }
.form-narrow { max-width: 420px; }

/* ---- badges ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.b-cyan { background: rgba(41,185,232,0.15); color: var(--cyan); }
.b-pink { background: rgba(236,30,140,0.15); color: var(--pink-hover); }
.b-good { background: rgba(53,208,127,0.15); color: var(--good); }
.b-warn { background: rgba(255,176,32,0.15); color: var(--warn); }
.b-bad  { background: rgba(255,85,96,0.15); color: var(--bad); }
.b-mut  { background: rgba(154,154,162,0.15); color: var(--muted); }

/* ---- live view ---- */
.big-time { font-size: 44px; font-weight: 800; font-style: italic; color: var(--cyan); }
.lane-row { border-left: 4px solid var(--border); }
.lane-row.flash { animation: laneflash 0.9s ease-out; }
@keyframes laneflash { 0% { background: rgba(41,185,232,0.45); } 100% { background: none; } }
.feed { max-height: 240px; overflow-y: auto; font-size: 13px; }
.feed div { padding: 4px 8px; border-bottom: 1px solid var(--border); color: var(--muted); }
.feed div b { color: var(--ink); }

/* ---- results ---- */
.podium { display: flex; gap: 10px; align-items: flex-end; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.podium .p {
  background: var(--row); border: 1px solid var(--border); border-radius: 14px;
  text-align: center; padding: 14px; min-width: 130px;
}
.podium .p.first { border-color: var(--cyan); transform: scale(1.06); }
.podium .p .ico { font-size: 34px; }
.splits td, .splits th { padding: 6px 10px; font-size: 13px; text-align: right; }
.splits th { color: var(--muted); font-weight: 600; }

/* ---- QR grid ---- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.qr-cell { background: #fff; border-radius: 14px; padding: 14px; text-align: center; color: #000; }
.qr-cell .lane { font-weight: 800; font-style: italic; font-size: 18px; margin-bottom: 8px; }
.qr-cell img, .qr-cell canvas { margin: 0 auto; }

/* ---- toast ---- */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
#toast .msg {
  background: #000; border: 1px solid var(--cyan); color: var(--ink);
  border-radius: 12px; padding: 12px 20px; font-weight: 600; max-width: 90vw;
  animation: pop 0.18s ease-out;
}
#toast .msg.err { border-color: var(--bad); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }

/* ---- modal ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--bg); border: 1px solid var(--border); border-top: 8px solid var(--cyan);
  border-radius: 16px; padding: 20px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
}

/* ---- misc ---- */
.split { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.center { text-align: center; }
.hero { text-align: center; padding: 40px 10px 20px; }
.hero .ico { font-size: 64px; }
table { border-collapse: collapse; width: 100%; }

/* ---- the MiniMod wolf-head loader (ported from partials/boot-loader.php):
   logo with the logo-blue spinner ring behind it, same on every screen ---- */
.spin {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 60px 0;
}
.spin .logo-wrap {
  position: relative; width: 160px; height: 160px;
  display: flex; align-items: center; justify-content: center;
}
.spin .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 4px solid rgba(236, 30, 140, 0.22); border-top-color: var(--pink);
  animation: mmboot 0.8s linear infinite;
}
.spin img { position: relative; z-index: 1; width: 120px; height: auto; }
.spin .sub { font-size: 12px; letter-spacing: 3px; color: var(--muted); text-transform: uppercase; }
@keyframes mmboot { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  main { padding: 14px 10px 50px; }
  .content-wrap { margin: 0 6px; }
  h1 { font-size: 24px; }
  .big-time { font-size: 34px; }
  .logo { font-size: 25px; }
  .side-nav a { font-size: 12px; padding: 5px 7px; }
  .main-nav a { font-size: 13px; padding: 6px 8px; }
}
