/* Ann Landers Sucks — Studio
   Vintage 1950s newspaper look: cream paper, sepia ink, teal accents. */

:root {
  --paper: #f4e9cf;
  --paper-deep: #e9d9b4;
  --ink: #2f2418;
  --ink-soft: #5c4b36;
  --teal: #0f7b7c;
  --teal-deep: #095c5d;
  --stamp: #a63a24;
  --line: #2f2418;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  /* subtle paper grain */
  background-image: repeating-linear-gradient(
    0deg,
    rgba(47, 36, 24, 0.025) 0 2px,
    transparent 2px 4px
  );
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.5;
}

/* ---------- Masthead ---------- */
.masthead {
  text-align: center;
  padding: 1.2rem 1rem 1rem;
  border-bottom: 4px double var(--line);
  background: var(--paper);
}

.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: inline-block;
  padding: 0.25rem 1rem;
  margin-bottom: 0.8rem;
}

.logo {
  display: block;
  margin: 0 auto;
  max-width: min(440px, 92vw);
  height: auto;
  border: 2px solid var(--line);
}

.title {
  font-family: Impact, "Arial Narrow", "Helvetica Neue", sans-serif;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  letter-spacing: 0.04em;
  margin: 0.6rem 0 0;
  line-height: 1;
}

.subtitle {
  font-style: italic;
  color: var(--ink-soft);
  margin: 0.2rem 0 1rem;
  font-size: 1.2rem;
}

.toolbar {
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.toolbar-left {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ---------- Top-left dropdown menu ---------- */
.menu-wrap { position: relative; }

#menu-btn {
  font-size: 1.2rem;
  padding: 0.3rem 0.65rem;
  line-height: 1.2;
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 230px;
  padding: 0.6rem;
  background: var(--paper-deep);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 rgba(47, 36, 24, 0.15);
  z-index: 70;
}

.menu-dropdown[hidden] { display: none; }

.menu-dropdown button { text-align: left; }

/* ---------- Intro video modal ---------- */
#btn-intro { margin-top: 0.4rem; }

.intro-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 8, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.intro-modal[hidden] { display: none; }

.intro-modal-box {
  position: relative;
  width: min(920px, 96vw);
  background: var(--paper);
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
  padding: 0.6rem;
}

.intro-modal-box video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

#intro-close {
  position: absolute;
  top: -1.1rem;
  right: -1.1rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  z-index: 2;
}

/* ---------- Panels ---------- */
.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem;
  padding: 1.2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Verdict spans the full page width */
#panel-verdict {
  grid-column: 1 / -1;
}

/* Research spans the full page width, below Show Notes */
#panel-research {
  grid-column: 1 / -1;
}

.panel {
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 rgba(47, 36, 24, 0.18);
  padding: 1rem 1.2rem 1.2rem;
}

.panel h2 {
  font-family: Impact, "Arial Narrow", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1.6rem;
  margin: 0 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 3px double var(--line);
}

.panel h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 1rem 0 0.5rem;
}

.hint { font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }

/* ---------- Controls ---------- */
.row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.6rem 0;
}

button, select, input[type="search"], input[type="text"] {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
}

button, select {
  background: var(--paper-deep);
  border: 2px solid var(--line);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  border-radius: 2px;
}

button:hover { background: #dfc996; }

.clear-btn {
  background: transparent;
  font-size: 0.9rem;
  padding: 0.45rem 0.7rem;
  opacity: 0.75;
}

.clear-btn:hover { background: #dfc996; opacity: 1; }

/* ---------- Research form: full-width input, buttons side by side below ---------- */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.6rem 0;
}

.search-form input[type="search"] { width: 100%; }

.search-btns { display: flex; gap: 0.6rem; }

.search-btns button { flex: 1; }

.big-btn {
  background: var(--teal);
  color: #fff;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-color: var(--teal-deep);
}

.big-btn:hover { background: var(--teal-deep); }

.full-btn { width: 100%; }
.timer-sub button { flex: 1; }

button:disabled { opacity: 0.5; cursor: not-allowed; }

input[type="search"], input[type="text"] {
  background: #faf3e0;
  border: 2px solid var(--line);
  padding: 0.45rem 0.7rem;
  border-radius: 2px;
  flex: 1;
  min-width: 0;
}

.status { min-height: 1.4em; font-style: italic; color: var(--ink-soft); }
.notice {
  border: 2px dashed var(--stamp);
  color: var(--stamp);
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
}

/* ---------- Research results ---------- */
.research-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.4rem;
  margin-top: 0.6rem;
  align-items: start;
}

