/* Go Home Bingo: cobalt, coral-red, white. Local design preview. */

:root {
  --white: #fff;
  --tint: #f2f6ff;
  --surface: #fff;
  --ink: #101114;
  --ink-soft: #252833;
  --muted: #444b5b;
  --blue: #0835c5;
  --blue-deep: #07278f;
  --coral: #ff4e3e;
  --coral-deep: #a8241a;
  --line: #d6dfef;
  --line-strong: #8290ac;
  --shadow: 0 12px 32px rgba(10, 41, 121, 0.085);
  --radius: 14px;
  --radius-sm: 9px;
  --display: var(--ui);
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--ui);
  color: var(--ink);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue-deep); }
code { font-family: var(--mono); font-size: 0.92em; background: var(--tint); padding: 1px 5px; border-radius: 5px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--white); padding: 8px 12px; border-radius: 6px; z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

/* Header */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; max-width: 1100px; margin: 0 auto; padding: 18px 20px 13px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px;
  text-decoration: none; color: var(--ink); flex: 0 0 auto;
}
.wordmark__logo { display: block; width: clamp(116px, 17vw, 164px); height: auto; }
.wordmark__tagline { font-size: clamp(0.64rem, 1.3vw, 0.78rem); font-weight: 700; }
.site-nav { display: flex; gap: 16px; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--ink-soft); padding: 6px 4px; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a:focus-visible { border-bottom-color: var(--coral); color: var(--ink); }

main { max-width: 1100px; margin: 0 auto; padding: 8px 20px 48px; }

.lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 60ch; margin: 12px 0 18px; text-wrap: pretty; }

/* Machine and names share the first row; keep every control with its machine. */
.play-layout {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: start; gap: 22px; margin-bottom: 24px;
}
.stage { display: grid; gap: 14px; min-width: 0; }
.names-panel { min-width: 0; border-top: 4px solid var(--blue); }
.mobile-add { display: none; }
.drum-wrap {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border: 1px solid #acbbea; border-radius: 18px;
  background: linear-gradient(180deg, #edf3ff, #fff 78%); box-shadow: var(--shadow);
}
.draw-canvas {
  width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, #fff 25%, #edf3ff 100%);
}
.draw-canvas[hidden] { display: none; }
.drum-status { text-align: center; color: var(--ink); }
.status { margin: 3px 0 0; font-size: 1.06rem; min-height: 1.5em; font-weight: 750; }
.status[data-state="mixing"] { color: var(--blue-deep); }
.status[data-state="drawn"] { color: var(--coral-deep); }
.status-count { margin: 4px 0; font-size: 0.76rem; color: var(--muted); letter-spacing: 0.4px; text-transform: uppercase; }
@media (max-width: 740px) {
  .play-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .mobile-add {
    display: inline-block; margin: 0 0 14px; font-size: 0.92rem; font-weight: 700;
  }
  #list-input { scroll-margin-top: 18px; }
}

/* Controls */
.controls {
  display: grid; gap: 12px; min-width: 0; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint);
}
.controls__actions, .controls__settings {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 8px;
}
.controls__actions .btn { padding-inline: 13px; }
.controls__settings { padding-top: 2px; }
.btn {
  font-family: var(--ui); font-size: 1rem; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  padding: 12px 18px; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(8,53,197,0.13); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.btn--primary { background: var(--coral); border-color: #c1382b; color: var(--ink); font-weight: 800; }
.btn--primary:not(:disabled):hover { background: #ff7568; }
.btn--ghost, .btn--subtle { background: var(--white); color: var(--ink); border-color: var(--line-strong); }
.btn--subtle { font-weight: 500; }
.btn--sm { min-height: 40px; padding: 8px 12px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn kbd {
  font-family: var(--mono); font-size: 0.72rem; background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.25); border-radius: 5px; padding: 1px 5px; color: inherit;
}
#btn-mix:not(:disabled) { background: var(--blue); border-color: var(--blue); color: var(--white); }
#btn-mix:not(:disabled):hover { background: var(--blue-deep); }
.controls .btn:disabled, .saved__row .btn:disabled {
  opacity: 1; color: #515a6b; background: #e5eaf4; border-color: #c3cddd;
}
.draw-count { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 0.9rem; }
.draw-count label { font-weight: 600; }
.draw-count input {
  width: 56px; padding: 8px; font-size: 1rem; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink);
}

.draw-count select {
  min-height: 40px; max-width: 100%; padding: 6px 8px; font: inherit;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink);
}

/* Style picker: segmented pills (Bingo / Snow Globe) */
.style-picker { display: inline-flex; align-items: center; gap: 8px; }
.style-picker--top {
  display: flex; justify-content: center; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.style-picker__label { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.style-picker__pills {
  display: inline-flex; gap: 4px; padding: 3px;
  background: #e5eaf4; border: 1px solid var(--line); border-radius: 999px;
}
.style-pill {
  font-family: var(--ui); font-size: 0.9rem; font-weight: 600;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.style-pill:hover { color: var(--ink); }
.style-pill:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.style-pill.is-active {
  background: var(--white); color: var(--blue-deep);
  border-color: var(--line-strong);
  box-shadow: 0 1px 3px rgba(8, 53, 197, 0.18);
}
.style-pill:disabled { opacity: 0.45; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .style-pill { transition: none; } }
@media (max-width: 560px) {
  .style-picker { flex-wrap: wrap; }
}

/* Result tray */
.result-tray {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); min-height: 86px;
}
.result-tray__label { margin: 0 0 8px; font-size: 0.78rem; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); }
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.result-empty { color: var(--muted); font-style: italic; margin: 4px 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px 6px 8px; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.chip__dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); flex: none; }

/* Panel */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px;
}
.panel__title { margin: 0; font-family: var(--display); font-size: 1.32rem; font-weight: 800; letter-spacing: -0.02em; }
.panel__hint { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }
.panel__body { display: flex; flex-direction: column; gap: 16px; }

