:root {
  --bg: #2a1824;
  --bg-2: #3a1f30;
  --ink: #f6ecdc;
  --ink-dim: #c9b8a0;
  --accent: #d4a55c;
  --accent-2: #e06b6b;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(246, 236, 220, 0.18);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, #5a2a3f 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #7a4a2b 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, #1a0e16 100%);
  color: var(--ink);
  font-family: "Georgia", "Iowan Old Style", "Palatino", serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.wrap-wide {
  max-width: 1100px;
}

h1, h2, h3 {
  font-family: "Georgia", serif;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}

h1 {
  font-size: 2.2rem;
  color: var(--accent);
}
h2 {
  font-size: 1.25rem;
  color: var(--ink);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--ink-dim);
  margin-bottom: 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.card + .card { margin-top: 18px; }

label { display: block; font-size: 0.9rem; color: var(--ink-dim); margin: 12px 0 6px; }

input[type=text], input[type=password], textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea { min-height: 100px; resize: vertical; }

button, .btn {
  display: inline-block;
  background: var(--accent);
  color: #2a1824;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.2s ease;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button:active, .btn:active { transform: translateY(1px); }
button[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

.muted { color: var(--ink-dim); font-size: 0.9rem; }
.error { color: var(--accent-2); margin-top: 8px; font-size: 0.9rem; }

.photo {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(212, 165, 92, 0.2);
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table th, .table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.table th { color: var(--ink-dim); font-weight: 600; }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.55); color: #fff;
  border: 0; border-radius: 999px;
  width: 22px; height: 22px; font-size: 0.8rem; cursor: pointer;
}
.thumb.used { opacity: 0.5; }
.thumb .used-tag {
  position: absolute; left: 6px; bottom: 6px;
  background: rgba(0,0,0,0.65); color: #fff;
  font-size: 0.7rem; padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.thumb img { cursor: pointer; }

.flourish {
  text-align: center;
  color: var(--accent);
  letter-spacing: 0.4em;
  margin: 20px 0 6px;
}

/* --- Timer --- */
.timer-ring { text-align: right; min-width: 120px; }
.timer-num {
  font-size: 1.5rem; font-weight: 700; color: var(--accent); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.timer-bar {
  margin-top: 6px; height: 6px; width: 120px; border-radius: 999px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
.timer-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s linear;
}

/* --- Caption tiles (vote / reveal) --- */
.cap-grid {
  display: grid; gap: 10px; margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.cap-tile {
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 14px;
  font-family: inherit; font-size: 1rem;
  cursor: pointer;
  transition: transform 0.05s ease, border-color 0.2s ease, background 0.2s ease;
}
.cap-tile:hover:not(.disabled):not(.static) {
  border-color: var(--accent);
  background: rgba(212,165,92,0.08);
}
.cap-tile.voted { border-color: var(--accent); background: rgba(212,165,92,0.15); }
.cap-tile.popular { border-color: var(--accent); }
.cap-tile.bday { box-shadow: inset 0 0 0 2px var(--accent-2); }
.cap-tile.disabled { opacity: 0.7; cursor: not-allowed; }
.cap-tile.static { cursor: default; }
.cap-text { font-size: 1.05rem; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.cap-meta { font-size: 0.8rem; color: var(--ink-dim); letter-spacing: 0.03em; text-transform: uppercase; }