.research-cols[hidden] { display: none; }

.research-col h3 {
  color: var(--teal-deep);
  margin: 0 0 0.5rem;
  border-bottom: 2px solid var(--teal);
  padding-bottom: 0.3rem;
}

.results { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 0.6rem; }

.result { border-top: 1px solid var(--ink-soft); padding-top: 0.5rem; }

.result a {
  color: var(--teal-deep);
  font-weight: bold;
  text-decoration: none;
  font-size: 1.05rem;
}

.result a:hover { text-decoration: underline; }

.result p { margin: 0.25rem 0 0; font-size: 0.95rem; }

.ai-summary {
  background: #faf3e0;
  border: 2px solid var(--teal);
  padding: 0.7rem 0.9rem;
  margin: 0 0 0.6rem;
  font-size: 0.98rem;
}

.ai-points {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.95rem;
}

.more-btn {
  margin-top: 0.7rem;
  background: transparent;
  border: 2px solid var(--teal-deep);
  color: var(--teal-deep);
  font-weight: bold;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.more-btn:hover { background: var(--teal-deep); color: #fff; }

@media (max-width: 900px) {
  .research-cols { grid-template-columns: 1fr; }
}

/* ---------- Research image results ---------- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.image-grid a {
  display: block;
  border: 2px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper-deep);
}

.image-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.image-grid a:hover { border-color: var(--teal-deep); }

/* ---------- Soundboard (top-right) ---------- */
.sound-row {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.sound-row .sound-btn {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex: none;
}

.sound-btn:active { transform: scale(0.92); }

.sound-btn.featured {
  border-color: var(--teal-deep);
  background: #faf3e0;
}

/* ---------- Sound legend ---------- */
.sound-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.45rem 1rem;
  margin: 0 0 0.8rem;
  padding: 0.7rem 0.9rem;
  background: var(--paper-deep);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 rgba(47, 36, 24, 0.15);
}

.sound-legend[hidden] { display: none; }

.legend-item {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.85rem;
}

.legend-item .emoji { font-size: 1.4rem; line-height: 1; }

.legend-item small {
  display: block;
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- Wheel ---------- */
.wheel-wrap { position: relative; text-align: center; }

#wheel {
  max-width: 100%;
  height: auto;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: var(--paper-deep);
}

.winner {
  margin: 0.8rem auto 0;
  display: inline-block;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  color: var(--stamp);
  border: 3px double var(--stamp);
  padding: 0.3rem 1.2rem;
  transform: rotate(-2deg);
}

.winner[hidden] { display: none; }

.names-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

/* ---------- Timer ---------- */
.timer-display {
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(4rem, 12vw, 6.5rem);
  text-align: center;
  letter-spacing: 0.05em;
  border: 3px double var(--line);
  background: #faf3e0;
  padding: 0.4rem 0;
  margin-bottom: 0.8rem;
}

.timer-display.done {
  color: var(--stamp);
  animation: pulse 0.6s ease-in-out 6;
}

@keyframes pulse {
  50% { transform: scale(1.04); }
}

.presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.preset.active {
  background: var(--ink);
  color: var(--paper);
}


#rec-btn {
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.download-link {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid var(--teal-deep);
  text-decoration: none;
}

.download-link:hover {
  background: var(--teal-deep);
}

/* ---------- Colophon ---------- */
.colophon {
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
  border-top: 4px double var(--line);
  padding: 1rem;
  margin-top: 1rem;
}

/* ---------- Projection mode: giant text for the big screen ---------- */
body.projection { font-size: 22px; }

body.projection .panels {
  grid-template-columns: 1fr 1fr;
  max-width: 1800px;
}

/* Projection: research on top, wheel + timer side by side,
   recorder underneath — all full width where stated. */
body.projection #panel-research {
  grid-column: 1 / -1;
}

body.projection .panel h2 { font-size: 2.6rem; }

body.projection .timer-display { font-size: clamp(4rem, 12vw, 8rem); }

body.projection button,
body.projection select,
body.projection input { font-size: 1.6rem; padding: 0.8rem 1.4rem; }

body.projection .winner { font-size: 3.2rem; }

body.projection .result a { font-size: 1.7rem; }
body.projection .result p,
body.projection .ai-summary { font-size: 1.4rem; }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .row { align-items: stretch; }
  .row button, .row select { flex: 1; }
}

