/* ═══════════════════════════════════════════
   One Piece Word Imposter – Stylesheet
   Theme: Pirate Gold / Deep Ocean / Red
═══════════════════════════════════════════ */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --primary: #f0a500;
  --primary-dark: #c8880a;
  --secondary: #e74c3c;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --green: #3fb950;
  --red: #e74c3c;
  --border: #30363d;
  --radius: 12px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

/* ── Screens ────────────────────────────── */
.screen { display: none; width: 100%; max-width: 520px; flex-direction: column; gap: 1rem; }
.screen.active { display: flex; }

/* ── Logo ───────────────────────────────── */
.logo-area { text-align: center; padding: 1.5rem 0 .5rem; }
.logo-icon { font-size: 3.5rem; }
.logo-area h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.2; }
.logo-area h1 span { color: var(--primary); }

/* ── Language Toggle ────────────────────── */
.lang-toggle { display: flex; gap: .5rem; justify-content: center; }
.lang-toggle button {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-dim); padding: .35rem .8rem; border-radius: 6px; cursor: pointer; font-size: .85rem;
  transition: all .2s;
}
.lang-toggle button.active, .lang-toggle button:hover { border-color: var(--primary); color: var(--primary); }

/* ── Card ───────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}

/* ── Inputs ─────────────────────────────── */
.input {
  width: 100%; padding: .7rem 1rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-size: 1rem; outline: none; transition: border-color .2s;
}
.input:focus { border-color: var(--primary); }

/* ── Buttons ────────────────────────────── */
.btn {
  width: 100%; padding: .75rem 1rem; border-radius: 8px;
  border: none; cursor: pointer; font-size: 1rem; font-weight: 600;
  transition: all .2s; letter-spacing: .02em;
}
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-secondary:hover { background: rgba(240,165,0,.1); }
.btn-group { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; }
.btn-icon { background: transparent; border: none; cursor: pointer; font-size: 1.1rem; padding: .2rem; }

/* ── Top Bar ────────────────────────────── */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .6rem 1rem;
}
.room-code-display { display: flex; align-items: center; gap: .4rem; font-size: .9rem; }
.room-code-display strong { color: var(--primary); font-size: 1.2rem; letter-spacing: .1em; }

/* ── Timer ──────────────────────────────── */
.timer {
  font-size: 1.4rem; font-weight: 800; color: var(--primary);
  min-width: 3.5rem; text-align: right;
}
.timer.urgent { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── Player List ────────────────────────── */
.player-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.player-list li {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface2); border-radius: 8px; padding: .45rem .8rem;
  border: 1px solid var(--border);
}
.player-list li .crown { color: var(--primary); }
.player-list li .dead { opacity: .4; text-decoration: line-through; }
.player-badge {
  margin-left: auto; font-size: .75rem; padding: .15rem .5rem;
  border-radius: 20px; font-weight: 600;
}
.badge-host { background: rgba(240,165,0,.2); color: var(--primary); }
.badge-you { background: rgba(63,185,80,.2); color: var(--green); }

