/* ─────────────────────────────────────────────
   Nookplay — Design System
   Brand: #C4622D (terracota)
   Background: #F7F2EB (crema)
───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Nookplay brand */
  --nook-brand: #C4622D;
  --nook-brand-light: #F0E0D4;

  /* Bar theme (overridden per bar) */
  --bar-primary: #C4622D;
  --bar-primary-text: #FFFFFF;
  --bar-bg: #F7F2EB;
  --bar-bg-card: #FFFFFF;
  --bar-bg-subtle: #F0EBE3;
  --bar-accent-dark: #1A1A1A;

  /* Neutrals */
  --text: #1A1A1A;
  --text-secondary: #6B6059;
  --text-muted: #A89B91;
  --border: #E5DDD5;
  --border-strong: #C4B8AE;
  --success: #3A7D44;
  --danger: #B03030;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bar-bg);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
}

/* ── Card ── */
.nook {
  max-width: 420px;
  width: 100%;
  min-height: 100vh;
  background: var(--bar-bg);
  padding: 0 0 40px;
  display: flex;
  flex-direction: column;
}

/* ── Top bar: Nookplay wordmark ── */
.nook-topbar {
  text-align: center;
  padding: 16px 20px 0;
  background: var(--bar-bg);
}

.nook-topbar img {
  height: 18px;
  width: auto;
  opacity: 1;
}

/* ── Bar hero ── */
.bar-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 24px;
  background: var(--bar-bg);
}

.bar-hero-logo {
  width: 100%;
  max-width: 320px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

/* ── Content area ── */
.nook-content {
  flex: 1;
  padding: 16px 16px 0;
}

.nook-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
}

/* ── Screens ── */
.screen { display: none; }
.screen.active { display: block; animation: fadeUp 0.3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Code entry ── */
.nook-title {
  font-size: 22px; font-weight: 700;
  color: var(--text); text-align: center;
  line-height: 1.25; margin-bottom: 8px;
}

.nook-sub {
  font-size: 15px; color: var(--text-secondary);
  text-align: center; line-height: 1.65;
  margin-bottom: 28px;
}

.code-input-wrap { margin-bottom: 12px; }

.code-input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 20px; font-weight: 600;
  letter-spacing: 4px; text-align: center;
  text-transform: uppercase;
  font-family: 'Inter', monospace;
  background: var(--bar-bg);
  color: var(--text); outline: none;
  transition: border-color 0.15s;
}
.code-input:focus { border-color: var(--bar-primary); }
.code-error { font-size: 13px; color: var(--danger); margin-top: 6px; text-align: center; min-height: 18px; }
.code-hint { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 10px; }

/* ── Buttons ── */
.btn-primary {
  width: 100%; padding: 14px;
  background: var(--bar-accent-dark);
  color: #fff;
  border: none; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
  font-family: inherit;
}
.btn-primary:hover:not(:disabled) { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  width: 100%; padding: 12px;
  background: var(--bar-bg-subtle); color: var(--text);
  border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}

.btn-danger {
  width: 100%; padding: 14px;
  background: var(--bar-primary);
  color: var(--bar-primary-text);
  border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 700;
  cursor: pointer; margin-top: 8px;
  transition: opacity 0.15s; font-family: inherit;
  letter-spacing: 0.3px;
}
.btn-danger:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-danger:not(:disabled):hover { opacity: 0.88; }

.btn-share {
  width: 100%; padding: 11px;
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; cursor: pointer;
  margin-top: 8px; font-family: inherit;
}
.btn-share:hover { background: var(--bar-bg-subtle); }

/* ── Game ── */
.tag {
  display: inline-block; font-size: 10px;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px;
  margin-bottom: 12px; font-weight: 600;
  background: var(--bar-primary);
  color: var(--bar-primary-text);
}

.headline { font-size: 21px; font-weight: 700; line-height: 1.25; margin-bottom: 6px; color: var(--text); }
.location { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.body-text { font-size: 15px; line-height: 1.75; color: var(--text); margin-bottom: 4px; }
.section-label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; }

.clue-btn {
  width: 100%; text-align: left;
  background: var(--bar-bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  margin-bottom: 8px; cursor: pointer;
  font-size: 14px; color: var(--text-muted);
  display: flex; align-items: flex-start; gap: 10px;
  transition: all 0.15s; font-family: inherit;
}
.clue-btn.revealed { color: var(--text); border-color: var(--border-strong); background: var(--bar-bg-card); cursor: default; }
.clue-btn:not(.revealed):hover { filter: brightness(0.97); }
.clue-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

.suspect-btn {
  width: 100%; text-align: left;
  background: var(--bar-bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px;
  margin-bottom: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  transition: border-color 0.15s; font-family: inherit;
}
.suspect-btn:hover { border-color: var(--border-strong); }
.suspect-btn.selected { border: 2px solid var(--bar-accent-dark); background: var(--bar-bg); }

.suspect-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bar-primary); color: var(--bar-primary-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

.suspect-name { font-size: 14px; font-weight: 600; color: var(--text); }
.suspect-role { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }

.result-big { font-size: 30px; font-weight: 700; margin-bottom: 6px; }
.result-big.correct { color: var(--success); }
.result-big.wrong { color: var(--danger); }
.result-sub { font-size: 15px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.6; }

.reveal-card {
  background: var(--bar-bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px; margin: 16px 0;
}
.reveal-label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.reveal-name { font-size: 19px; font-weight: 700; color: var(--bar-accent-dark); }

.tomorrow { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); line-height: 1.6; }

/* ── Footer ── */
.nook-footer {
  text-align: center;
  padding: 28px 20px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.nook-footer-brand img {
  height: 20px;
  width: auto;
  opacity: 1;
  display: block;
}

.nook-footer-by {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-decoration: none;
  font-weight: 500;
}

.nook-footer-by:hover { color: var(--text); }

/* ── Loading ── */
.loading { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 15px; }
.loading-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--bar-primary);
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-msg { text-align: center; padding: 40px 0; color: var(--danger); font-size: 15px; }

/* ── Activity menu ── */
.menu-welcome {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 16px;
}

.activity-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bar-bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.activity-card:hover {
  border-color: var(--bar-primary);
  transform: translateX(3px);
}

.activity-dim {
  opacity: 0.45;
  cursor: default;
  background: var(--bar-bg-subtle);
}

.activity-dim:hover {
  border-color: var(--border);
  transform: none;
}

.activity-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bar-bg);
  border-radius: var(--radius-sm);
}

.activity-info { flex: 1; }

.activity-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.activity-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--bar-primary);
  color: var(--bar-primary-text);
  flex-shrink: 0;
}

.activity-badge-dim {
  background: var(--bar-bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── Back button ── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  font-family: inherit;
}
.btn-back:hover { color: var(--text); }

.btn-menu {
  width: 100%; padding: 12px;
  background: var(--bar-bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  cursor: pointer; margin-top: 8px;
  font-family: inherit;
}
.btn-menu:hover { background: var(--bar-bg); }
