/* ===========================================================================
   Breakroom Picks — voter front-end
   Self-contained stylesheet (admin page uses its own).
   Mobile-first. Gold (#D6AE45) brand, gold (#D6AE45) "picked" accent.
   =========================================================================== */

:root {
  --teal: #D6AE45;
  --teal-dark: #7A5418;
  --green: #D6AE45;
  --green-soft: #FAF1D2;
  --green-border: #E4CD83;
  --ink: #1f2937;
  --ink-soft: #6b7280;
  --line: #e5e7eb;
  --bg: #050505;
  --card-bg: #ffffff;
  --serif: "Bodoni Moda", "Didot", "Bodoni MT", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ui: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-lift: 0 6px 20px rgba(16, 24, 40, 0.12);
  --tap: 44px;
  --maxw: 720px;
  --submit-h: 80px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ui);
  color: var(--ink);
  min-height: 100dvh;
  background-color: #000000;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Logo-matched field: a warm key light toward the top-center fading dark to the
   edges (as in the logo), over the logo's own grain texture — fixed behind all. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(120% 110% at 50% 30%, #0a0a0a 0%, #050505 55%, #000000 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("bg-texture.png");
  background-repeat: repeat;
  opacity: 0.14;
}

button { font-family: inherit; }

img { display: block; }

/* Brand serif applies site-wide via body. Per brand rule, keep the actual
   product cards (names + pick pills) and the typing fields in the readable
   sans — never change product fonts. */
.card__name,
.card__state,
.suggest__input,
input,
textarea {
  font-family: var(--sans);
}

/* ---------- No-site full-page message ---------------------------------- */
.no-site {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(160deg, #121212 0%, #000000 100%);
}
.no-site__card {
  background: #fff;
  border-radius: 18px;
  padding: 36px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lift);
}
.no-site__icon { font-size: 52px; line-height: 1; margin-bottom: 12px; }
.no-site__title { margin: 0 0 8px; font-size: 1.4rem; color: var(--ink); }
.no-site__msg { margin: 0; color: var(--ink-soft); font-size: 1rem; }

/* ---------- App shell -------------------------------------------------- */
.app { min-height: 100dvh; }

.main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 16px calc(var(--submit-h) + 28px + env(safe-area-inset-bottom));
}

