/* My Arcade Score — neon arcade theme */
:root {
  --bg: #0b0b1a;
  --bg2: #14142b;
  --panel: #191936;
  --line: #2c2c55;
  --text: #e9e9ff;
  --muted: #8b8bb5;
  --pink: #ff2e88;
  --cyan: #18e0ff;
  --yellow: #ffd23f;
  --green: #3dff8b;
  --red: #ff4d4d;
  --gold: #ffd23f;
  --silver: #cfd6e6;
  --bronze: #e39b5b;
  --radius: 10px;
  --font: 'Rajdhani', system-ui, sans-serif;
  --pixel: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #24205a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; color: var(--cyan); }
h3 { font-size: 1.1rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
code { background: var(--bg2); padding: 2px 6px; border-radius: 4px; }

/* layout */
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 14px 24px; background: rgba(10,10,25,.85); border-bottom: 2px solid var(--pink);
  box-shadow: 0 0 24px rgba(255,46,136,.35); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px);
}
.brand { font-family: var(--pixel); font-size: 14px; color: var(--yellow); letter-spacing: 1px; }
.brand:hover { text-decoration: none; }
.coin { color: var(--yellow); text-shadow: 0 0 10px var(--yellow); }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 600; }
.topbar nav a { color: var(--text); }
.topbar nav a.muted { color: var(--muted); }
.foot { text-align: center; font-family: var(--pixel); font-size: 10px; color: var(--muted); padding: 30px 0; letter-spacing: 2px; }

