/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Neutral mid-gray palette — no chromatic influence on image perception */
  --bg:          #808080;
  --surface:     #727272;
  --surface2:    #6a6a6a;
  --surface-lt:  #8e8e8e;
  --border:      #999;
  --border-dark: #5e5e5e;
  --text:        #f0f0f0;
  --text-dim:    #c8c8c8;
  --text-dark:   #2a2a2a;
  --placeholder: #b0b0b0;
  --accent:      #4a90d9;

  --radius:   8px;
  --font:     'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── Layout ─────────────────────────────────────────────────── */
.page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 2rem;
  overflow: hidden;
}
.page.page-center {
  justify-content: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 520px;
  text-align: center;
}

h1 { font-size: 1.6rem; font-weight: 600; margin-bottom: .5rem; }
h2 { font-size: 1.25rem; font-weight: 500; margin-bottom: .4rem; }
p.dim { color: var(--text-dim); font-size: .92rem; }

/* ── Inputs ─────────────────────────────────────────────────── */
input[type="text"] {
  width: 100%;
  padding: .7rem 1rem;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
}
input[type="text"]::placeholder {
  color: var(--placeholder);
  opacity: 1;
}
input[type="text"]:focus { border-color: var(--text); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.8rem;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .1s;
  color: var(--text);
  background: var(--surface-lt);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn:hover:not(:disabled) { background: #9a9a9a; }

/* ── Outline ────────────────────────────────────────────────── */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) { background: var(--surface-lt); }

/* ── Level buttons (step 2 refinement) ──────────────────────── */
.btn-level {
  background: var(--surface-lt);
  border: 2px solid var(--border-dark);
  min-width: 160px;
  padding: .8rem 1rem;
  flex-direction: column;
}
.btn-level:hover:not(:disabled) { border-color: var(--text); }

.btn-sm { padding: .5rem 1.2rem; font-size: .88rem; }

/* ── Progress bar ───────────────────────────────────────────── */
.progress-wrap {
  width: 100%;
  max-width: 600px;
  margin-bottom: 1.2rem;
}
.progress-bar {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--text-dim);
  transition: width .3s ease;
}
.progress-text {
  font-size: .78rem;
  color: var(--text-dim);
  margin-top: .3rem;
}

/* ── Image display ──────────────────────────────────────────── */
.image-frame {
  position: relative;
  line-height: 0;
}
.image-frame img {
  display: block;
}

/* countdown overlay */
.countdown-overlay {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0,0,0,.50);
  color: #ddd;
  padding: .25rem .7rem;
  border-radius: 20px;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

/* ── Rating ─────────────────────────────────────────────────── */
.choice-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.level-label { font-size: .82rem; color: var(--text-dim); margin-top: .2rem; }

/* ── Utilities ──────────────────────────────────────────────── */
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-2  { margin-bottom: 1rem; }
.flex-col { display: flex; flex-direction: column; align-items: center; }
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .card { padding: 1.5rem; }
  .btn-level { min-width: 120px; }
}