/* RedFlag Rush v0.1 — minimalist, mobile-first, no external libs */
:root{
  --bg:#0b0f17;
  --card:#101827;
  --card2:#0f1726;
  --text:#e9eef7;
  --muted:#a6b0c3;
  --line:rgba(255,255,255,0.10);
  --good:#7CFFB2;
  --warn:#FFD27C;
  --bad:#FF7C8A;
  --accent:#7CA9FF;
  --shadow: 0 12px 28px rgba(0,0,0,0.45);
  --radius: 18px;
  --tap: 48px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(900px 600px at 10% 10%, rgba(124,169,255,0.20), transparent 55%),
              radial-gradient(900px 600px at 90% 20%, rgba(124,255,178,0.10), transparent 60%),
              var(--bg);
  color:var(--text);
}

.app{min-height:100%; display:flex; flex-direction:column;}
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 14px 10px;
  background: linear-gradient(to bottom, rgba(11,15,23,0.92), rgba(11,15,23,0.60));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand{display:flex; gap:10px; align-items:center;}
.logo{
  width:40px; height:40px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, rgba(124,169,255,0.95), rgba(124,255,178,0.80));
  color:#0b0f17; font-weight:900; letter-spacing:0.5px;
  box-shadow: var(--shadow);
}
.brandtext .title{font-weight:900; letter-spacing:0.2px;}
.brandtext .subtitle{font-size:12px; color:var(--muted); margin-top:2px;}

.view{padding:14px; width:100%; max-width: 760px; margin: 0 auto;}
.hidden{display:none !important;}

.card{
  background: linear-gradient(180deg, rgba(16,24,39,0.96), rgba(16,24,39,0.86));
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin: 10px 0;
}
.hero h1{margin:0 0 8px; font-size: 22px; line-height:1.18;}
h1,h2{margin: 0 0 10px;}
h2{font-size:16px; color: var(--text);}
p{margin:0;}
.muted{color:var(--muted);}
.small{font-size:12px;}
.fineprint{margin-top:12px; font-size:12px; color: var(--muted);}

.sectionhdr{display:flex; align-items:center; justify-content:space-between; gap:10px;}
.linkbtn{
  background: transparent; border:1px solid var(--line); color: var(--text);
  padding: 10px 12px; border-radius: 12px; min-height: 42px;
}
.linkbtn:active{transform: translateY(1px);}

.statsrow{display:flex; gap:10px; margin: 12px 0 14px;}
.stat{
  flex:1; padding: 10px 12px; border-radius: 14px;
  border:1px solid var(--line); background: rgba(255,255,255,0.03);
}
.statlabel{font-size:12px; color: var(--muted);}
.statval{font-weight:900; font-size:18px; margin-top:4px;}
.statval.big{font-size:28px;}

.btncol{display:flex; flex-direction:column; gap:10px;}
.row{display:flex; gap:10px;}
.primary, .secondary, .ghost, .choice, .inspect, .power, .dangerbtn, .iconbtn{
  border-radius: 14px; border:1px solid var(--line);
  min-height: var(--tap);
  padding: 12px 14px;
  font-weight: 800;
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.primary{
  border:0;
  background: linear-gradient(135deg, rgba(124,169,255,0.95), rgba(124,255,178,0.75));
  color: #09111f;
}
.secondary{background: rgba(124,169,255,0.12); border-color: rgba(124,169,255,0.35);}
.ghost{background: transparent;}
.dangerbtn{background: rgba(255,124,138,0.10); border-color: rgba(255,124,138,0.30);}
.iconbtn{
  width: var(--tap); height: var(--tap);
  display:inline-flex; align-items:center; justify-content:center;
  padding:0;
}
.iconbtn.danger{background: rgba(255,124,138,0.10); border-color: rgba(255,124,138,0.30);}

.primary:active, .secondary:active, .ghost:active, .choice:active, .inspect:active, .power:active, .dangerbtn:active, .iconbtn:active{
  transform: translateY(1px);
}

.tip{
  margin-top: 6px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(124,255,178,0.22);
  background: rgba(124,255,178,0.08);
}

.runslist{display:flex; flex-direction:column; gap:10px; margin-top:8px;}
.runitem{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.03);
  padding: 12px 12px;
  border-radius: 14px;
  display:flex; justify-content:space-between; align-items:center;
  gap:12px;
}
.runitem .left{display:flex; flex-direction:column; gap:2px;}
.runitem .right{font-weight:900; color: var(--accent);}

