/* ─────────────────────────────────────────────────────────
   gahaku.css — Classic Art Selfie page
   ───────────────────────────────────────────────────────── */

#gahaku-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

/* ── Header ─────────────────────────────────────────────── */

#gahaku-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid rgba(195, 212, 228, 0.07);
  flex-shrink: 0;
}

.back-link {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

#gahaku-wordmark {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
}

#gahaku-status-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

#gahaku-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.5s;
  flex-shrink: 0;
}
#gahaku-status-dot.active   { background: var(--dot-active);   box-shadow: 0 0 6px var(--dot-active);  animation: dotPulse 2.2s ease-in-out infinite; }
#gahaku-status-dot.scanning { background: var(--dot-scanning); animation: dotPulse 1.4s ease-in-out infinite; }
#gahaku-status-dot.loading  { background: var(--dot-loading);  animation: dotPulse 0.9s ease-in-out infinite; }
#gahaku-status-dot.error    { background: var(--dot-error); }

/* ── Style picker ────────────────────────────────────────── */

#style-bar {
  padding: 20px 32px 16px;
  flex-shrink: 0;
}

.style-bar-label {
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}

#style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

/* ── Style card ──────────────────────────────────────────── */

.style-card {
  cursor: pointer;
  border: 1px solid rgba(195, 212, 228, 0.10);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.22s, transform 0.18s, box-shadow 0.22s;
  background: rgba(6, 9, 14, 0.50);
}

.style-card:hover {
  border-color: rgba(74, 127, 165, 0.45);
  transform: translateY(-3px);
}

.style-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(74, 127, 165, 0.28);
}

/* ── Swatch strip ────────────────────────────────────────── */

.style-swatch {
  height: 54px;
  width: 100%;
  filter: brightness(0.82) saturate(0.85);
  transition: filter 0.22s;
}

.style-card:hover .style-swatch,
.style-card.selected .style-swatch {
  filter: brightness(1) saturate(1);
}

/* Per-style gradient swatches */
.style-swatch[data-style="renaissance"] {
  background: linear-gradient(135deg, #1a1008 25%, #7a5020 60%, #c09040 100%);
}
.style-swatch[data-style="baroque"] {
  background: linear-gradient(135deg, #050200 30%, #3e1c08 60%, #b87020 90%, #e8c060 100%);
}
.style-swatch[data-style="impressionist"] {
  background: linear-gradient(135deg, #c8d8e8 0%, #e0c8b8 40%, #d0dcc8 70%, #b8c8e0 100%);
}
.style-swatch[data-style="popart"] {
  background: linear-gradient(135deg, #140c40 0%, #dc1e82 30%, #ffd200 60%, #00b8ff 85%, #ff00ff 100%);
}
.style-swatch[data-style="abstract"] {
  background: linear-gradient(135deg, #0a0800 15%, #5a2808 45%, #c06820 72%, #080808 100%);
}
.style-swatch[data-style="watercolour"] {
  background: linear-gradient(135deg, #f0e8d8 0%, #b8c8d8 40%, #c8d8c0 70%, #e8d8c8 100%);
}
.style-swatch[data-style="psychedelic"] {
  background: linear-gradient(135deg, #ff00cc 0%, #00ffcc 28%, #ffff00 55%, #cc00ff 78%, #00ccff 100%);
}
.style-swatch[data-style="street"] {
  background: linear-gradient(135deg, #0e0e0e 10%, #c02828 38%, #e08800 65%, #1840c0 100%);
}

/* ── Card label ──────────────────────────────────────────── */

.style-info {
  padding: 7px 9px 9px;
  background: rgba(6, 9, 14, 0.72);
}

.style-name {
  font-size: 8.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.3;
}

.style-sub {
  font-size: 7px;
  color: var(--text-dim);
  margin-top: 3px;
  line-height: 1.35;
}

.style-era {
  display: block;
  font-size: 6.5px;
  color: var(--text-dim);
  margin-top: 2px;
  opacity: 0.45;
}

/* ── Canvas area ─────────────────────────────────────────── */

#canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 32px 28px;
  gap: 16px;
  min-height: 0;
}

#canvas-wrap {
  position: relative;
  max-width: 680px;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

#gahaku-canvas {
  display: block;
  max-width: 100%;
  max-height: 54vh;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.60);
}

/* ── Hidden webcam ───────────────────────────────────────── */

#gahaku-webcam {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ── Controls ────────────────────────────────────────────── */

#gahaku-controls {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.ctrl-btn {
  padding: 8px 22px;
  border: 1px solid rgba(195, 212, 228, 0.2);
  border-radius: 2px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.ctrl-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.ctrl-btn:disabled {
  opacity: 0.30;
  cursor: default;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 600px) {
  #gahaku-header  { padding: 16px 20px; }
  #style-bar      { padding: 16px 20px 12px; }
  #canvas-area    { padding: 0 20px 20px; }
  #style-grid     { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
}
