/* src/site/site.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  --bg: #f8f8f7;
  --panel: #fff;
  --border: #e2e2e0;
  --border-hi: #c8c8c6;
  --accent: #654ea3;
  --accent-g: #654ea31f;
  --text: #1a1a1c;
  --muted: #707078;
  --err: #dc2626;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e14;
    --panel: #161622;
    --border: #28283c;
    --border-hi: #3c3c58;
    --accent: #9b87f5;
    --accent-g: #9b87f51a;
    --text: #e6e6ee;
    --muted: #88889a;
    --err: #f87171;
  }
}

:root[data-theme="light"] {
  --bg: #f8f8f7;
  --panel: #fff;
  --border: #e2e2e0;
  --border-hi: #c8c8c6;
  --accent: #654ea3;
  --accent-g: #654ea31f;
  --text: #1a1a1c;
  --muted: #707078;
  --err: #dc2626;
}

:root[data-theme="dark"] {
  --bg: #0e0e14;
  --panel: #161622;
  --border: #28283c;
  --border-hi: #3c3c58;
  --accent: #9b87f5;
  --accent-g: #9b87f51a;
  --text: #e6e6ee;
  --muted: #88889a;
  --err: #f87171;
}

body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 20px;
  min-height: 100vh;
  padding: 24px 24px 32px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

.hdr {
  text-align: center;
  max-width: 560px;
}

.hdr-title {
  letter-spacing: -.01em;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.hdr-sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.panels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  width: 100%;
  max-width: 960px;
  min-height: 0;
}

@media (max-width: 640px) {
  .panels {
    grid-template-columns: 1fr;
    flex: none;
    max-width: 400px;
  }

  .divider {
    display: none;
  }

  .panel {
    aspect-ratio: auto;
    min-height: 200px;
    max-height: none;
  }
}

.divider {
  display: flex;
  color: var(--border);
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  width: 28px;
}

.divider svg {
  width: 24px;
  height: 24px;
}

.panel {
  position: relative;
  display: flex;
  border: 2px dashed var(--border);
  background: var(--panel);
  cursor: pointer;
  outline: none;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  justify-content: center;
  align-items:  center;
  min-height: 0;
  max-height: 100%;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.panel:hover {
  border-color: var(--border-hi);
}

.panel:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-g);
}

.panel.drag {
  border-color: var(--accent);
  background: var(--accent-g);
  box-shadow: inset 0 0 80px var(--accent-g);
  border-style: solid;
}

.panel.loaded {
  border-color: var(--border);
  border-style: solid;
}

.panel.error {
  border-color: #dc262659;
}

.panel-prompt {
  display: flex;
  text-align: center;
  flex-direction: column;
  align-items:  center;
  gap: 8px;
  transition: opacity .25s, transform .25s;
}

.panel.loaded .panel-prompt, .panel.error .panel-prompt {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
}

.prompt-icon {
  color: var(--border-hi);
  width: 34px;
  height: 34px;
  transition: color .2s;
}

.panel:hover .prompt-icon {
  color: var(--muted);
}

.panel:focus-visible .prompt-icon {
  color: var(--muted);
}

.panel.drag .prompt-icon {
  color: var(--accent);
}

.prompt-label {
  color: var(--muted);
  letter-spacing: .04em;
  font-size: 13px;
  font-weight: 600;
}

.prompt-hint {
  color: var(--muted);
  opacity: .7;
  font-size: 12px;
}

.panel-img {
  position: absolute;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  transition: opacity .35s;
  inset: 0;
}

.panel.loaded .panel-img {
  opacity: 1;
}

.panel-error {
  position: absolute;
  display: flex;
  color: var(--err);
  text-align: center;
  pointer-events: none;
  justify-content: center;
  align-items:  center;
  font-size: 13px;
  line-height: 1.5;
  inset: 20px;
}

.version-mismatch {
  text-align: center;
  color: var(--err);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
}

.score {
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 4px;
  min-height: 0;
}

.score-num {
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: clamp(56px, 12vw, 96px);
  font-weight: 700;
  line-height: 1;
}

.score-label {
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  font-size: 12px;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.score.pop .score-num {
  animation: pop-in .35s cubic-bezier(.16, 1, .3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .panel-prompt, .panel-img, .score-num {
    animation: none !important;
    transition: none !important;
  }
}

:focus-visible {
  outline: none;
}

.debug {
  position: fixed;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items:  flex-end;
  gap: 6px;
  font-size: 12px;
  bottom: 12px;
  right: 12px;
}

.debug-toggle {
  font: inherit;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
}

.debug-toggle:hover {
  border-color: var(--border-hi);
  color: var(--text);
}

.debug-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 140px;
  padding: 10px 14px;
}

.debug-row {
  display: flex;
  color: var(--text);
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
}

.debug-row select {
  font: inherit;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
}

.site-footer {
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding: 24px 16px;
  font-size: 13px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}
