/* =============================================
   InPostor — Stylesheet
   Made with ❤️ by Cocoanix
   Apple Deep Blue · Dark Gray Palette
   Fonts: Roboto Bold + Glitch Goblin
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Glitch+Goblin&family=Roboto:wght@400;700;900&display=swap');

/* === CSS Variables === */
:root {
  --bg-primary: #000000;
  --bg-secondary: #1C1C1E;
  --bg-card: #2C2C2E;
  --bg-elevated: #3A3A3C;
  --text-primary: #FFFFFF;
  --text-secondary: #98989D;
  --text-tertiary: #6C6C70;
  --accent: #007AFF;
  --accent-hover: #0056CC;
  --accent-muted: rgba(0, 122, 255, 0.15);
  --border-color: #3A3A3C;
  --border-subtle: #2C2C2E;
  --danger: #FF453A;
  --success: #30D158;
  --warning: #FFD60A;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  --font-body: 'Roboto', system-ui, -apple-system, sans-serif;
  --font-display: 'Glitch Goblin', 'Roboto', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tap-min: 44px;
}

.light-mode {
  --bg-primary: #F2F2F7;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-elevated: #F2F2F7;
  --text-primary: #000000;
  --text-secondary: #6C6C70;
  --text-tertiary: #AEAEB2;
  --accent: #007AFF;
  --accent-hover: #0056CC;
  --accent-muted: rgba(0, 122, 255, 0.1);
  --border-color: #D1D1D6;
  --border-subtle: #E5E5EA;
}

/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  transition: background 0.4s, color 0.4s;
}

/* === Background Video (Server Page) === */
.bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
}

.bg-video.hidden {
  display: none;
}

/* Allow scrolling on mobile client views */
.client-page {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* === Typography === */
h1, .display-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4rem);
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1.1;
}

h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Headings with icons — flex to vertically center icon + text */
h1:has(.material-icons),
h2:has(.material-icons),
h3:has(.material-icons) {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Undo inline margins on icons inside flex headings (gap handles spacing) */
h1:has(.material-icons) .material-icons,
h2:has(.material-icons) .material-icons,
h3:has(.material-icons) .material-icons {
  margin-right: 0 !important;
  margin-left: 0 !important;
}

/* Setting row labels with icons */
.setting-row > label:has(.material-icons) {
  display: flex;
  align-items: center;
  gap: 6px;
}
.setting-row > label:has(.material-icons) .material-icons {
  margin-right: 0 !important;
}

/* Ensure icons in all card/panel headings are vertically centered */
.card h2,
.card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
}
.card h2 .material-icons,
.card h3 .material-icons {
  margin-right: 0 !important;
  margin-left: 0 !important;
}

.subtitle {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

/* === Material Icons === */
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  vertical-align: text-bottom;
  overflow: hidden;
  flex-shrink: 0;
}

.material-icons.md-18 { font-size: 18px; }
.material-icons.md-36 { font-size: 36px; }
.material-icons.md-48 { font-size: 48px; }
.material-icons.md-64 { font-size: 64px; }
.material-icons.md-96 { font-size: 96px; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #FFFFFF;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
  min-height: 50px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.btn:hover {
  background: #48484A;
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.98);
  background: #3A3A3C;
}

.btn-primary {
  background: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  background: #004499;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent-muted);
}

.btn-large {
  padding: 18px 40px;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
  min-height: 56px;
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  min-height: 44px;
}

.btn:disabled {
  opacity: 0.3;
  cursor: default;
  transform: none;
  pointer-events: none;
  filter: grayscale(0.3);
}

.btn .material-icons {
  font-size: 20px;
}

.btn-large .material-icons {
  font-size: 24px;
}

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition);
}

@media (hover: hover) {
  .card:hover {
    border-color: var(--border-color);
  }
}

/* === Inputs === */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-field {
  padding: 15px 18px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 400;
  transition: all var(--transition);
  outline: none;
  min-height: 52px;
  -webkit-appearance: none;
  appearance: none;
}

.input-field:focus {
  border-color: var(--accent);
}

.input-field::placeholder {
  color: var(--text-tertiary);
}

.code-input {
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 16px;
  min-height: 58px;
}

/* === Badge === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--accent-muted);
  color: var(--accent);
}

/* === Start Page === */
.start-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  gap: 24px;
  padding: 24px 20px;
  padding-top: calc(24px + var(--safe-top));
  padding-bottom: calc(24px + var(--safe-bottom));
  text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border-radius: 22px;
  background: var(--accent);
  color: #FFFFFF;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.logo-icon:hover {
  transform: scale(1.05);
}

.logo-icon .material-icons {
  font-size: 48px;
  width: auto;
  height: auto;
}

/* Large icon in game display — fit within smaller containers */
.game-display .logo-icon .material-icons.md-96 {
  font-size: 48px;
}

.tagline {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: -8px;
  letter-spacing: 0.04em;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 360px;
}

.credits {
  position: fixed;
  bottom: 20px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-tertiary);
}

/* === Server Page (Lobby) === */
.server-page {
  display: flex;
  min-height: 100vh;
  gap: 20px;
  padding: 20px;
}

