:root {
  color-scheme: light;
  --bg: #f4efe8;
  --bg-strong: #efe5d9;
  --ink: #1f1a16;
  --muted: #665b52;
  --accent: #f06a2f;
  --accent-2: #2663ff;
  --card: #ffffff;
  --border: rgba(31, 26, 22, 0.12);
  --shadow: 0 20px 40px rgba(31, 26, 22, 0.12);
  --radius: 18px;
  --font-display: "Manrope", "Space Grotesk", system-ui, sans-serif;
  --font-body: "Work Sans", "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: radial-gradient(circle at top, #fdf9f3 0%, var(--bg) 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.35;
  z-index: 0;
}

.orb-1 {
  background: radial-gradient(circle, rgba(240, 106, 47, 0.55), transparent 70%);
  top: -160px;
  right: -120px;
}

.orb-2 {
  background: radial-gradient(circle, rgba(38, 99, 255, 0.45), transparent 70%);
  bottom: -200px;
  left: -140px;
}

.app {
  width: min(1120px, 92vw);
  margin: 40px auto 20px;
  display: grid;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

h1,
h2 {
  font-family: var(--font-display);
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 28px;
  display: grid;
  gap: 20px;
}

.hidden {
  display: none;
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  font-family: var(--font-body);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
}

.field.inline {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: 12px;
}

.field.inline input {
  width: 90px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #ff8c4c);
  color: white;
  box-shadow: 0 12px 20px rgba(240, 106, 47, 0.3);
}

.btn.ghost {
  background: #fff7f1;
  color: var(--ink);
  border: 1px solid rgba(240, 106, 47, 0.2);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.header-actions,
.room-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.room-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.status-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.status-card {
  padding: 16px;
  border-radius: 14px;
  background: var(--bg-strong);
  display: grid;
  gap: 6px;
}

.status-card .label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.status-card .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

.timer-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: #fff8f2;
  padding: 16px;
  border-radius: 14px;
  flex-wrap: wrap;
}

.timer-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.deck {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}

.card-btn {
  height: 90px;
  border-radius: 16px;
  border: 2px solid transparent;
  background: white;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(31, 26, 22, 0.08);
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.card-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(38, 99, 255, 0.4);
}

.card-btn.selected {
  border-color: var(--accent-2);
  box-shadow: 0 16px 24px rgba(38, 99, 255, 0.2);
  background: #eef3ff;
}

.reveal-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.reveal-card {
  padding: 18px;
  border-radius: 14px;
  background: var(--bg-strong);
  display: grid;
  gap: 6px;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.app-footer {
  margin: 10px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
  z-index: 1;
}

@media (max-width: 720px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel {
    padding: 20px;
  }

  .deck {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  }
}
