/* client/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #000;
  --white: #fff;
  --yellow: #FFE600;
  --red: #FF0000;
  --border: 4px solid #000;
}

body {
  background: var(--white);
  color: var(--black);
  font-family: 'Arial Black', Arial, monospace;
  min-height: 100vh;
}

.screen { display: none; min-height: 100vh; padding: 24px; }
.screen.active { display: block; }
/* Flex screens need display:flex when active — ID specificity must beat .screen.active */
#screen-home.active, #screen-name.active { display: flex; }

/* HOME */
#screen-home {
  flex-direction: column; align-items: flex-start;
  justify-content: center; padding: 48px;
}
#screen-home h1 {
  font-size: clamp(48px, 10vw, 120px); font-weight: 900;
  text-transform: uppercase; line-height: 0.9;
  border-bottom: 8px solid var(--black); padding-bottom: 16px; margin-bottom: 48px;
}

/* BUTTONS */
.btn {
  display: inline-block; background: var(--black); color: var(--white);
  font-family: inherit; font-size: 20px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 2px;
  border: var(--border); padding: 16px 32px; cursor: pointer;
}
.btn:hover { background: var(--white); color: var(--black); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; background: var(--black); color: var(--white); }
.btn-outline { background: var(--white); color: var(--black); }
.btn-outline:hover { background: var(--black); color: var(--white); }

/* INPUTS */
input[type="text"] {
  font-family: inherit; font-size: 20px; font-weight: 700;
  text-transform: uppercase; border: var(--border);
  padding: 14px 18px; background: var(--white); color: var(--black);
  outline: none; width: 100%; max-width: 400px;
}
input[type="text"]:focus { background: var(--yellow); }
input[type="text"]::placeholder { color: #999; }

/* NAME ENTRY */
#screen-name {
  flex-direction: column; align-items: flex-start;
  justify-content: center; padding: 48px;
}
#screen-name h2 { font-size: 48px; font-weight: 900; text-transform: uppercase; margin-bottom: 32px; }
.name-form { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 400px; }

/* LOBBY */
#screen-lobby { padding: 32px; }
.lobby-code {
  font-size: clamp(64px, 12vw, 140px); font-weight: 900;
  letter-spacing: 8px; border: var(--border);
  padding: 16px 32px; display: inline-block; margin: 16px 0;
}
.lobby-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.player-list { list-style: none; border: var(--border); margin-bottom: 24px; }
.player-list li {
  padding: 14px 20px; font-size: 20px; font-weight: 700;
  text-transform: uppercase; border-bottom: 3px solid var(--black);
}
.player-list li:last-child { border-bottom: none; }
.player-list li.is-host::after { content: ' [HOST]'; font-size: 14px; opacity: 0.5; }
.quota-display {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; padding: 10px 16px; border: 3px solid var(--black);
  display: inline-block; margin-top: 16px;
}
.quota-display.warn { background: var(--yellow); }
.quota-display.limit { background: var(--red); color: var(--white); }

/* WATCHING */
#screen-watching { padding: 0; position: relative; }
.video-container { width: 100%; height: 100vh; }
.video-container iframe { width: 100%; height: 100%; border: none; display: block; }
.volume-control {
  position: fixed; bottom: 80px; right: 20px;
  background: var(--white); border: var(--border);
  padding: 12px 16px; z-index: 100;
  display: flex; align-items: center; gap: 10px;
}
.volume-control label { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
input[type="range"] { accent-color: var(--black); width: 100px; }
.word-submit-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); border-top: var(--border);
  padding: 16px 20px; display: flex; gap: 12px; align-items: center; z-index: 100;
}
.word-submit-bar input { flex: 1; max-width: none; }

/* DISCUSSING */
#screen-discussing { padding: 32px; }
#screen-discussing h2 {
  font-size: clamp(32px, 6vw, 72px); font-weight: 900; text-transform: uppercase;
  margin-bottom: 32px; border-bottom: var(--border); padding-bottom: 16px;
}
.submission-list { list-style: none; border: var(--border); margin-bottom: 32px; }
.submission-list li {
  padding: 14px 20px; font-size: 18px; font-weight: 700;
  text-transform: uppercase; border-bottom: 3px solid var(--black);
  display: flex; justify-content: space-between;
}
.submission-list li:last-child { border-bottom: none; }
.tag-submitted { opacity: 0.5; font-size: 14px; }
.tag-waiting { color: var(--red); font-size: 14px; }

/* VOTING */
#screen-voting { padding: 32px; }
#screen-voting h2 { font-size: clamp(32px, 6vw, 72px); font-weight: 900; text-transform: uppercase; margin-bottom: 8px; }
#screen-voting .subtitle { font-size: 16px; font-weight: 700; text-transform: uppercase; opacity: 0.5; margin-bottom: 32px; }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.vote-btn {
  display: block; width: 100%; background: var(--white); color: var(--black);
  font-family: inherit; font-size: 22px; font-weight: 900;
  text-transform: uppercase; border: var(--border);
  padding: 24px 16px; cursor: pointer; text-align: center;
}
.vote-btn:hover { background: var(--black); color: var(--white); }
.vote-btn:disabled { background: var(--black); color: var(--white); opacity: 0.3; cursor: not-allowed; }
.vote-progress { margin-top: 24px; font-size: 14px; font-weight: 700; text-transform: uppercase; opacity: 0.5; }

/* REVEAL */
#screen-reveal { padding: 32px; }
.imposter-label { font-size: 20px; font-weight: 700; text-transform: uppercase; opacity: 0.6; }
.imposter-name {
  font-size: clamp(48px, 10vw, 120px); font-weight: 900;
  text-transform: uppercase; color: var(--red); line-height: 0.9; margin-bottom: 48px;
}
.reveal-section { margin-bottom: 40px; }
.reveal-section h3 {
  font-size: 22px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 2px; border-bottom: var(--border); padding-bottom: 8px; margin-bottom: 16px;
}
.words-table, .scores-table { width: 100%; border-collapse: collapse; border: var(--border); }
.words-table td, .words-table th, .scores-table td, .scores-table th {
  padding: 12px 16px; text-align: left; font-size: 18px;
  font-weight: 700; text-transform: uppercase; border: 3px solid var(--black);
}
.words-table th, .scores-table th { background: var(--black); color: var(--white); font-size: 14px; letter-spacing: 1px; }
.imposter-row td { background: var(--red); color: var(--white); }
.next-round-bar { margin-top: 40px; display: flex; gap: 12px; flex-wrap: wrap; }

/* TOAST */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: var(--white); font-size: 16px;
  font-weight: 900; text-transform: uppercase; letter-spacing: 2px;
  padding: 16px 32px; border: 4px solid var(--black); z-index: 9999; display: none;
}
.toast.show { display: block; }
