/* REVMO web - shared look for revmoracing.com and fw.revmoracing.com */
:root {
  --bg: #07080d;
  --bg-2: #0d1017;
  --card: #11151e;
  --line: #1f2633;
  --text: #e8ecf3;
  --muted: #9aa4b5;
  --red: #ff2e2e;
  --red-2: #ff5a4f;
  --blue: #3a9bff;
  --green: #2ecc71;
  --amber: #ffb020;
  --radius: 14px;
  --font-head: "Outfit", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", "Outfit", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font-body);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; background: rgba(7, 8, 13, .86);
       backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.logo { font: 800 22px/1 var(--font-head); letter-spacing: .06em; color: var(--red); }
.logo:hover { text-decoration: none; }
.top nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.top nav a { color: var(--muted); font-size: 15px; }
.top nav a:hover, .top nav a[aria-current] { color: var(--text); text-decoration: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line);
       background: var(--card); color: var(--text); font: 600 15px/1 var(--font-body);
       cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.btn:hover { text-decoration: none; border-color: #2c3546; background: #161b26; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-2); border-color: var(--red-2); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(30px, 5vw, 44px); }
h2 { font-size: clamp(24px, 3.4vw, 32px); }
.muted { color: var(--muted); }
.page-head { padding: 48px 0 24px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* firmware list */
.fw-card { display: flex; flex-direction: column; gap: 10px; }
.fw-card .ver { font: 700 28px/1 var(--font-head); }
.fw-card .meta { color: var(--muted); font-size: 14px; }
.fw-card .notes { white-space: pre-line; font-size: 15px; border-left: 2px solid var(--line); padding-left: 12px; }
.fw-card details { font-size: 14px; color: var(--muted); }
.fw-card details summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.fw-card details li { margin: 6px 0; }
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px;
       border: 1px solid var(--line); color: var(--muted); }
.tag.ok { color: var(--green); border-color: rgba(46, 204, 113, .4); }
.tag.off { color: var(--amber); border-color: rgba(255, 176, 32, .4); }
.empty { color: var(--muted); padding: 24px; text-align: center; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px;
                    border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line);
                    display: grid; place-items: center; font: 700 14px/1 var(--font-head); color: var(--blue); }
.note { border: 1px solid rgba(255, 176, 32, .35); background: rgba(255, 176, 32, .06);
        border-radius: 10px; padding: 12px 14px; font-size: 15px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--bg-2);
       padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); }
section { padding: 24px 0; }
footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 40px; color: var(--muted); font-size: 14px; }

/* admin */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }
textarea, input[type=text] { width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
                             border-radius: 10px; padding: 10px; font: inherit; }
.drop { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; cursor: pointer; }
.drop.over { border-color: var(--blue); background: rgba(58, 155, 255, .06); }
.msg { min-height: 24px; font-size: 15px; }
.msg.err { color: var(--red-2); }
.msg.ok { color: var(--green); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 600px) {
  .top .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .top nav { margin-left: 0; width: 100%; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* error page (404 / 500) rendered by the Worker */
.err-page { text-align: center; padding: 96px 0 72px; max-width: 560px; }
.err-code { font-family: Outfit, sans-serif; font-weight: 800; font-size: 72px; line-height: 1; color: var(--red); margin: 0 0 12px; }
.err-page h1 { margin: 0 0 12px; }
.err-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