/* ---------- Verdict ---------- */
.verdict-board { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 0.8rem; }
.verdict-col { border: 3px double var(--line); background: var(--paper-deep); padding: 0.5rem 0.4rem; }
.verdict-col h3 { margin: 0 0 0.5rem; font-size: 1rem; text-align: center; line-height: 1.3; }
.verdict-man h3 { color: var(--teal-deep); }
.verdict-sucks h3 { color: var(--stamp); }
.verdict-count {
  display: inline-block; min-width: 1.8em; text-align: center;
  border: 2px solid var(--line); border-radius: 50%;
  font-size: 1.1em; padding: 0.05em 0.2em; margin-left: 0.2em; background: var(--paper);
}
.verdict-spots { min-height: 96px; display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; align-content: flex-start; }
.verdict-bench { min-height: 76px; border: 2px dashed var(--ink-soft); padding: 0.4rem; margin-bottom: 0.8rem; justify-content: center; }
.voter {
  width: 68px; background: none; border: none; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  font-family: inherit; color: var(--ink);
}
.voter img, .voter .voter-mic {
  width: 58px; height: 58px; border-radius: 50%;
  border: 3px solid var(--ink-soft); object-fit: cover; background: var(--paper);
}
.voter .voter-mic { display: flex; align-items: center; justify-content: center; font-size: 1.7rem; }
.voter-name {
  font-size: 0.72rem; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-bottom: 1px dotted var(--ink-soft);
}
.voter[data-vote="man"] img, .voter[data-vote="man"] .voter-mic { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 123, 124, 0.25); }
.voter[data-vote="sucks"] img, .voter[data-vote="sucks"] .voter-mic { border-color: var(--stamp); box-shadow: 0 0 0 3px rgba(166, 58, 36, 0.25); }
.verdict-actions { margin-bottom: 0.6rem; }
#verdict-title { flex: 1; font-family: inherit; font-size: 1rem; padding: 0.5rem; border: 2px solid var(--line); background: var(--paper); color: var(--ink); }
.verdict-history { border-top: 3px double var(--line); margin-top: 0.6rem; padding-top: 0.6rem; }
.verdict-history h3 { text-align: center; margin: 0 0 0.5rem; }
#verdict-list { list-style: none; margin: 0 0 0.6rem; padding: 0; }
#verdict-list li {
  display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap;
  border-bottom: 1px dotted var(--ink-soft); padding: 0.35rem 0; font-size: 0.92rem;
}
#verdict-list .v-title { font-weight: bold; flex: 1; min-width: 40%; }
#verdict-list .v-score { white-space: nowrap; }
#verdict-list .v-winner { font-style: italic; }
#verdict-list .v-del { background: none; border: none; color: var(--stamp); cursor: pointer; font-size: 1rem; padding: 0 0.2rem; }
.verdict-grand {
  text-align: center; font-weight: bold; font-size: 1.05rem;
  border: 3px double var(--line); padding: 0.6rem; background: var(--paper-deep); margin: 0 0 0.6rem;
}

/* Verdict drag-and-drop */
.voter { touch-action: none; -webkit-user-select: none; user-select: none; }
.voter-ghost {
  position: fixed; z-index: 200; pointer-events: none; opacity: 0.92; margin: 0;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
}
.voter-dragging { opacity: 0.35; }
.verdict-col.drag-over, .verdict-bench.drag-over { outline: 3px dashed var(--teal); outline-offset: -3px; }

/* Verdict history expand/collapse */
#verdict-list li.v-entry { display: block; padding: 0.15rem 0; }
.v-headrow { display: flex; align-items: center; gap: 0.3rem; }
.v-head {
  flex: 1; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap;
  background: none; border: none; padding: 0.35rem 0; cursor: pointer;
  font-family: inherit; font-size: 0.92rem; color: var(--ink); text-align: left;
}
.v-caret { display: inline-block; transition: transform 0.15s; color: var(--ink-soft); font-size: 0.85em; }
.v-entry.open .v-caret { transform: rotate(90deg); }
.v-detail { padding: 0.1rem 0 0.4rem 1.2rem; font-size: 0.88rem; }
.v-detail p { margin: 0.25rem 0; }

