
:root{
  --bg:#05070d;
  --ink:#f2f0e8;
  --amber:#ffcc66;
  --green:#78ffb3;
  --red:#ff5f5f;
  --blue:#67a7ff;
  --muted:rgba(242,240,232,.72);
  --line:rgba(255,255,255,.10);
  --shadow:0 18px 60px rgba(0,0,0,.55);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  overflow:hidden;
}
.bg{
  position:fixed; inset:-30px;
  background:url("./bg.png") center / cover no-repeat;
  filter: blur(10px) saturate(1.05) brightness(.85);
  transform: scale(1.05);
}
.shade{
  position:fixed; inset:0;
  background: radial-gradient(1100px 600px at 20% 0%, rgba(255,204,102,.10), transparent 55%),
              radial-gradient(900px 600px at 80% 15%, rgba(103,167,255,.08), transparent 55%),
              linear-gradient(to bottom, rgba(0,0,0,.70), rgba(0,0,0,.78));
}
.hdr{
  position:relative;
  z-index:5;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  padding:16px 18px 10px 18px;
  border-bottom:1px solid var(--line);
  backdrop-filter: blur(8px);
}
.title{
  font-family:var(--mono);
  font-weight:900;
  letter-spacing:.35em;
  color:var(--amber);
  font-size:28px;
}
.sub{color:var(--muted); font-family:var(--sans); font-size:12px; margin-top:6px}
.right{display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; justify-content:flex-end}

.qr{
  width:54px; height:54px;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  background:rgba(0,0,0,.22);
  box-shadow: var(--shadow);
  display:flex; align-items:center; justify-content:center;
}
.qr img{width:100%; height:100%; object-fit:cover; image-rendering:pixelated;}
.hbtn{
  all:unset;
  cursor:pointer;
  padding:0;
  user-select:none;
}
.hbtn:hover{color:var(--ink)}
.hbtn.active{color:var(--amber)}
.hbtn .arrow{margin-left:8px; opacity:.85}

.ctl{display:flex; flex-direction:column; gap:6px; font-family:var(--sans); font-size:12px; color:var(--muted)}
select,input{
  background:rgba(0,0,0,.35);
  border:1px solid var(--line);
  color:var(--ink);
  padding:10px 12px;
  border-radius:12px;
  outline:none;
  min-width:130px;
}
input{min-width:96px; text-transform:uppercase; font-family:var(--mono); letter-spacing:.04em}
.btn{
  background:rgba(255,204,102,.14);
  border:1px solid rgba(255,204,102,.35);
  color:var(--amber);
  padding:10px 12px;
  border-radius:12px;
  font-family:var(--mono);
  font-weight:900;
  cursor:pointer;
}
.clock{
  font-family:var(--mono);
  font-size:18px;
  color:var(--ink);
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.22);
}
.toggle{
  display:flex; gap:8px; align-items:center;
  color:var(--muted);
  font-family:var(--sans);
  font-size:12px;
  user-select:none;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(0,0,0,.22);
}
.toggle input{accent-color: var(--amber)}

.board{
  position:relative;
  z-index:5;
  height:calc(100vh - 76px);
  display:flex;
  flex-direction:column;
  padding:14px 18px 16px 18px;
}
.headrow{
  display:grid;
  grid-template-columns: 1.25fr .85fr .85fr .75fr 1.1fr 1fr;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(0,0,0,.28);
  box-shadow: var(--shadow);
  font-family:var(--mono);
  color:rgba(242,240,232,.80);
  letter-spacing:.08em;
  font-size:12px;
}
.rows{
  margin-top:12px;
  border:1px solid var(--line);
  border-radius:16px;
  overflow-y:auto;
  overflow-x:hidden;
  flex:1;
  min-height:0;
  background:rgba(0,0,0,.20);
  box-shadow: var(--shadow);
  scroll-behavior:auto;
}
.row{
  display:grid;
  grid-template-columns: 1.25fr .85fr .85fr .75fr 1.1fr 1fr;
  gap:10px;
  padding:12px 12px;
  min-height:64px;
  border-bottom:1px solid rgba(255,255,255,.08);
  font-family:var(--mono);
  font-size:20px;
  letter-spacing:.06em;
  align-items:center;
}
.row:last-child{border-bottom:0}
.row:hover{background:rgba(255,255,255,.04)}
.muted{color:var(--muted); font-size:14px; font-family:var(--sans); letter-spacing:0}
.tag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.22);
  font-size:18px;
  font-weight:900;
}
.tag.green{color:var(--green); border-color:rgba(120,255,179,.35); background:rgba(120,255,179,.10)}
.tag.red{color:var(--red); border-color:rgba(255,95,95,.35); background:rgba(255,95,95,.10)}
.tag.amber{color:var(--amber); border-color:rgba(255,204,102,.35); background:rgba(255,204,102,.10)}
.tag.blue{color:var(--blue); border-color:rgba(103,167,255,.35); background:rgba(103,167,255,.10)}
.cell{position:relative}
.flap{
  display:inline-block;
  padding:2px 6px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.18);
  box-shadow: inset 0 -10px 18px rgba(0,0,0,.18);
}
.flipflash{animation: flipflash 160ms linear infinite}
@keyframes flipflash{0%{filter:brightness(1)}50%{filter:brightness(1.12)}100%{filter:brightness(1)}}
.foot{
  margin-top:12px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  color:var(--muted);
  font-family:var(--sans);
  font-size:12px;
}
.hint{opacity:.8}
@media (max-width:1000px){
  .row{font-size:16px}
  .headrow{font-size:10px}
  .title{font-size:22px}
  body{overflow:auto}
  .board{height:auto}
}

/* autoscroll helper */
.rows.autoscroll{overflow:hidden; scrollbar-width:none;}
.rows.autoscroll::-webkit-scrollbar{display:none}

.countdown.green{color:var(--green); font-weight:900;}
.countdown.red{color:var(--red); font-weight:900;}

.headrow>.hbtn{display:block}


/* Scrollbar (WebKit) */
.rows::-webkit-scrollbar{width:10px}
.rows::-webkit-scrollbar-track{background:rgba(0,0,0,.15)}
.rows::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18); border-radius:10px}
