* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #1c1917;
  
  --surface: #292524;
  --surface-light: #3f3835;
  
  --primary: #c85a32;
  --primary-hover: #df6942;
  
  --success: #84a98c;
  --danger: #d9534f;
  --warning: #d4a373;
  
  --text: #f5f2eb;
  --text-muted: #a8a29e;
  
  --radius: 12px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

.app-container {
  width: 100%;
  max-width: 480px ;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
}

header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 0.7rem;
  background: var(--primary);
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pill {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--surface-light);
  color: var(--text-muted);
}

.warning-banner {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--warning);
  color: #fde68a;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  text-align: center;
}

.screen {
  display: none;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.screen.active {
  display: flex;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.muted {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--surface-light);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--primary);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 4px 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--surface-light);
}

.divider span {
  padding: 0 10px;
}

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

.btn {
  padding: 13px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.2s ease;
  color: white;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
}

.btn-secondary {
  background: var(--surface-light);
}

.btn-success {
  background: var(--success);
  width: 100%;
}

/* Lobby */
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#display-room-code {
  font-size: 2.2rem;
  letter-spacing: 3px;
  color: var(--primary);
  font-family: monospace;
}

#qrcode-container {
  background: white;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-dropzone {
  border: 2px dashed var(--primary);
  background: rgba(99, 102, 241, 0.08);
  padding: 18px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.file-dropzone.done {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

.file-dropzone input {
  display: none;
}

.player-list,
.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
}

.ready-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 99px;
}

.ready-badge.yes {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.ready-badge.no {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.settings-row input {
  width: 80px;
  text-align: center;
}

/* Game Screen */
.game-top-bar {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
}

.timer-bar-wrapper {
  width: 100%;
  height: 8px;
  background: var(--surface);
  border-radius: 99px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--primary), #ec4899);
  transition: width 0.1s linear;
}

.photo-stage {
  position: relative;
  width: 100%;
  height: 340px;
  background: #020617;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--surface-light);
}

#game-photo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.reveal-banner {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--primary);
  padding: 12px;
  border-radius: 10px;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  backdrop-filter: blur(6px);
}

.guess-prompt {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.guess-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.guess-btn {
  background: var(--surface);
  border: 2px solid var(--surface-light);
  color: var(--text);
  padding: 14px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s;
}

.guess-btn.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.25);
}

.guess-btn.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.3);
}

.guess-btn.wrong {
  border-color: var(--danger);
  opacity: 0.6;
}

.hidden {
  display: none !important;
}
