:root {
  --bg: #07101f;
  --panel: rgba(12, 20, 35, .82);
  --panel-solid: #101a2d;
  --border: rgba(255,255,255,.13);
  --text: #f6f8fb;
  --muted: #aeb9ca;
  --f5-red: #e21b2d;
  --cyan: #49c6ff;
  --green: #42d392;
  --yellow: #ffd166;
  --orange: #ff9f43;
  --purple: #8a6cff;
  --danger: #ff5263;
  --shadow: 0 24px 70px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, rgba(226,27,45,.28), transparent 28rem),
    radial-gradient(circle at 85% 0%, rgba(73,198,255,.16), transparent 30rem),
    linear-gradient(135deg, #050914 0%, #10182b 56%, #050a13 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, select, textarea { font: inherit; }
.rfp-shell { width: min(1680px, calc(100% - 28px)); margin: 0 auto; padding: 16px 0 32px; }
.rfp-hero {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.025));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.hero-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.f5-logo {
  width: 64px; height: 64px; display: grid; place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #ef2b3c, #a80013);
  color: white; font-weight: 1000; letter-spacing: -1px; font-size: 28px;
  box-shadow: 0 18px 45px rgba(226,27,45,.28);
}
.eyebrow { margin: 0 0 5px; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: #9fc6ff; font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(28px, 3.3vw, 54px); letter-spacing: -0.04em; }
h2 { font-size: clamp(24px, 2.1vw, 38px); letter-spacing: -0.035em; margin-bottom: 10px; }
h3 { margin-bottom: 10px; }
.hero-copy { margin: 0; color: var(--muted); max-width: 760px; }
.hero-actions { display: flex; gap: 9px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.chip, .mini-badge {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  border-radius: 999px; padding: 9px 12px; color: var(--text); text-decoration: none;
  background: rgba(255,255,255,.06); font-size: 13px; font-weight: 800;
}
.chip.success { color: #b9ffd7; border-color: rgba(66,211,146,.35); background: rgba(66,211,146,.08); }
.btn {
  border: 0; border-radius: 15px; padding: 11px 14px; color: white; cursor: pointer;
  font-weight: 900; transition: transform .16s ease, filter .16s ease, background .16s ease, border-color .16s ease;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.07); }
.btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.primary { background: linear-gradient(135deg, #e21b2d, #ff5968); border-color: rgba(255,255,255,.12); box-shadow: 0 18px 38px rgba(226,27,45,.24); }
.secondary { background: linear-gradient(135deg, rgba(73,198,255,.22), rgba(138,108,255,.18)); border-color: rgba(73,198,255,.28); }
.ghost { background: rgba(255,255,255,.055); }
.good { background: linear-gradient(135deg, #1c9d64, #42d392); }
.warn { background: linear-gradient(135deg, #ff9f43, #ffd166); color: #241500; }
.danger { background: linear-gradient(135deg, #bb1b2b, #ff5263); }
.hidden { display: none !important; }
.field { display: grid; gap: 8px; color: var(--muted); font-weight: 800; }
.field textarea, .field select, select.input, .filter-box select {
  width: 100%; color: var(--text); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18);
  border-radius: 15px; padding: 12px 13px; outline: none;
}
.field textarea:focus, select:focus { border-color: rgba(73,198,255,.65); box-shadow: 0 0 0 3px rgba(73,198,255,.16); }
.setup-card {
  max-width: 850px; margin: 54px auto; border: 1px solid var(--border); border-radius: 28px; padding: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.035)); box-shadow: var(--shadow);
}
.setup-intro p { color: var(--muted); }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.big-action { padding: 15px 18px; font-size: 16px; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 16px; align-items: start; }
.main-stage { display: grid; gap: 14px; }
.control-strip, .action-bar, .stage-card, .side-card {
  border: 1px solid var(--border); border-radius: 24px; background: var(--panel); backdrop-filter: blur(18px); box-shadow: var(--shadow);
}
.control-strip { display: grid; grid-template-columns: minmax(210px, .9fr) minmax(420px, 1.8fr) 120px 150px; gap: 12px; align-items: stretch; padding: 13px; }
.turn-box, .round-box { border-radius: 18px; padding: 13px 15px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.1); }
.label { display: block; color: #a4b1c5; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; margin-bottom: 4px; }
.turn-box strong { font-size: clamp(18px, 1.8vw, 28px); line-height: 1.05; }
.round-box strong { font-size: 28px; color: var(--yellow); }
.filter-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.filter-box label { color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; display: grid; gap: 7px; }
.action-bar { display: grid; grid-template-columns: 1.45fr .9fr .9fr .9fr; gap: 10px; padding: 13px; }
.draw-btn { font-size: 17px; }
.stage-card { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 18px; padding: 18px; min-height: 620px; }
.timer-widget {
  border-radius: 26px; min-height: 260px; padding: 18px; background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.032));
  border: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; flex-direction: column; justify-content: center; position: sticky; top: 18px;
}
.timer-ring {
  width: 172px; height: 172px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--timer-color, #566171) var(--timer-progress), rgba(255,255,255,.1) 0deg);
  box-shadow: inset 0 0 36px rgba(0,0,0,.18), 0 20px 55px rgba(0,0,0,.28);
}
.timer-ring > div { width: 132px; height: 132px; border-radius: 50%; display:grid; place-content:center; text-align:center; background: #0b1220; border: 1px solid rgba(255,255,255,.12); }
#timerLabel { font-size: 52px; font-weight: 1000; line-height: .9; letter-spacing: -.05em; color: white; }
.timer-ring small { color: var(--muted); font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.timer-widget p { margin: 14px 0 0; color: var(--muted); text-align: center; font-weight: 800; }
.timer-widget.idle { --timer-color: #566171; }
.timer-widget.running { --timer-color: #42d392; }
.timer-widget.warning { --timer-color: #ffd166; }
.timer-widget.danger { --timer-color: #ff5263; animation: pulseTimer .8s infinite alternate; }
.timer-widget.expired { --timer-color: #ff5263; }
@keyframes pulseTimer { from { filter: brightness(1); } to { filter: brightness(1.25); } }
.rfp-card { border-radius: 26px; background: linear-gradient(135deg, rgba(255,255,255,.095), rgba(255,255,255,.035)); border: 1px solid rgba(255,255,255,.12); padding: 26px; min-height: 580px; position: relative; overflow: hidden; }
.rfp-card::before { content:""; position:absolute; inset:0; background: radial-gradient(circle at 95% 0%, color-mix(in srgb, var(--card-accent, #49c6ff) 35%, transparent), transparent 34rem); opacity:.65; pointer-events:none; }
.rfp-card > * { position: relative; z-index: 1; }
.empty-card { display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-card h2 { color: white; }
.empty-illustration { font-size: 68px; margin-bottom: 10px; }
.card-topline { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; margin-bottom: 16px; }
.pill-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.category-pill, .solution-pill {
  display:inline-flex; align-items:center; gap:7px; padding:9px 12px; border-radius:999px; font-size:13px; font-weight:1000;
  background: color-mix(in srgb, var(--pill-color, #49c6ff) 18%, transparent); border:1px solid color-mix(in srgb, var(--pill-color, #49c6ff) 58%, transparent); color:white;
}
.points-badge { background: rgba(255,209,102,.13); color: var(--yellow); border:1px solid rgba(255,209,102,.35); border-radius: 999px; padding: 10px 13px; font-weight: 1000; white-space: nowrap; }
.section-label { margin: 18px 0 8px; color:#9fc6ff; text-transform:uppercase; letter-spacing:.13em; font-size:12px; font-weight:1000; }
.requirement-box {
  border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.2); border-radius: 22px; padding: 22px;
  font-size: clamp(24px, 2.05vw, 38px); line-height: 1.22; font-weight: 950; letter-spacing: -.03em;
}
.team-callout { display:flex; align-items:center; justify-content:space-between; gap:10px; margin: 14px 0; padding: 12px 15px; border-radius: 18px; background: rgba(73,198,255,.08); border:1px solid rgba(73,198,255,.18); }
.team-callout span { color: var(--muted); font-weight: 900; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.team-callout strong { color:white; font-size: 18px; }
.option-list { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.option-button { border:1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.062); color:white; border-radius: 18px; padding: 14px 15px; text-align:left; min-height:70px; cursor:pointer; display:flex; align-items:center; gap:11px; font-weight: 800; }
.option-button:hover { background: rgba(255,255,255,.11); transform: translateY(-1px); }
.option-button.correct { border-color: rgba(66,211,146,.72); background: rgba(66,211,146,.17); }
.option-button.wrong { border-color: rgba(255,82,99,.55); background: rgba(255,82,99,.1); opacity:.74; }
.answer-prefix { flex: 0 0 34px; width:34px; height:34px; display:grid; place-content:center; border-radius:50%; background: rgba(255,255,255,.12); font-weight: 1000; }
.moderator-guide { margin-top:18px; display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px; }
.guide-card { border:1px solid rgba(255,255,255,.12); background: rgba(4,9,18,.48); border-radius:18px; padding:13px 15px; }
.guide-card strong { display:block; margin-bottom:5px; color:white; }
.guide-card p { color: var(--muted); line-height:1.42; margin:0; }
.side-panel { display:grid; gap: 14px; }
.side-card { padding: 16px; }
.side-card ol { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.55; }
.side-heading { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.ranking-list { display:grid; gap:10px; }
.rank-row { display:grid; grid-template-columns: 38px minmax(0,1fr) auto; gap:10px; align-items:center; padding:12px; border:1px solid rgba(255,255,255,.1); border-radius:18px; background:rgba(255,255,255,.045); }
.rank-row.active { border-color: rgba(73,198,255,.42); background: rgba(73,198,255,.08); }
.rank-index { width:34px; height:34px; display:grid; place-content:center; border-radius:12px; background: rgba(226,27,45,.28); font-weight:1000; }
.rank-team { font-weight: 950; display:grid; gap:2px; }
.rank-team small { color:#9fc6ff; font-size:11px; text-transform:uppercase; letter-spacing:.12em; }
.rank-score { color: var(--yellow); font-weight:1000; }
.score-buttons { display:grid; grid-template-columns: repeat(3, 1fr); gap:9px; }
.score-buttons .btn { min-height: 58px; line-height:1.05; }
.score-buttons span { font-size: 11px; font-weight: 900; opacity:.88; }
.compact-adjust select { margin-bottom: 10px; }
.bonus-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:8px; }
.logs { max-height: 250px; overflow:auto; display:grid; gap:8px; }
.log-line { display:grid; grid-template-columns: 65px 1fr; gap:8px; padding:9px 10px; border-left:3px solid rgba(73,198,255,.8); border-radius:10px; background:rgba(255,255,255,.045); color: var(--muted); font-size: 12px; }
.log-line strong { color:white; }
.rfp-modal-backdrop { position:fixed; inset:0; display:grid; place-items:center; padding:24px; background:rgba(0,0,0,.72); z-index:1000; }
.rfp-modal { width:min(780px,100%); border-radius:28px; border:1px solid var(--border); background:#0f192b; padding:24px; box-shadow: var(--shadow); }
.modal-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.rules-list { color: var(--muted); line-height:1.55; display:grid; gap:10px; }
@media (max-width: 1240px) {
  .game-layout { grid-template-columns: 1fr; }
  .side-panel { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .rfp-hero { flex-direction: column; align-items: flex-start; }
  .control-strip, .action-bar, .stage-card, .option-list, .moderator-guide { grid-template-columns: 1fr; }
  .filter-box { grid-template-columns: 1fr; }
  .side-panel { grid-template-columns: 1fr; }
  .timer-widget { position: static; min-height: 220px; }
}
@media (max-width: 640px) {
  .rfp-shell { width: min(100% - 18px, 1680px); }
  .hero-brand { align-items:flex-start; }
  .f5-logo { width:52px; height:52px; border-radius:16px; font-size:22px; }
  .score-buttons, .bonus-grid { grid-template-columns: 1fr; }
  .requirement-box { font-size: 22px; }
}
