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

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --card: #0f3460;
  --accent: #e94560;
  --accent2: #c8963e;
  --text: #eaeaea;
  --muted: #9a9ab0;
  --success: #4caf7d;
  --radius: 10px;
  --max-w: 480px;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

main {
  width: 100%;
  max-width: var(--max-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 600; color: var(--accent2); }
h3 { font-size: 1rem; font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.card--accent { border-left: 3px solid var(--accent2); }

/* Forms */
label { font-size: .85rem; color: var(--muted); }

input, textarea, select {
  width: 100%;
  background: var(--card);
  border: 1px solid #2a2a4a;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  padding: .65rem .75rem;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 80px; }

/* Score input — prominent */
.score-input {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  width: 90px;
  padding: .5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .7rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  width: 100%;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--secondary { background: var(--card); color: var(--text); }
.btn--success { background: var(--success); color: #fff; }
.btn--sm { padding: .4rem .8rem; font-size: .875rem; width: auto; }

/* Status badges */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge--pending { background: #2a2a4a; color: var(--muted); }
.badge--open    { background: #1e4d2b; color: var(--success); }
.badge--revealed{ background: #4a2a10; color: var(--accent2); }

/* Attendee list */
.attendee-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.attendee-chip {
  background: var(--card);
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .8rem;
}

/* Results table */
.results-table { width: 100%; border-collapse: collapse; font-size: .85rem; overflow-x: auto; display: block; }
.results-table th, .results-table td {
  padding: .5rem .6rem;
  border-bottom: 1px solid #2a2a4a;
  text-align: center;
  white-space: nowrap;
}
.results-table th { color: var(--muted); font-weight: 600; }
.results-table td:first-child, .results-table th:first-child { text-align: left; }
.results-table tr:last-child td { color: var(--accent2); font-weight: 700; }

/* Utility */
.muted { color: var(--muted); font-size: .875rem; }
.error { color: var(--accent); font-size: .875rem; }
.success { color: var(--success); font-size: .875rem; }
.text-center { text-align: center; }
.row { display: flex; gap: .75rem; align-items: center; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* Header */
header {
  width: 100%;
  max-width: var(--max-w);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 0 .5rem;
  margin-bottom: .5rem;
}
.logo { font-size: 1.3rem; font-weight: 800; color: var(--accent2); }

/* Wine entry in scoring view */
.wine-card { border-top: 1px solid #2a2a4a; padding-top: .75rem; }
.wine-label { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }

/* Reveal wine detail */
.wine-reveal-name { font-weight: 700; }
.wine-reveal-meta { color: var(--muted); font-size: .85rem; }