.server-sidebar {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 100vh;
}

.server-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 100vh;
}

.room-code-display {
  text-align: center;
  padding: 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
}

.room-code-display .code {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.room-code-display .label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

/* Player List */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  animation: slideIn 0.25s ease-out;
  min-height: 52px;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

.player-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 900;
  color: #FFFFFF;
  flex-shrink: 0;
  background: var(--accent);
  background-size: cover;
  background-position: center;
}

.player-avatar-img {
  text-indent: -9999px;
}

.player-name-display {
  font-weight: 700;
  flex: 1;
  font-family: var(--font-body);
}

.player-score-display {
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--accent);
}

/* Settings */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.setting-row > span:first-child,
.setting-row > label:first-child {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.setting-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}

.setting-row .value {
  font-family: var(--font-body);
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  font-size: 0.9rem;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-elevated);
  border-radius: 26px;
  transition: var(--transition);
}

.toggle .slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked + .slider {
  background: var(--accent);
}

.toggle input:checked + .slider::before {
  transform: translateX(22px);
}

/* === Game Display === */
.game-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 24px;
}

.round-indicator {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.game-status {
  font-family: var(--font-body);
  font-size: 1.8rem;
  font-weight: 900;
}

.waiting-animation {
  display: flex;
  gap: 6px;
  align-items: center;
}

.waiting-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotBounce 1.4s infinite ease-in-out;
  opacity: 0.6;
}

.waiting-dot:nth-child(2) { animation-delay: 0.2s; }
.waiting-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* === Reveal Grid === */
.reveal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 900px;
}

.reveal-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
  word-break: break-word;
}

.reveal-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.15);
  transform: translateY(-2px);
}

.reveal-card-hidden {
  opacity: 0;
  transform: translateY(30px) scale(0.92);
  pointer-events: none;
}

@keyframes cardReveal {
  0% { opacity: 0; transform: translateY(30px) scale(0.92); }
  60% { opacity: 1; transform: translateY(-4px) scale(1.02); }
  80% { transform: translateY(2px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes questionSlideUp {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.reveal-card .player-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.reveal-card .q-label,
.reveal-card .a-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.reveal-card .q-text {
  font-family: var(--font-body);
  font-weight: 700;
  margin: 2px 0 10px;
  font-size: 0.95rem;
}

.reveal-card .a-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.reveal-card-answer-highlight {
  border-color: var(--accent) !important;
  box-shadow: 0 0 20px rgba(0, 122, 255, 0.2);
}

/* === Vote Section === */
.vote-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.vote-card {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  min-width: 130px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.vote-card:active {
  border-color: var(--accent);
  background: var(--accent-muted);
  transform: scale(0.96);
}

.vote-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.vote-card.selected {
  border-color: var(--accent);
  background: var(--accent-muted);
}

/* Server-side vote cards — larger, display only */
.server-vote-card {
  cursor: default;
  min-width: 150px;
  min-height: 110px;
  padding: 20px 28px;
  animation: fadeInScale 0.4s ease-out both;
}

.server-vote-card:nth-child(1) { animation-delay: 0.05s; }
.server-vote-card:nth-child(2) { animation-delay: 0.1s; }
.server-vote-card:nth-child(3) { animation-delay: 0.15s; }
.server-vote-card:nth-child(4) { animation-delay: 0.2s; }
.server-vote-card:nth-child(5) { animation-delay: 0.25s; }
.server-vote-card:nth-child(6) { animation-delay: 0.3s; }
.server-vote-card:nth-child(7) { animation-delay: 0.35s; }
.server-vote-card:nth-child(8) { animation-delay: 0.4s; }
.server-vote-card:nth-child(9) { animation-delay: 0.45s; }
.server-vote-card:nth-child(10) { animation-delay: 0.5s; }

.server-vote-card:hover {
  transform: none;
  border-color: var(--border-subtle);
}
.server-vote-card:active {
  transform: none;
  border-color: var(--border-subtle);
  background: var(--bg-card);
}

.vote-card .voter-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
}

.vote-bar-container {
  width: 100%;
  max-width: 400px;
  margin: 6px auto;
}

/* Server (big screen) vote bars — wider and more prominent */
.server-main .vote-bar-container {
  max-width: 600px;
}

.server-main .vote-bar .bar-label {
  min-width: 100px;
  font-size: 1rem;
}

.server-main .vote-bar .bar-track {
  height: 32px;
  border-radius: 16px;
}

.server-main .vote-bar .bar-fill {
  font-size: 0.9rem;
  border-radius: 16px;
  padding-right: 14px;
}

.vote-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5px 0;
}

.vote-bar .bar-label {
  min-width: 80px;
  text-align: right;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
}

.vote-bar .bar-track {
  flex: 1;
  height: 26px;
  background: var(--bg-secondary);
  border-radius: 13px;
  overflow: hidden;
}

.vote-bar .bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 13px;
  transition: width 0.8s ease-out;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: #FFFFFF;
}

.bar-fill.danger-bar {
  background: var(--danger);
}

/* === Punishment Wheel === */
.wheel-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid var(--accent);
  position: relative;
  overflow: hidden;
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  background: var(--bg-secondary);
}

.wheel-segment {
  position: absolute;
  width: 50%;
  height: 50%;
  top: 0;
  left: 50%;
  transform-origin: 0% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-segment span {
  position: absolute;
  left: 16px;
  top: 12px;
  font-family: var(--font-body);
  font-size: 0.5rem;
  font-weight: 700;
  color: #FFFFFF;
  transform: rotate(15deg);
  width: 36px;
  text-align: center;
  line-height: 1.2;
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--accent);
  z-index: 10;
}

.wheel-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 50px; height: 50px;
  background: var(--bg-card);
  border-radius: 50%;
  border: 3px solid var(--accent);
  z-index: 5;
}