.hud{
  display:flex; justify-content:space-between; align-items:flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.hudleft{display:flex; gap:10px; flex-wrap:wrap;}
.pill{
  padding: 10px 12px; border-radius: 14px; border:1px solid var(--line);
  background: rgba(255,255,255,0.03);
  min-width: 92px;
}
.pilllabel{font-size:11px; color: var(--muted); font-weight:800; letter-spacing:0.6px;}
.pillval{display:block; font-weight:900; font-size:18px; margin-top:2px;}

.heat{min-width: 140px;}
.heatlabel{font-size:11px; color: var(--muted); font-weight:800; letter-spacing:0.6px; margin-bottom:6px;}
.heatbar{
  width:100%; height: 10px; border-radius: 999px; overflow:hidden;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}
.heatfill{height:100%; width:0%; background: linear-gradient(90deg, rgba(124,255,178,0.95), rgba(255,210,124,0.95), rgba(255,124,138,0.95));}

.runcard .runhdr{display:flex; align-items:flex-start; justify-content:space-between; gap: 12px;}
.badge{
  padding: 8px 10px; border-radius: 999px;
  background: rgba(124,169,255,0.12);
  border: 1px solid rgba(124,169,255,0.35);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
}
.runtitle{font-weight:900; font-size: 16px;}
.prompt{margin-top: 10px; font-size: 16px; line-height: 1.35;}

.timer{position:relative; width:46px; height:46px; flex:0 0 auto;}
.timerval{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  font-weight: 900; font-size: 14px;
}
.ringbg{fill:none; stroke: rgba(255,255,255,0.10); stroke-width: 5;}
.ring{
  fill:none; stroke: rgba(124,169,255,0.95); stroke-width:5;
  stroke-linecap: round;
  stroke-dasharray: 113;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 23px 23px;
}

.clues{margin-top: 10px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid rgba(255,210,124,0.25);
  background: rgba(255,210,124,0.08);
}
.clueshdr{font-weight:900; margin-bottom: 6px;}
.clues ul{margin:0; padding-left: 18px;}
.clues li{margin: 4px 0; color: var(--text);}

.actions{display:flex; gap:10px; margin-top: 12px; flex-wrap:wrap;}
.inspect{background: rgba(255,210,124,0.10); border-color: rgba(255,210,124,0.32); font-weight:900;}
.power{background: rgba(124,169,255,0.10); border-color: rgba(124,169,255,0.28); font-weight:900;}
.power.disabled, .inspect.disabled{opacity:0.55; pointer-events:none;}

.choices{display:flex; flex-direction:column; gap:10px; margin-top:12px;}
.choice{
  text-align:left;
  background: rgba(255,255,255,0.03);
}
.choice:focus{outline: 2px solid rgba(124,169,255,0.65); outline-offset:2px;}

.toast{
  position: fixed;
  left: 14px; right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 760px;
  margin: 0 auto;
  background: rgba(16,24,39,0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.toasttitle{font-weight: 1000; letter-spacing: 0.6px;}
.toastbody{margin-top: 6px; color: var(--muted);}

.divider{height:1px; background: var(--line); margin: 14px 0;}
.list{margin: 8px 0 0; padding-left: 20px;}
.list li{margin: 8px 0; color: var(--text);}

.summarygrid{display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin: 10px 0 6px;}
.summaryitem{border:1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(255,255,255,0.03);}

.modal{
  position: fixed; inset:0;
  background: rgba(0,0,0,0.62);
  display:flex; align-items:center; justify-content:center;
  padding: 14px;
}
.modalcard{
  width:100%; max-width: 520px;
  background: rgba(16,24,39,0.98);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.modalhdr{display:flex; justify-content:space-between; align-items:center; gap:10px;}
.modaltitle{font-weight:1000;}
.modalbody{margin-top: 10px; color: var(--text);}
.modalactions{margin-top: 12px; display:flex; justify-content:flex-end;}

.frames{display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-top: 8px;}
.frame{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.03);
  padding: 12px;
  border-radius: 14px;
}
.frame .name{font-weight:900;}
.frame .req{color: var(--muted); font-size:12px; margin-top:4px;}
.frame button{margin-top:10px; width:100%;}

.footer{
  margin-top: auto;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  display:flex; justify-content:space-between; gap:10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  background: rgba(11,15,23,0.75);
  backdrop-filter: blur(6px);
}

@media (min-width: 520px){
  .hero h1{font-size: 26px;}
  .choices{flex-direction:column;}
  .frames{grid-template-columns: 1fr 1fr 1fr;}
}

@media (prefers-reduced-motion: reduce){
  *{scroll-behavior:auto !important; transition:none !important; animation:none !important;}
}

/* Avatar frame styles (applied to logo) */
.logo.frame_plain{border: 1px solid rgba(255,255,255,0.20);}
.logo.frame_blue{border: 2px solid rgba(124,169,255,0.95);}
.logo.frame_green{border: 2px solid rgba(124,255,178,0.90);}
.logo.frame_gold{border: 2px solid rgba(255,210,124,0.95);}
.logo.frame_glow{border: 2px solid rgba(124,169,255,0.85); box-shadow: 0 0 0 4px rgba(124,169,255,0.18), var(--shadow);}
.logo.frame_legend{border: 2px solid rgba(255,124,138,0.85); box-shadow: 0 0 0 4px rgba(255,124,138,0.18), var(--shadow);}