/* Collapsible panels */
.panel h2.collapsible { cursor: pointer; }
.panel-caret { display: inline-block; margin-right: 0.5rem; font-size: 0.75em; transition: transform 0.15s; }
.panel:not(.collapsed) .panel-caret { transform: rotate(90deg); }
.panel.collapsed > :not(h2) { display: none; }

/* Recorder inside the top-left menu */
.menu-dropdown .download-link {
  display: block;
  text-align: left;
  padding: 0.3rem 0.65rem;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 2px 2px 0 rgba(47, 36, 24, 0.18);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.menu-dropdown .download-link[hidden] { display: none; }
.menu-status { margin: 0; font-size: 0.82rem; font-style: italic; color: var(--ink-soft); }
.menu-status:empty { display: none; }
#menu-btn { position: relative; }
#menu-btn.recording::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d33;
  box-shadow: 0 0 4px #d33;
}

/* ---------- Show Notes ---------- */
#panel-notes { grid-column: 1 / -1; }
.notes-toolbar { align-items: center; margin-bottom: 0.6rem; }
.notes-size { display: inline-flex; gap: 0.25rem; margin-left: auto; }
.notes-size button { font-weight: bold; }
#notes-input {
  width: 100%;
  min-height: 160px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.7rem;
  background: var(--paper);
  border: 2px solid var(--line);
  color: var(--ink);
  resize: vertical;
  box-sizing: border-box;
}
#notes-output { margin-top: 0.7rem; }
.notes-view {
  --notes-size: 20px;
  font-size: var(--notes-size);
  line-height: 1.55;
  background: #fffdf6;
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 rgba(47, 36, 24, 0.12);
  padding: 1rem 1.3rem;
  min-height: 120px;
  color: var(--ink);
}
.notes-view h2, .notes-view h3, .notes-view h4 {
  font-family: Impact, "Arial Narrow", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0.4em 0 0.3em;
  line-height: 1.2;
}
.notes-view h2 { font-size: 1.6em; border-bottom: 3px double var(--line); padding-bottom: 0.15em; }
.notes-view h3 { font-size: 1.35em; }
.notes-view h4 { font-size: 1.15em; }
.notes-view p { margin: 0.55em 0; }
.notes-view ul, .notes-view ol { margin: 0.55em 0; padding-left: 1.4em; }
.notes-view li { margin: 0.3em 0; }
.notes-view li::marker { color: var(--teal); font-weight: bold; }
.notes-empty { color: var(--ink-soft); font-style: italic; }
body.projection .notes-view { font-size: calc(var(--notes-size) * 1.6); }

/* ---------- Listener questions (mailbag) ---------- */
.panel-intro {
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 1rem;
}

.panel-intro a {
  color: var(--teal-deep);
  word-break: break-all;
}

.ask-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ask-label {
  font-weight: bold;
  margin-top: 0.5rem;
}

.ask-label .optional {
  font-weight: normal;
  font-style: italic;
  color: var(--ink-soft);
}

.ask-form textarea {
  width: 100%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  color: var(--ink);
  background: #fbf5e3;
  border: 2px solid var(--line);
  padding: 0.6rem;
  resize: vertical;
}

.char-count {
  text-align: right;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
}

.ask-success {
  text-align: center;
  padding: 1rem 0;
}

.ask-success .stamp {
  display: inline-block;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  color: var(--stamp);
  border: 3px double var(--stamp);
  border-radius: 4px;
  padding: 0.3rem 1rem;
  transform: rotate(-4deg);
  margin: 0 0 0.8rem;
}

.mailbag-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mailbag-item {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: #fbf5e3;
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 rgba(47, 36, 24, 0.12);
  padding: 0.7rem 0.9rem;
}

.mailbag-body { flex: 1; min-width: 0; }

.mailbag-text {
  margin: 0 0 0.3rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.mailbag-meta {
  margin: 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* Privacy policy link in the global footer (AdSense compliance). */
.colophon a {
  color: var(--teal-deep);
}

/* AdSense ad slot — discreet, centered, below the mailbag form. */
.ad-slot {
  margin: 1.5rem auto 0.5rem;
  max-width: 728px;
  text-align: center;
  min-height: 90px;
}
