* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: white;
}

button,
input {
  font: inherit;
}

.app {
  width: min(520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.back-link {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 700;
}

.status {
  font-size: 13px;
  color: #94a3b8;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

h1 {
  margin: 16px 0 8px;
  font-size: 52px;
  line-height: 1;
}

h2 {
  margin: 24px 0 14px;
  font-size: 28px;
}

.subtitle,
.hint {
  color: #cbd5e1;
  line-height: 1.5;
}

label {
  display: block;
  margin-top: 22px;
  color: #cbd5e1;
  font-weight: 700;
}

input {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #334155;
  border-radius: 16px;
  background: #020617;
  color: white;
  outline: none;
  font-size: 18px;
}

input:focus {
  border-color: #93c5fd;
}

button {
  width: 100%;
  margin-top: 18px;
  padding: 16px 18px;
  border: 0;
  border-radius: 16px;
  background: #2563eb;
  color: white;
  font-weight: 800;
  font-size: 18px;
}

button:active {
  transform: scale(0.99);
}

button.secondary {
  background: #1e293b;
}

button:disabled {
  opacity: 0.45;
}

.divider {
  margin: 26px 0 6px;
  text-align: center;
  color: #64748b;
}

.error {
  min-height: 24px;
  color: #fca5a5;
  font-weight: 700;
}

.room-code-box {
  padding: 22px;
  border-radius: 22px;
  background: #1e293b;
  border: 1px solid #334155;
  text-align: center;
}

.room-code-box span {
  display: block;
  color: #94a3b8;
  margin-bottom: 8px;
}

.room-code-box strong {
  font-size: 44px;
  letter-spacing: 0.18em;
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.player-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #1e293b;
}

.player-list small {
  color: #94a3b8;
}

.kick-btn {
  width: auto;
  margin-top: 0;
  padding: 2px 10px;
  font-size: 18px;
  line-height: 1;
  background: #991b1b;
  border-radius: 6px;
  color: #fca5a5;
}

.difficulty-selector {
  margin-top: 22px;
}

.difficulty-selector > span {
  display: block;
  color: #cbd5e1;
  font-weight: 700;
  margin-bottom: 10px;
}

.diff-btns {
  display: flex;
  gap: 8px;
}

.diff-btn,
.hint-btn {
  flex: 1;
  margin-top: 0;
  padding: 12px 8px;
  font-size: 15px;
  background: #1e293b;
  border: 2px solid transparent;
}

.diff-btn.active,
.hint-btn.active {
  border-color: #2563eb;
  background: #1e3a8a;
}

.role-card {
  margin-top: 22px;
  padding: 28px;
  min-height: 220px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, #1d4ed8, transparent 40%),
    #1e293b;
  border: 1px solid #334155;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.role-card span {
  color: #93c5fd;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.role-card strong {
  margin-top: 18px;
  font-size: 48px;
  line-height: 1.05;
}

.role-card.imposter {
  background:
    radial-gradient(circle at top left, #b91c1c, transparent 40%),
    #1e293b;
}

.role-card.imposter span {
  color: #fca5a5;
}

.role-card.imposter strong {
  font-size: 36px;
}

.role-card small {
  margin-top: 16px;
  font-size: 22px;
  font-weight: 700;
  color: #fde68a;
}

.role-card small:empty {
  display: none;
}
.result-card {
  margin-top: 22px;
  padding: 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, #7f1d1d, transparent 40%),
    #1e293b;
  border: 1px solid #334155;
}

.result-card span {
  color: #fca5a5;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-card strong {
  display: block;
  margin-top: 14px;
  font-size: 44px;
  line-height: 1.05;
}

.word-summary {
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
  background: #020617;
  border: 1px solid #1e293b;
}

.word-summary p {
  margin: 8px 0;
  color: #cbd5e1;
}

.word-summary strong {
  color: white;
}