/* ── Settings ───────────────────────────── */
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: .4rem 0; }
.setting-row label { font-size: .95rem; color: var(--text-dim); }
.number-input { display: flex; align-items: center; gap: .6rem; }
.number-input button {
  width: 2rem; height: 2rem; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.number-input button:hover { border-color: var(--primary); color: var(--primary); }
.number-input span { min-width: 2rem; text-align: center; font-weight: 700; color: var(--primary); }

/* ── Word Card ──────────────────────────── */
.word-card { text-align: center; padding: 2rem 1.5rem; }
.big-word { font-size: 2rem; font-weight: 800; color: var(--primary); margin: .8rem 0; word-break: break-word; }
.word-hint { font-size: .9rem; color: var(--text-dim); font-style: italic; margin-top: .3rem; }
#word-role-label { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.role-citizen { color: var(--green); }
.role-imposter { color: var(--red); }

/* ── Voting ─────────────────────────────── */
.vote-progress {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .6rem 1rem;
  font-size: .9rem; color: var(--text-dim); text-align: center;
}
.vote-list { display: flex; flex-direction: column; gap: .6rem; }
.vote-btn {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: .9rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: all .2s; color: var(--text); font-size: 1rem;
}
.vote-btn:hover { border-color: var(--primary); background: rgba(240,165,0,.06); }
.vote-btn.voted { border-color: var(--secondary); background: rgba(231,76,60,.08); cursor: default; }
.vote-count { font-weight: 700; color: var(--primary); min-width: 1.5rem; text-align: right; }
.vote-check { color: var(--green); font-size: 1.1rem; }

/* ── Result Screen ──────────────────────── */
#result-content { text-align: center; padding: 1.5rem; }
.result-title { font-size: 1.8rem; font-weight: 800; margin-bottom: .5rem; }
.result-subtitle { font-size: 1rem; color: var(--text-dim); }
.win-citizens { color: var(--green); }
.win-impostors { color: var(--red); }
.reveal-word { margin-top: .6rem; }
.reveal-word strong { color: var(--primary); }

/* ── Misc ───────────────────────────────── */
.hidden { display: none !important; }
.mt { margin-top: .8rem; }
.center-text { text-align: center; }
.error-msg { color: var(--red); font-size: .9rem; text-align: center; padding: .4rem; }
.info-msg { color: var(--text-dim); font-size: .9rem; text-align: center; padding: .4rem; }
h2 { font-size: 1.3rem; text-align: center; }
h3 { font-size: 1rem; color: var(--text-dim); margin-bottom: .2rem; }

/* ── Toast ──────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #000; font-weight: 700;
  padding: .6rem 1.4rem; border-radius: 30px; font-size: .9rem;
  animation: slideUp .3s ease;
}
@keyframes slideUp { from{transform:translateX(-50%) translateY(20px);opacity:0} to{transform:translateX(-50%) translateY(0);opacity:1} }

/* ── Responsive ─────────────────────────── */
@media (max-width: 400px) {
  .big-word { font-size: 1.5rem; }
  .logo-area h1 { font-size: 1.5rem; }
}

/*  Mode selector ─ */
.mode-selector { display: flex; flex-direction: column; gap: .4rem; width: 100%; margin-top: .4rem; }
.mode-btn {
  width: 100%; padding: .5rem .8rem; border-radius: 8px; text-align: left;
  background: var(--surface2); border: 2px solid var(--border);
  color: var(--text-dim); cursor: pointer; font-size: .9rem; transition: all .2s;
}
.mode-btn.active, .mode-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(240,165,0,.08); }
.mode-note { font-size: .8rem; color: var(--text-dim); text-align: center; padding: .3rem; }

/*  Team colors  */
.team-marine { color: #4fc3f7; }
.team-pirates { color: var(--red); }
.team-imu { color: #ce93d8; }
.team-badge-marine { background: rgba(79,195,247,.2); color: #4fc3f7; }
.team-badge-pirates { background: rgba(231,76,60,.2); color: var(--red); }
.team-badge-imu { background: rgba(206,147,216,.2); color: #ce93d8; }

/*  Active team highlight  */
.team-active { border-color: var(--primary) !important; }
.team-inactive { opacity: .5; }

/*  Btn variants  */
.btn-green { background: var(--green); color: #000; }
.btn-green:hover { background: #2ea043; transform: translateY(-1px); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c0392b; transform: translateY(-1px); }

/*  Character suggestions ─ */
.char-suggestions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; max-height: 8rem; overflow-y: auto; }
.char-chip {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: .25rem .7rem; font-size: .82rem;
  cursor: pointer; color: var(--text-dim); transition: all .2s;
}
.char-chip:hover { border-color: var(--primary); color: var(--primary); }

/*  MP turn indicator  */
.mp-turn-indicator {
  text-align: center; padding: .8rem; border-radius: var(--radius);
  font-weight: 700; font-size: 1rem; border: 2px solid transparent;
}
.mp-turn-marine { background: rgba(79,195,247,.1); border-color: #4fc3f7; color: #4fc3f7; }
.mp-turn-pirates { background: rgba(231,76,60,.1); border-color: var(--red); color: var(--red); }

/*  Skipped player indicator  */
.player-skipped { opacity: .4; }
.badge-skipped { background: rgba(231,76,60,.2); color: var(--red); font-size: .75rem; padding: .15rem .5rem; border-radius: 20px; font-weight: 600; }
.badge-active { background: rgba(240,165,0,.2); color: var(--primary); font-size: .75rem; padding: .15rem .5rem; border-radius: 20px; font-weight: 600; }
