:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: #0f172a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  background: #f1f5f9;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
}

.subtitle {
  margin: 4px 0 0;
  color: #64748b;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  margin-bottom: 24px;
}

.room-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  align-items: center;
}

.room-code {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-code {
  width: 140px;
  height: 140px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.pill {
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

button.primary {
  background: #2563eb;
  color: #ffffff;
}

button.secondary {
  background: #e2e8f0;
}

button.danger {
  background: #ef4444;
  color: #ffffff;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

td,
th {
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
}

.leaderboard {
  display: none;
}

.leaderboard.visible {
  display: block;
}

.leaderboard ol {
  padding-left: 20px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-weight: 600;
}

input,
select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  font-size: 16px;
}

.hidden {
  display: none;
}

.error {
  color: #dc2626;
  font-weight: 600;
}

.celebration {
  background: #dcfce7;
  color: #166534;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.celebration-animate {
  animation: pop 1.2s ease;
}

.notification {
  background: #ede9fe;
  color: #4c1d95;
  font-weight: 700;
  text-align: center;
}

.notification-animate {
  animation: pop 1.2s ease;
}

.pulse {
  animation: pulse 1.2s ease;
}

tr.solved td {
  background: #f0fdf4;
}

.hint-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}

.guess-form {
  display: flex;
  gap: 12px;
}

.guess-form input {
  flex: 1;
}

.history ul,
.history {
  margin-top: 16px;
}

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

.history li {
  padding: 6px 0;
  border-bottom: 1px solid #e2e8f0;
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .guess-form {
    flex-direction: column;
  }
}

@keyframes pop {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 rgba(37, 99, 235, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 rgba(37, 99, 235, 0);
  }
}