.field__label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.list-input {
  width: 100%; font-family: var(--ui); font-size: 1rem; line-height: 1.5;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 12px; background: #fff; color: var(--ink); resize: vertical; min-height: 150px;
}
.list-input:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.field__error { color: var(--coral-deep); font-size: 0.85rem; min-height: 1.1em; display: block; }
.list-meta { display: flex; justify-content: space-between; align-items: center; }
.list-count { font-weight: 600; color: var(--blue-deep); }

.linklike { background: none; border: none; color: var(--blue-deep); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.linklike:hover { color: var(--coral-deep); }
.linklike:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; border-radius: 4px; }

/* Saved lists */
.saved { border-top: 1px dashed var(--line-strong); padding-top: 14px; }
.saved__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.saved__row .field__label { grid-column: 1 / -1; margin: 0; }
.saved__row .saved__select { grid-column: 1 / -1; width: 100%; min-height: 40px; }
.saved__row .btn { justify-content: center; }
.saved__select { min-width: 0; max-width: 100%; flex: 1 1 160px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-size: 0.95rem; }
.saved__note { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); }

/* Options */
.options { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; }
.options__legend { font-weight: 700; padding: 0 6px; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.check em { color: var(--muted); font-style: italic; font-weight: 400; font-size: 0.85rem; }

/* History */
.history { border-top: 1px dashed var(--line-strong); padding-top: 14px; }
.history__head { display: flex; justify-content: space-between; align-items: center; }
.history__title { margin: 0; font-size: 1rem; }
.history__list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow: auto; }
.history__item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 6px; background: var(--white); font-size: 0.92rem; }
.history__item span { display: inline-flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.history__empty { color: var(--muted); font-style: italic; font-size: 0.9rem; margin: 8px 0 0; }

/* How / FAQ */
.how { border-top: 1px solid var(--line); padding-top: 28px; max-width: 760px; }
.how__title { font-family: var(--display); font-size: 1.5rem; margin: 26px 0 12px; }
.how__steps { padding-left: 20px; }
.how__steps li { margin: 8px 0; }
.faq { margin: 0; }
.faq__item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq dt { font-weight: 700; font-family: var(--display); font-size: 1.05rem; }
.faq dd { margin: 6px 0 0; color: var(--ink-soft); }

/* Ad slots */
.ad-slot { margin: 28px auto; max-width: 760px; text-align: center; }
.ad-slot ins { min-height: 90px; }
@media (max-width: 720px) {
  .ad-slot { margin: 20px auto; }
  .ad-slot ins { min-height: 100px; }
}

/* Footer */
.site-foot { max-width: 1100px; margin: 0 auto; padding: 24px 20px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-foot__nav { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.site-foot a { color: var(--ink-soft); }

/* Focus + reduced motion */
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
@media (max-width: 560px) {
  .site-head { flex-wrap: wrap; gap: 10px; }
  .site-nav { flex-wrap: wrap; gap: 10px; font-size: 0.85rem; }
  .btn { flex: 1 1 auto; justify-content: center; }
}
