
:root {
  --bg: #050814;
  --bg-card: #101524;
  --bg-card-soft: #080d18;
  --accent: #00c4ff;
  --accent-soft: rgba(0, 196, 255, 0.12);
  --accent-strong: #0094d4;
  --accent-pink: #ff3366;
  --danger: #ff6b81;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border-subtle: #1f2937;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.5);
  --transition-fast: 150ms ease-out;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at top, #111827 0, #020617 55%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.app {
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(7, 12, 24, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: radial-gradient(circle at 25% 0, #00e0ff, #00a4ff 55%, #0080c9 95%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-mark img {
  width: 32px;
  height: 32px;
  display: block;
}

.title-block h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.08em;
}

.subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.version-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 196, 255, 0.12);
  border: 1px solid rgba(0, 196, 255, 0.55);
  font-size: 12px;
  color: #e0f2fe;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.app-footer a {
  font-weight: 500;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.card {
  background: radial-gradient(circle at top left, #111827 0, #020617 65%);
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.card-centered {
  max-width: 480px;
  margin: 0 auto;
}

.card h2 {
  margin-top: 0;
}

.info-card {
  background: linear-gradient(135deg, #080d18 0, #020617 70%);
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
}

.layout-two.game-layout {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
}

@media (max-width: 800px) {
  .app {
    padding: 10px;
  }
  .app-header {
    border-radius: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .layout-two,
  .layout-two.game-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.field span {
  font-size: 13px;
  color: var(--muted);
}

input[type="text"],
select {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 10px 14px;
  outline: none;
  font-size: 14px;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast);
}

input[type="text"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 196, 255, 0.7);
  background: rgba(15, 23, 42, 1);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn.small {
  padding: 5px 10px;
  font-size: 12px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #020617;
  box-shadow: 0 14px 30px rgba(0, 196, 255, 0.55);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(0, 196, 255, 0.8);
}

.btn.outline {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.9);
  color: var(--text);
}

.btn.outline:hover {
  background: rgba(15, 23, 42, 0.9);
}

.btn.subtle {
  background: rgba(15, 23, 42, 0.8);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.btn.subtle:hover {
  background: rgba(15, 23, 42, 1);
}

.btn.full {
  width: 100%;
}

.split-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.join-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.join-row input {
  flex: 1;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

.divider {
  margin-top: 8px;
  margin-bottom: 4px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  position: relative;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: rgba(148, 163, 184, 0.4);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.hint {
  font-size: 13px;
  color: var(--muted);
}

.hint.tiny {
  font-size: 11px;
}

.players-list {
  margin-top: 10px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(11, 15, 28, 0.96);
  border: 1px solid rgba(55, 65, 81, 0.9);
  max-height: 220px;
  overflow-y: auto;
}

.player-row {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.player-row:last-child {
  border-bottom: none;
}

.player-name-with-dot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.player-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--muted);
}

.player-dead {
  opacity: 0.45;
  text-decoration: line-through;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(0, 196, 255, 0.14);
  border: 1px solid rgba(0, 196, 255, 0.7);
  color: #e0f2fe;
}

.badge.secondary {
  background: rgba(79, 70, 229, 0.22);
  border: 1px solid rgba(129, 140, 248, 0.7);
  color: #c7d2fe;
}

.pill {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.top-bar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.category-label strong,
.room-ref strong {
  color: var(--text);
}

.clues-wrapper {
  border-radius: 14px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(11, 15, 28, 0.96);
  overflow: auto;
}

#clues-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#clues-table thead {
  background: rgba(7, 11, 22, 0.98);
  position: sticky;
  top: 0;
  z-index: 1;
}

#clues-table th,
#clues-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  text-align: left;
}

#clues-table th {
  font-weight: 500;
  color: var(--muted);
}

#clues-table td {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

#clues-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.85);
}

.status-text {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.status-text.highlight {
  color: #f9fafb;
}

.button-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.stacked {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.side-panel {
  min-height: 260px;
}

.lobby-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.lobby-config {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  .config-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.howto-list {
  padding-left: 18px;
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.field-label {
  font-size: 13px;
  color: var(--muted);
}

.voting-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voting-buttons .btn {
  justify-content: space-between;
}

.overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(7, 10, 18, 0.98), #020617);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.overlay.hidden {
  display: none;
}

.role-card {
  max-width: 360px;
  width: 90%;
  text-align: center;
  background: radial-gradient(circle at top, #00c4ff22, #020617 70%);
}

.small-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.role-word {
  font-size: 26px;
  font-weight: 700;
  margin: 10px 0 4px;
}

.role-extra {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.countdown-text {
  font-size: 13px;
  color: #a5b4fc;
  margin-top: 6px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(7, 10, 18, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 160ms ease-out, transform 180ms ease-out;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.title-logo {
    display: block;
    margin: 0 auto 6px auto;
    max-width: 420px;
    width: 60%;
    height: auto;
    object-fit: contain;
}

.title-block {
    text-align: center;
}

