@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;600;700;800&display=swap');

:root{
  --bg:#f4f7fb;
  --panel:#ffffff;
  --panel-2:#eef3f9;
  --border:#d5deea;
  --text:#172033;
  --text-dim:#65748b;

  --blue:#1976d2;
  --yellow:#d99a00;
  --red:#dc3545;
  --green:#159957;
  --purple:#7c4dff;

  --font-display:'Press Start 2P', monospace;
  --font-body:'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius:14px;
  --radius-sm:9px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; }
body{
  background:
    radial-gradient(circle at 20% 0%, rgba(25,118,210,0.08), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(220,53,69,0.05), transparent 55%),
    var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  min-height:100vh;
}

#app{ max-width:520px; margin:0 auto; padding:20px 16px 48px; display:flex; flex-direction:column; gap:14px; }

h1{
  font-family:var(--font-display);
  font-size:20px;
  line-height:1.5;
  display:flex; align-items:center; gap:10px;
  margin:6px 0 0;
  color:var(--blue);
  text-shadow:2px 2px 0 rgba(0,0,0,0.35);
}
h2{ font-family:var(--font-display); font-size:16px; margin:0; }

.tagline{ color:var(--text-dim); font-size:13.5px; line-height:1.5; margin:0 0 4px; }
.hint{ color:var(--text-dim); font-size:12.5px; text-align:center; margin:4px 0 0; }
.footnote{ color:var(--text-dim); font-size:11.5px; line-height:1.6; text-align:center; margin-top:6px; }
.connecting{ display:flex; align-items:center; gap:8px; justify-content:center; padding:40px 10px; color:var(--text-dim); font-size:14px; }
.join-error, .geo-error{ color:var(--red); font-size:12.5px; display:flex; align-items:center; gap:6px; margin:8px 0 0; }

/* ---- Icons ---- */
.icon{ width:18px; height:18px; flex:none; vertical-align:middle; }
h1 .icon{ width:24px; height:24px; }
label .icon, .btn .icon, .role-badge .icon{ width:15px; height:15px; }
.tag .icon{ width:12px; height:12px; }
.status-icon-hidden{ color:var(--green); }
.status-icon-revealed{ color:var(--red); }

/* ---- Panels ---- */
.panel{
  background:var(--panel);
  border:2px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  display:flex; flex-direction:column; gap:10px;
}
label{
  display:flex; align-items:center; gap:7px;
  font-size:11.5px; font-weight:700; letter-spacing:0.06em; text-transform:uppercase;
  color:var(--text-dim);
}

/* ---- Inputs ---- */
input[type=text], input[type=number]{
  width:100%;
  background:var(--bg);
  border:2px solid var(--border);
  color:var(--text);
  font-family:var(--font-body);
  font-size:16px;
  padding:11px 12px;
  border-radius:var(--radius-sm);
  outline:none;
}
input[type=text]:focus, input[type=number]:focus{ border-color:var(--blue); }
input[type=checkbox], input[type=radio]{ width:17px; height:17px; accent-color:var(--blue); }

.toggle-row{ flex-direction:row; align-items:center; text-transform:none; letter-spacing:0; font-size:13.5px; color:var(--text); gap:8px; cursor:pointer; }

/* ---- Buttons ---- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family:var(--font-body); font-weight:700; font-size:14.5px;
  border:2px solid transparent;
  border-radius:var(--radius-sm);
  padding:13px 16px;
  cursor:pointer;
  width:100%;
  transition:transform .08s ease;
}
.btn:active{ transform:scale(0.97); }
.btn:disabled{ opacity:0.45; cursor:not-allowed; }
.btn-small{ width:auto; padding:9px 13px; font-size:13px; }

.btn-primary{
  background:var(--blue);
  color:#ffffff;
  border-color:var(--blue);
  box-shadow:0 4px 0 #125a9e;
}
.btn-primary:active{ box-shadow:0 1px 0 #1e6fb8; }

.btn-secondary{ background:var(--panel-2); color:var(--text); border-color:var(--border); }

.btn-exit{ background:transparent; color:var(--red); border-color:var(--red); }
.btn-exit:hover{ background:rgba(255,92,92,0.08); }

.btn-reveal{
  background:var(--green);
  color:#ffffff;
  border-color:var(--green);
  box-shadow:0 4px 0 #107442;
}
.btn-reveal:active{ box-shadow:0 1px 0 #1f9e64; }
.btn-reveal:disabled{ background:var(--panel-2); color:var(--text-dim); border-color:var(--border); box-shadow:none; }

/* ---- Join screen ---- */
.screen-join{ display:flex; flex-direction:column; gap:14px; }

.screen-join h1 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: center;
  text-shadow: none !important;
}

@media (max-width: 480px) {
  .screen-join h1 {
    font-size: 22px;
  }
}
/* ---- Lobby ---- */
.room-code{
  font-family:var(--font-display);
  font-size:26px; letter-spacing:0.12em;
  color:var(--yellow);
  text-align:center; margin:0;
  display:flex; align-items:center; justify-content:center; gap:10px;
}
.player-count{ text-align:center; color:var(--text-dim); font-size:12.5px; display:flex; align-items:center; justify-content:center; gap:6px; margin:0; }

