/* ============================================================
   coohou — shared design tokens, fonts, reset, components
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Surfaces */
  --bg:              #f5f5f7;
  --bg-elevated:     #ffffff;
  --bg-card:         #ffffff;
  --bg-card-hover:   #fafafa;
  /* Ink */
  --text:            #111114;
  --text-muted:      #5c5c62;
  --text-subtle:     #9a9aa0;
  /* Borders */
  --border:          #e3e5ea;
  --border-strong:   #c8ccd2;
  --hairline:        #ecedf0;
  /* Silver — inner-page header gradient fallback (used behind canvas) */
  --silver-head-1:   #e9ecf0;
  --silver-head-2:   #c9ced5;
  --silver-head-3:   #dde1e7;
  --silver-head-4:   #b8bdc5;
  /* Silver — primary polished button (used sparingly) */
  --silver-btn-1:    #f6f8fa;
  --silver-btn-2:    #d9dde3;
  --silver-btn-3:    #c9ced5;
  --silver-btn-4:    #eaedf1;
  --silver-btn-edge: #b4b9c1;
  /* Header text contrast overlay */
  --silver-head-tint: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.05) 60%, rgba(0,0,0,0.05));
  /* Feedback */
  --correct:         #34c759;
  --correct-bg:      rgba(52,199,89,0.1);
  --incorrect:       #ff3b30;
  --incorrect-bg:    rgba(255,59,48,0.1);
  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  /* Shadows */
  --shadow-soft:     0 1px 2px rgba(20,22,28,0.04);
  --shadow-card:     0 1px 3px rgba(20,22,28,0.04);
  --shadow-lifted:   0 8px 28px rgba(20,22,28,0.1);
  /* Motion */
  --ease:            cubic-bezier(.4,0,.2,1);
  --ease-out:        cubic-bezier(0,0,.2,1);
  --t-fast:          120ms;
  --t-med:           180ms;
  --t-slow:          300ms;
  /* Fonts */
  --font-display:    'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --font-mono:       'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg:              #0b0c0f;
  --bg-elevated:     #0f1115;
  --bg-card:         #16181d;
  --bg-card-hover:   #1a1c22;
  --text:            #edeff3;
  --text-muted:      rgba(200,207,215,0.7);
  --text-subtle:     rgba(200,207,215,0.38);
  --border:          rgba(255,255,255,0.08);
  --border-strong:   rgba(255,255,255,0.16);
  --hairline:        rgba(255,255,255,0.05);
  --silver-head-1:   #3a3e47;
  --silver-head-2:   #1a1c22;
  --silver-head-3:   #2b2e36;
  --silver-head-4:   #15171b;
  --silver-btn-1:    rgba(220,228,238,0.28);
  --silver-btn-2:    rgba(120,128,140,0.15);
  --silver-btn-3:    rgba(80,86,96,0.2);
  --silver-btn-4:    rgba(200,208,220,0.22);
  --silver-btn-edge: rgba(220,230,240,0.25);
  --silver-head-tint: linear-gradient(180deg, rgba(0,0,0,0.2), transparent 50%, rgba(0,0,0,0.25));
  --correct-bg:      rgba(52,199,89,0.15);
  --incorrect-bg:    rgba(255,69,58,0.15);
  --shadow-soft:     0 1px 2px rgba(0,0,0,0.4);
  --shadow-card:     inset 0 1px 0 rgba(255,255,255,0.04);
  --shadow-lifted:   0 8px 28px rgba(0,0,0,0.5);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 16;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
}

button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; color: inherit; }

a { color: inherit; }

/* ============================================================
   Shared header (sticky, with silver-band canvas)
   ============================================================ */

.coohou-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background:
    linear-gradient(180deg,
      var(--silver-head-1) 0%,
      var(--silver-head-2) 45%,
      var(--silver-head-3) 75%,
      var(--silver-head-4) 100%);
  border-bottom: 1px solid var(--border-strong);
  color: var(--text);
}

.coohou-header .silver-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}

.coohou-header .silver-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--silver-head-tint);
}

.coohou-header-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.coohou-logo-group {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-shrink: 0;
}

.coohou-logo {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.025em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.coohou-logo a { text-decoration: none; color: inherit; }
.coohou-logo a:hover { opacity: 0.8; }

.coohou-crumb {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--text);
  opacity: 0.75;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.coohou-iconbtn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.3);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.5);
  transition: background var(--t-med) var(--ease), transform var(--t-fast) var(--ease);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.coohou-iconbtn:hover { background: rgba(255,255,255,0.5); }
[data-theme="dark"] .coohou-iconbtn {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.12);
}
[data-theme="dark"] .coohou-iconbtn:hover { background: rgba(255,255,255,0.2); }

.coohou-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Menu dropdown — restyled version of the existing pattern */
.coohou-menu-wrap { position: relative; z-index: 10; }

.coohou-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  z-index: 50;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lifted);
  padding: 6px 0;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.coohou-menu-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.coohou-menu-dropdown a,
.coohou-menu-dropdown button.menu-item {
  display: block; width: 100%;
  padding: 10px 18px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-align: left;
  background: none;
  transition: background var(--t-fast) var(--ease);
}
.coohou-menu-dropdown a:hover,
.coohou-menu-dropdown button.menu-item:hover {
  background: var(--hairline);
}

/* ============================================================
   Cards (quiz question cards, ccmenu rows, dayrate cells)
   ============================================================ */

.coohou-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-med) var(--ease),
              transform var(--t-med) var(--ease),
              background var(--t-slow) var(--ease);
}
.coohou-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

[data-theme="dark"] .coohou-card {
  background: linear-gradient(180deg, #16181d 0%, #101217 100%);
}

.coohou-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.coohou-cat {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.coohou-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
}

.coohou-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, var(--silver-btn-1) 0%, var(--silver-btn-4) 100%);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

/* ============================================================
   Controls
   ============================================================ */

.coohou-reveal {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--t-med) var(--ease), border-bottom-color var(--t-med) var(--ease);
}
.coohou-reveal::after { content: ' →'; opacity: 0.7; }
.coohou-reveal:hover { color: var(--text); border-bottom-color: var(--text); }

.coohou-score-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  transition: transform var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease);
}
.coohou-score-btn.yes {
  background: var(--correct-bg);
  color: var(--correct);
  border: 1px solid rgba(52,199,89,0.35);
}
.coohou-score-btn.no {
  background: var(--incorrect-bg);
  color: var(--incorrect);
  border: 1px solid rgba(255,59,48,0.35);
}
.coohou-score-btn:active { transform: scale(1.08); }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