.cols { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.cols.single { grid-template-columns: 1fr; }
@media (max-width: 900px) { .cols, .cols.even { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel.narrow { max-width: 420px; margin: 40px auto; }
.titlebar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.titlebar h1 { margin-bottom: .2em; }
.titlebar p { margin: 0; }

/* text helpers */
.muted { color: var(--muted); }
.small { font-size: .85em; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; letter-spacing: .5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.danger-text { color: var(--red); }

.marquee {
  font-family: var(--pixel); font-size: 2.2rem; text-align: center; color: var(--yellow);
  text-shadow: 0 0 6px var(--yellow), 0 0 22px var(--pink), 3px 3px 0 var(--pink);
  margin: 20px 0 34px; letter-spacing: 3px;
}
.small-marquee { font-size: 1.4rem; text-align: left; margin: 0 0 10px; line-height: 1.5; }

/* forms */
label { display: block; font-weight: 600; color: var(--muted); font-size: .95em; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
  background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-weight: 500;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(24,224,255,.2); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row > label, .row > input { flex: 1; }
.row .w-sm, .w-sm { flex: 0 0 90px; max-width: 90px; }
.initials { text-transform: uppercase; font-family: var(--pixel); font-size: 12px; letter-spacing: 2px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.check input { width: auto; margin: 0; }
.inline { display: inline; }

.seg { display: flex; gap: 8px; }
.seg-opt { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 8px; color: var(--text); cursor: pointer; }
.seg-opt input { width: auto; margin: 0; }
.seg-opt:has(input:checked) { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(255,46,136,.25); }

/* buttons */
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--cyan);
  background: rgba(24,224,255,.12); color: var(--cyan); font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none !important; transition: .15s;
}
.btn:hover { background: rgba(24,224,255,.25); box-shadow: 0 0 14px rgba(24,224,255,.35); }
.btn-sm { padding: 5px 11px; font-size: .9em; }
.btn-lg { padding: 12px 26px; font-size: 1.1em; }
.btn-hot { border-color: var(--pink); color: #fff; background: var(--pink); }
.btn-hot:hover { background: #ff4f9c; box-shadow: 0 0 16px rgba(255,46,136,.6); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn-danger:hover { background: rgba(255,77,77,.15); box-shadow: none; }

/* flash */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border-left: 4px solid var(--green); background: rgba(61,255,139,.1); }
.flash-err { border-color: var(--red); background: rgba(255,77,77,.12); }
.flash-warn { border-color: var(--yellow); background: rgba(255,210,63,.1); }

/* badges & chips */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78em; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; background: var(--line); color: var(--text); vertical-align: middle; }
.badge-arcade { background: rgba(24,224,255,.18); color: var(--cyan); }
.badge-pinball { background: rgba(255,46,136,.18); color: var(--pink); }
.badge-active { background: var(--green); color: #032; }
.badge-setup { background: rgba(255,210,63,.2); color: var(--yellow); }
.badge-finished { background: var(--line); color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input { width: auto; flex: 1; margin: 0; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .9em; }
.chip.on { border-color: var(--pink); background: rgba(255,46,136,.18); }
.chip:hover { text-decoration: none; border-color: var(--cyan); }
.type-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.type-arcade { background: var(--cyan); }
.type-pinball { background: var(--pink); }

/* tables */
.grid { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.grid th, .grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.grid th { font-size: .8em; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); background: var(--bg2); }
.grid th.right, .grid td.right { text-align: right; }
.grid tr:last-child td { border-bottom: 0; }
.grid tr.dim td { opacity: .5; }
.grid tr.voided td { opacity: .45; text-decoration: line-through; }
.grid tr.voided td:last-child { text-decoration: none; opacity: 1; }
.scroll-x { overflow-x: auto; }
.game-col { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.board .pos { font-family: var(--pixel); font-size: 12px; width: 44px; }
.board tr.rank-1 .pos, .board tr.rank-1 .total { color: var(--gold); text-shadow: 0 0 8px var(--gold); }
.board tr.rank-2 .pos { color: var(--silver); }
.board tr.rank-3 .pos { color: var(--bronze); }
.board tr.rank-1 { background: rgba(255,210,63,.07); }
.total { font-family: var(--pixel); font-size: 14px; color: var(--yellow); }
.pts { font-weight: 700; }

/* dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 20px 0 30px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: .85em; }
a.tile:hover { border-color: var(--pink); text-decoration: none; }
.tile .num { display: block; font-family: var(--pixel); font-size: 26px; color: var(--yellow); margin-bottom: 10px; }

/* public cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: var(--text); transition: .15s; }
.card:hover { border-color: var(--pink); box-shadow: 0 0 22px rgba(255,46,136,.3); text-decoration: none; transform: translateY(-2px); }
.card h2 { color: var(--text); margin: 10px 0 4px; }
.card p { margin: 4px 0; }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.board-card h3 { margin-bottom: 12px; }
.board-card .grid { background: transparent; }

/* tournament setup pickers */
.picker { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; background: var(--bg2); }
.picker-filter { position: sticky; top: 0; margin: 0 !important; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); z-index: 1; }
.picker-head { padding: 8px 12px; font-size: .78em; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--pink); background: var(--panel); }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--text); cursor: pointer; border-top: 1px solid rgba(44,44,85,.5); font-weight: 500; }
.pick:hover { background: rgba(24,224,255,.06); }
.pick input { width: auto; margin: 0; }
.quick { margin-bottom: 14px; }
.quick input { margin: 0; }

/* score entry */
.entry { border-color: var(--pink); box-shadow: 0 0 24px rgba(255,46,136,.18); }
.entry-form { display: grid; grid-template-columns: 90px 1.2fr 1.2fr 1fr auto; gap: 14px; align-items: end; }

/* rounds */
.round-bar { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.round-big { font-family: var(--pixel); font-size: 22px; color: var(--yellow); margin-top: 6px; }
.round-big .muted { font-size: 12px; }
.round-pips { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.pip { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg2);
  color: var(--muted); font: 700 15px var(--font); cursor: pointer; }
.pip.done { border-color: var(--cyan); color: var(--cyan); }
.pip.on { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 0 12px rgba(255,46,136,.5); }
.wins { font-family: var(--pixel); font-size: 14px; color: var(--yellow); }
.crown { color: var(--gold); text-shadow: 0 0 6px var(--gold); }
@media (max-width: 800px) { .entry-form { grid-template-columns: 1fr; } }
.score-input { font-family: var(--pixel); font-size: 18px; letter-spacing: 2px; color: var(--yellow); }

/* TV mode: big fonts for a venue screen */
body.tv { font-size: 22px; }
body.tv .wrap { max-width: none; padding: 30px 40px; }
body.tv .small-marquee { font-size: 2rem; }
body.tv .grid th, body.tv .grid td { padding: 12px 16px; }

/* ===== Head-to-head tournament ===== */
.round-action { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; min-width: 260px; }
.round-pips a.pip { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.progress { height: 8px; width: 240px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress.wide { width: min(420px, 100%); margin-top: 8px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); }
.round-label { color: var(--text); }
.wl { font-family: var(--pixel); font-size: 13px; color: var(--yellow); white-space: nowrap; }
.note { margin: 12px 0 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { display: block; width: 100%; text-align: center; }

/* player round status */
.st { font-weight: 600; white-space: nowrap; }
.st::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; background: var(--muted); }
.st-won { color: var(--green); }      .st-won::before { background: var(--green); }
.st-lost { color: var(--muted); }
.st-waiting { color: var(--cyan); }   .st-waiting::before { background: var(--cyan); animation: blink 1.2s infinite; }
.st-confirm { color: var(--yellow); } .st-confirm::before { background: var(--yellow); }
.st-bye { color: var(--text); }       .st-bye::before { background: var(--yellow); }
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .st-waiting::before { animation: none; } }

.champion { font-size: 1.4rem; border-color: var(--yellow); box-shadow: 0 0 24px rgba(255,210,63,.25); }
.champion strong { font-family: var(--pixel); font-size: 1rem; color: var(--yellow); margin-left: 6px; }

/* machine leaderboards: horizontal scroller */
.boards-title { margin: 28px 0 10px; align-items: center; }
.boards-title h2 { margin: 0; }
.hscroll { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; scrollbar-color: var(--line) transparent; }
.mcard { flex: 0 0 250px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.mcard.is-out { opacity: .55; }
.mcard h3 { margin: 8px 0 10px; font-size: 1.05rem; }
.mcard-head { display: flex; gap: 6px; }
.board.mini { background: transparent; }
.board.mini td { padding: 6px 4px; font-size: .95em; }
.board.mini .pos { width: 26px; }
body.tv .mcard { flex-basis: 300px; }

/* machine status chips (admin) */
.machine-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mchip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg2); font-weight: 600; }
.mchip.out { border-color: var(--red); color: var(--red); }
.picker-tools { padding: 6px 12px; font-size: .85em; border-bottom: 1px solid var(--line); }

/* admin matches */
.match-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.match { margin: 0; }
.match.st-done { border-color: rgba(61,255,139,.35); }
.match.st-submitted { border-color: var(--yellow); }
.match.bye { display: flex; align-items: center; gap: 8px; }
.match-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.match-machine { margin: 0; flex: 1; }
.match-body { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.match-body label.winner { color: var(--green); }
.match-body label.winner::after { content: ' ✔ winner'; font-size: .85em; }
.vs { color: var(--muted); padding-bottom: 12px; }
.match-foot { margin-top: 12px; display: flex; gap: 8px; }
.status-waiting { background: rgba(24,224,255,.18); color: var(--cyan); }
.status-submitted { background: rgba(255,210,63,.2); color: var(--yellow); }
.status-done { background: rgba(61,255,139,.18); color: var(--green); }

/* phone score entry */
.phone { max-width: 460px; margin: 0 auto; }
.phone-head { text-align: center; margin-bottom: 16px; }
.phone-head h1 { font-size: 1.7rem; margin-top: 6px; }
.vsline { text-align: center; font-size: 1.25rem; }
.big-input { font-size: 26px !important; padding: 14px; text-align: center; }
.handoff { text-align: center; font-weight: 700; color: var(--yellow); font-size: 1.1rem; }
.confirm-row { display: flex; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 1.2rem; }
.confirm-row.winner { border-color: var(--green); color: var(--green); }
.confirm-row.winner span:first-child::after { content: ' 🏆'; }
.result { text-align: center; border-color: var(--green); }
.result .big { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