.player-list, .final-roles, .participant-list, .role-pick-list, .chat-messages{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.player-list li, .final-roles li, .participant-list li{
  display:flex; align-items:center; justify-content:space-between;
  background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:10px 12px; font-size:14px;
}
.player-name{ display:flex; align-items:center; gap:7px; }
.player-badges{ display:flex; gap:6px; }
.tag{
  display:flex; align-items:center; gap:4px;
  font-size:10px; font-weight:700; letter-spacing:0.06em; text-transform:uppercase;
  padding:3px 8px; border-radius:999px;
}
.tag-you{ background:rgba(58,160,255,0.15); color:var(--blue); }
.tag-host{ background:rgba(255,204,51,0.15); color:var(--yellow); }

.role-pick-row{ flex-direction:column; align-items:stretch; gap:8px; }
.role-pick-options{ display:flex; gap:14px; }
.role-radio{ display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text); text-transform:none; letter-spacing:0; font-weight:500; cursor:pointer; }

/* ---- HUD / game screen ---- */
.hud-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.hud-item{ display:flex; align-items:center; gap:7px; }
.hud-timer{
  font-family:var(--font-display); font-size:16px; color:var(--text);
  background:var(--panel); border:2px solid var(--border); border-radius:var(--radius-sm);
  padding:8px 12px;
}
.hud-timer.timer-low{ color:var(--red); border-color:var(--red); animation:blink 1s step-start infinite; }
@keyframes blink{ 50%{ opacity:0.35; } }

.role-badge{
  display:flex; align-items:center; gap:6px;
  font-size:11.5px; font-weight:800; letter-spacing:0.06em; text-transform:uppercase;
  padding:8px 12px; border-radius:999px;
}
.role-badge.role-seeker{ background:rgba(255,92,92,0.15); color:var(--red); border:1px solid rgba(255,92,92,0.4); }
.role-badge.role-hider{ background:rgba(58,160,255,0.15); color:var(--blue); border:1px solid rgba(58,160,255,0.4); }

/* ---- Tracker rows: name left, distance badge right ---- */
.tracker-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.tracker-row{
  display:flex; align-items:center; justify-content:space-between;
  background:var(--bg); border:2px solid var(--border); border-radius:var(--radius-sm);
  padding:11px 13px;
}
.tracker-row .row-left{ display:flex; align-items:center; gap:8px; font-size:14.5px; font-weight:600; }
.dist-badge{
  display:flex; align-items:center; gap:6px;
  font-family:var(--font-display); font-size:12px;
  padding:6px 10px; border-radius:var(--radius-sm);
  border:2px solid transparent;
}
.dist-value{ font-size:13px; }
.dist-unit{ font-size:9px; opacity:0.85; }

.zone-blue{ color:var(--blue); }
.dist-badge.zone-blue{ background:rgba(58,160,255,0.12); border-color:var(--blue); }
.tracker-row.zone-blue{ border-color:var(--blue); }

.zone-yellow{ color:var(--yellow); }
.dist-badge.zone-yellow{ background:rgba(255,204,51,0.12); border-color:var(--yellow); }
.tracker-row.zone-yellow{ border-color:var(--yellow); }

.zone-red{ color:var(--red); }
.dist-badge.zone-red{ background:rgba(255,92,92,0.12); border-color:var(--red); }
.tracker-row.zone-red{ border-color:var(--red); }

.zone-nofix{ color:var(--text-dim); }
.dist-badge.zone-nofix{ background:var(--panel-2); border-color:var(--border); }

.empty-row{ text-align:center; color:var(--text-dim); font-size:13px; padding:14px 0; list-style:none; }

/* ---- Chat ---- */
.chat-box{ gap:8px; }
.chat-messages{ max-height:180px; overflow-y:auto; padding-right:2px; }
.chat-messages li{
  background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:8px 10px; font-size:13px; display:flex; flex-direction:column; gap:2px;
}
.chat-messages li.own-message{ border-color:var(--blue); background:rgba(58,160,255,0.08); }
.chat-name{ font-size:10.5px; font-weight:800; color:var(--blue); text-transform:uppercase; letter-spacing:0.04em; }
.chat-text{ color:var(--text); word-break:break-word; }
.chat-input-row{ display:flex; gap:8px; }
.chat-input-row input{ flex:1; }

/* ---- Status chips in participant / final lists ---- */
.role-tag{ display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--text-dim); text-transform:capitalize; }

/* ---- End screen ---- */
.screen-end{ display:flex; flex-direction:column; gap:14px; align-items:stretch; text-align:center; }
.result-title{ display:flex; align-items:center; justify-content:center; gap:10px; font-size:18px; }
.result-title.result-seeker{ color:var(--red); }
.result-title.result-hiders{ color:var(--blue); }



.safety-notice{
  margin:20px 0;
  padding:14px 18px;
  background:#fffaf3;
  border:1px solid #f5d6a6;
  border-left:4px solid #f97316;
  border-radius:10px;
  color:#713f12;
}

.safety-notice strong{
  display:block;
  margin-bottom:4px;
  color:#9a3412;
}

.safety-notice p{
  margin:0;
  font-size:.92rem;
  line-height:1.6;
}

.site-footer{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:16px;
  margin:24px auto 0;
  padding:18px 0;
  border-top:1px solid #d5deea;
  font-size:.9rem;
}
.site-footer a{
  color:#1769aa;
  text-decoration:none;
}
.site-footer a:hover{
  text-decoration:underline;
}


.btn-start-game {
  background: #22c55e;
  color: #fff;
  border: none;
}

.btn-start-game:hover {
  background: #16a34a;
}

.btn-start-game:disabled {
  background: #47d67b;
  cursor: not-allowed;
  opacity: 0.7;
}