/* ---------- Header ----------------------------------------------------- */
.header {
  background: transparent;
  color: #E8E8E8;
  padding: env(safe-area-inset-top) 0 0;
  box-shadow: var(--shadow);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, rgba(214,174,69,0) 0%, #7A5418 15%, #F7E7A4 50%, #7A5418 85%, rgba(214,174,69,0) 100%) 1;
}
.header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 16px 22px;
  text-align: center;
}
.header__logo {
  display: block;
  margin: 2px auto 12px;
  width: auto;
  height: auto;
  max-height: 188px;
  max-width: 86%;
}
.header__title {
  margin: 6px 0 0;
  font-family: var(--ui);
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
@keyframes gold-shimmer {
  0% { background-position: 200% 50%; }
  100% { background-position: -60% 50%; }
}
.header__site {
  margin: 4px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #9A9A9A;
}

/* ---------- Already-voted banner -------------------------------------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0 4px;
  font-size: 0.9rem;
}
.banner__text { flex: 1; }
.banner__close {
  flex: none;
  background: transparent;
  border: 0;
  color: #92400e;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  min-width: 28px;
  min-height: 28px;
}

/* ---------- Prompt ----------------------------------------------------- */
.prompt {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 18px 0 12px;
  color: #E8E8E8;
}

/* ---------- Catalog / sections ---------------------------------------- */
.catalog { display: block; }

.loading { color: #9A9A9A; padding: 20px 4px; }

.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.error-msg button {
  margin-top: 10px;
  background: #b91c1c;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  min-height: var(--tap);
}

.section { margin: 0 0 26px; }
.section__heading {
  font-family: var(--ui);
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
  color: #F1E6C9;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.section__heading::before {
  content: "";
  width: 5px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, #F7E7A4 0%, #D6AE45 50%, #7A5418 100%);
  display: inline-block;
  transform: translateY(2px);
}

/* ---------- Product grid ---------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 480px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
  }
}

/* ---------- Product card (whole card is the toggle) ------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: center;
  background: var(--card-bg);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.06s ease, background-color 0.15s ease;
  box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
  appearance: none;
}
.card:hover { box-shadow: var(--shadow-lift); }
.card:active { transform: scale(0.98); }
.card:focus-visible {
  outline: 3px solid rgba(214, 174, 69, 0.45);
  outline-offset: 2px;
}

.card__imgwrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}
.card__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.card__img.is-broken { opacity: 0; }

/* check badge on the image, hidden until picked */
.card__check {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, #F9ECB8 0%, #E8C766 22%, #D6AE45 48%, #B98F30 78%, #8A6320 100%);
  color: #2a1c04;
  font-size: 1rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 8px rgba(243,183,53,0.55);
  transform: scale(0);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.card__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 10px;
  /* keep names tidy: clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}

/* the little pill at the bottom of the card */
.card__state {
  margin-top: auto;
  align-self: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--teal);
  background: #FAF1D2;
  border: 1px solid #E4CD83;
  border-radius: 999px;
  padding: 7px 16px;
  min-width: 86px;
  transition: all 0.15s ease;
}

/* picked state */
.card.is-picked {
  border-color: var(--green);
  background: var(--green-soft);
}
.card.is-picked .card__check { transform: scale(1); }
.card.is-picked .card__state {
  color: #2a1c04;
  background: linear-gradient(180deg, #F9ECB8 0%, #E8C766 22%, #D6AE45 48%, #B98F30 78%, #8A6320 100%);
  border-color: var(--green);
}
.card.is-picked .card__state::before { content: "\2713  "; }

/* ---------- Suggestions ----------------------------------------------- */
.suggest {
  margin-top: 8px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
}
.suggest__heading { margin-bottom: 4px; color: var(--ink); }
.suggest__hint {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.suggest__rows { display: flex; flex-direction: column; gap: 12px; }

.suggest__row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name remove"
    "flavor remove";
  gap: 8px 8px;
  align-items: stretch;
}
.suggest__name { grid-area: name; }
.suggest__flavor { grid-area: flavor; }
.suggest__remove { grid-area: remove; align-self: stretch; }

@media (min-width: 540px) {
  .suggest__row {
    grid-template-columns: 1fr 1fr auto;
    grid-template-areas: "name flavor remove";
  }
}

.suggest__input {
  width: 100%;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  min-height: var(--tap);
  -webkit-appearance: none;
}
.suggest__input::placeholder { color: #9ca3af; }
.suggest__input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(214, 174, 69, 0.18);
}

.suggest__remove {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  min-width: var(--tap);
  min-height: var(--tap);
  transition: all 0.15s ease;
}
.suggest__remove:hover {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fef2f2;
}

.btn-add-row {
  margin-top: 14px;
  background: #FAF1D2;
  border: 1px dashed #D6AE45;
  color: #7A5418;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  cursor: pointer;
  width: 100%;
  min-height: var(--tap);
  transition: background-color 0.15s ease;
}
.btn-add-row:hover { background: #F3E6BB; }

.suggest__note {
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ---------- Existing requests (tap to upvote) ------------------------- */
.requests { margin-bottom: 18px; }
.requests__list { display: flex; flex-direction: column; gap: 10px; }

.request {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, background-color 0.15s ease,
    transform 0.06s ease;
  -webkit-tap-highlight-color: transparent;
}
.request:hover { box-shadow: var(--shadow-lift); }
.request:active { transform: scale(0.99); }
.request:focus-visible {
  outline: 3px solid rgba(214, 174, 69, 0.45);
  outline-offset: 2px;
}

.request__check {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}
.request__body { flex: 1; min-width: 0; }
.request__name { display: block; font-weight: 700; color: var(--ink); }
.request__flavor { display: block; font-size: 0.85rem; color: var(--ink-soft); }
.request__flavor:empty { display: none; }
.request__votes {
  flex: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--teal);
  background: #FAF1D2;
  border: 1px solid #E4CD83;
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

.request.is-voted {
  border-color: var(--green);
  background: var(--green-soft);
}
.request.is-voted .request__check {
  background: linear-gradient(180deg, #F9ECB8 0%, #E8C766 22%, #D6AE45 48%, #B98F30 78%, #8A6320 100%);
  border-color: var(--green);
  color: #2a1c04;
}
.request.is-voted .request__votes {
  color: #2a1c04;
  background: linear-gradient(180deg, #F9ECB8 0%, #E8C766 22%, #D6AE45 48%, #B98F30 78%, #8A6320 100%);
  border-color: var(--green);
}

.thanks__note {
  margin: -10px 0 20px;
  font-size: 0.88rem;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: left;
}

/* ---------- Sticky submit bar ----------------------------------------- */
.submit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 11, 13, 0.95);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-top: 1px solid #D6AE45;
  box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
.submit-bar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 16px;
}
.submit-bar__count {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9A9A9A;
  text-align: center;
}
.btn-submit {
  width: 100%;
  background: linear-gradient(180deg, #F9ECB8 0%, #E8C766 22%, #D6AE45 48%, #B98F30 78%, #8A6320 100%);
  color: #2a1c04;
  border: 1px solid #7A5418;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 15px 20px;
  cursor: pointer;
  min-height: 52px;
  box-shadow: inset 0 1px 0 rgba(255,248,220,0.6), inset 0 -1px 2px rgba(122,84,24,0.45), 0 2px 8px rgba(0,0,0,0.55);
  transition: background-color 0.15s ease, transform 0.06s ease,
    opacity 0.15s ease;
}
.btn-submit:hover { background: linear-gradient(180deg, #FCF1C8 0%, #EFD37A 24%, #E0B94E 52%, #C49A36 80%, #996F22 100%); }
.btn-submit:active { transform: scale(0.99); }
.btn-submit:disabled { opacity: 0.65; cursor: progress; }
.submit-bar__error {
  margin: 10px 0 0;
  color: #f87171;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

/* ---------- Thank-you panel ------------------------------------------- */
.thanks {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #121212 0%, #000000 100%);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}
.thanks__card {
  background: #fff;
  border-radius: 18px;
  padding: 40px 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lift);
  animation: pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.thanks__check {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--green);
  color: #050505;
  font-size: 2.4rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(214, 174, 69, 0.5);
}
.thanks__title { margin: 0 0 10px; font-family: var(--ui); font-size: 1.6rem; color: var(--ink); }
.thanks__msg { margin: 0 0 22px; color: var(--ink-soft); }

.btn-secondary {
  background: #fff;
  color: #7A5418;
  border: 1px solid #D6AE45;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 22px;
  cursor: pointer;
  min-height: var(--tap);
  transition: background-color 0.15s ease;
}
.btn-secondary:hover { background: #FAF1D2; }

/* ---------- Misc ------------------------------------------------------- */
[hidden] { display: none !important; }

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