/* === Scoreboard === */
.scoreboard {
  width: 100%;
  max-width: 500px;
  border-collapse: collapse;
}

.scoreboard th, .scoreboard td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-body);
}

.scoreboard th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.rank-1 {
  color: var(--accent);
  font-weight: 900;
}

/* === Client Page (Mobile) === */
.client-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  padding-top: calc(24px + var(--safe-top));
  padding-bottom: calc(40px + var(--safe-bottom));
  gap: 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.client-card {
  width: 100%;
  max-width: 420px;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.client-question-area {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.question-display {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 2px solid var(--border-subtle);
  line-height: 1.45;
  word-break: break-word;
}

.client-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.answer-sent-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
}

.answer-sent-check .material-icons {
  font-size: 44px;
}

/* === Notification / Toast === */
.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 28px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  z-index: 1000;
  animation: toastIn 0.3s ease-out;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--success); color: var(--success); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === Language Select === */
.lang-select {
  display: flex;
  gap: 4px;
}

.lang-btn {
  padding: 6px 14px;
  border: 2px solid var(--border-subtle);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  transition: all var(--transition);
}

.lang-btn:hover {
  border-color: var(--border-color);
}

.lang-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #FFFFFF;
}

/* === Responsive === */
@media (max-width: 768px) {
  .server-page {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }
  .server-sidebar {
    width: 100%;
    max-height: none;
    order: 2;
  }
  .server-main {
    order: 1;
    max-height: none;
  }
  .room-code-display .code {
    font-size: 2.2rem;
  }
  .reveal-grid {
    grid-template-columns: 1fr;
  }
  .wheel-container {
    width: 220px;
    height: 220px;
  }
  .logo-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
  }
  .logo-icon .material-icons {
    font-size: 44px;
  }
  .vote-card {
    min-width: 110px;
    min-height: 80px;
    padding: 14px 16px;
  }
  .card {
    padding: 18px;
  }
  .input-field {
    font-size: 1rem;
    padding: 14px 16px;
    min-height: 48px;
  }
  .btn {
    min-height: 48px;
    padding: 12px 24px;
    font-size: 0.95rem;
  }
  .btn-large {
    min-height: 54px;
    padding: 16px 32px;
    font-size: 1.05rem;
  }
}

@media (max-width: 400px) {
  .btn-large { padding: 14px 24px; font-size: 1rem; min-height: 50px; }
  h1, .display-text { font-size: 1.9rem; }
  .code-input { font-size: 1.6rem; padding: 14px; min-height: 52px; }
  .question-display { font-size: 1.1rem; padding: 16px; }
  .vote-grid { gap: 8px; }
  .vote-card { min-width: 100px; min-height: 76px; padding: 12px 14px; }
  .client-page { padding: 16px 12px; gap: 14px; }
  .start-page { padding: 20px 14px; gap: 18px; }
  .player-item { padding: 10px 12px; }
  .player-avatar { width: 36px; height: 36px; font-size: 0.9rem; }
  .logo-icon { width: 68px; height: 68px; border-radius: 18px; }
  .logo-icon .material-icons { font-size: 36px; }
}

/* Extra small phones */
@media (max-width: 360px) {
  .btn-large { padding: 12px 20px; font-size: 0.95rem; min-height: 46px; }
  h1, .display-text { font-size: 1.7rem; }
  .code-input { font-size: 1.4rem; letter-spacing: 0.15em; }
  .vote-card { min-width: 80px; padding: 10px 12px; font-size: 0.85rem; }
}

/* === Utility Classes === */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* === Accent text utility === */
.accent-text { color: var(--accent); }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }

/* === Avatar Picker === */
.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.avatar-option {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  border: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.avatar-option:active {
  transform: scale(1.15);
}

.avatar-option.selected {
  border-color: #FFFFFF;
  box-shadow: 0 0 0 2px var(--accent);
  transform: scale(1.12);
}

/* === Avatar Upload === */
.avatar-upload {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  border: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  background-color: var(--bg-secondary);
  -webkit-tap-highlight-color: transparent;
}

.avatar-upload:hover {
  border-color: var(--accent);
}

.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s;
}

.avatar-upload:hover .avatar-upload-overlay,
.avatar-upload:active .avatar-upload-overlay {
  opacity: 1;
}

.avatar-remove-btn {
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  min-height: 36px;
}

.avatar-remove-btn:hover {
  background: #cc372e;
}

/* === Dividers === */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 8px 0;
}
