/* ============ Food Picker — styles ============ */

:root {
  --bg: #12141c;
  --bg-alt: #1a1d28;
  --card: #1e2230;
  --card-border: #2c3145;
  --text: #eef0f6;
  --text-dim: #9aa1b8;
  --accent: #ffb703;
  --accent-2: #fb8500;
  --danger: #ef476f;
  --ok: #06d6a0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

/* Author rules beat the UA's [hidden] rule, so enforce it explicitly. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #232a45 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============ Header / footer ============ */

.site-header {
  text-align: center;
  padding: 28px 16px 8px;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: -0.02em;
}

.tagline {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
}

.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  padding: 24px 16px 40px;
}

/* ============ Layout ============ */

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 16px 24px;
}

@media (min-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    padding-top: 34px;
  }
}

/* ============ Wheel ============ */

.wheel-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.wheel-wrap {
  position: relative;
  width: min(86vw, 440px);
  aspect-ratio: 1 / 1;
}

.wheel-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

/* Pointer arrow sits at the top of the wheel, tip resting on the rim */
.pointer {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  z-index: 2;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid var(--danger);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
}

.pointer::after {
  content: "";
  position: absolute;
  top: -24px;
  left: -4.5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
}

.spin-btn {
  font: inherit;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  padding: 14px 54px;
  min-width: 220px;
  min-height: 56px;
  border: none;
  border-radius: 999px;
  color: #241a00;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 0 #a35a00, var(--shadow);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s ease;
}

.spin-btn:hover:not(:disabled) { filter: brightness(1.07); }

.spin-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #a35a00, var(--shadow);
}

.spin-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7) brightness(0.7);
  box-shadow: 0 6px 0 #555;
}

.spin-btn:focus-visible,
.btn:focus-visible,
.chip:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ============ Result ============ */

.result {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px dashed var(--card-border);
  width: min(100%, 440px);
}

.result-empty { color: var(--text-dim); font-size: 0.95rem; }

.result-won {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.result-won .r-emoji { font-size: 2.1rem; line-height: 1; }

.result-won .r-name {
  font-size: clamp(1.25rem, 5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.result-won .r-tags {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
}

.result-accepted {
  border-style: solid;
  border-color: var(--ok);
  background: rgba(6, 214, 160, 0.08);
}

@keyframes pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.eat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.match-count {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ============ Buttons ============ */

.btn {
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 20px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #241a00;
  border-color: var(--accent);
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--card-border);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }

.btn-danger { color: var(--danger); border-color: rgba(239, 71, 111, 0.5); }
.btn-danger:hover { background: rgba(239, 71, 111, 0.12); }

.btn-block { width: 100%; }

/* ============ Cards / sidebar ============ */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card-flat { box-shadow: none; background: var(--bg-alt); }

.card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.card summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  list-style-position: inside;
}

.hint {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.count-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 183, 3, 0.16);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 9px;
  vertical-align: middle;
  margin-left: 6px;
}

/* ============ Chips ============ */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font: inherit;
  font-size: 0.84rem;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--bg-alt);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover { border-color: var(--accent); color: var(--text); }

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #241a00;
  font-weight: 700;
}

.chip-removable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
  background: rgba(255, 183, 3, 0.14);
  border-color: rgba(255, 183, 3, 0.45);
  color: var(--text);
}

.chip-x {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
  opacity: 0.7;
}

.chip-x:hover { opacity: 1; color: var(--danger); }

.chips-picked { margin-top: 8px; }

/* ============ Add form ============ */

.add-form { display: flex; flex-direction: column; gap: 10px; }

.add-form input[type="text"] {
  font: inherit;
  width: 100%;
  padding: 11px 13px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg-alt);
  color: var(--text);
}

.add-form .row { display: flex; gap: 10px; }
.add-form .row input[type="text"]:first-child { flex: 1 1 auto; min-width: 0; }
.add-form .row .emoji-input { flex: 0 0 74px; }

.add-form input::placeholder { color: #6d748c; }

.emoji-input { max-width: 78px; text-align: center; }

.add-form .tag-picker {
  display: flex;
  flex-direction: column;
}

/* ============ Food lists ============ */

.food-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.food-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  font-size: 0.9rem;
}

.food-list li .f-emoji { font-size: 1.1rem; }

.food-list li .f-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-list li .f-tags {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45%;
}

.food-list .f-del {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 6px;
}

.food-list .f-del:hover { background: rgba(239, 71, 111, 0.16); }

.food-list-compact { max-height: 300px; margin-top: 12px; }

.food-list-compact li { padding: 6px 9px; font-size: 0.85rem; }

.empty-note {
  color: var(--text-dim);
  font-size: 0.86rem;
  padding: 6px 2px;
  list-style: none;
}

/* ============ Toast ============ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(0);
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 50;
  animation: toastIn 0.25s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============ Reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
