html, body { height: 100%; margin: 0; }
#card {
  box-sizing: border-box; height: 100%; display: flex; flex-direction: column;
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #1d2530; background: #fbfdfb; border: 1px solid #ccd2da; border-radius: 8px; overflow: hidden;
}
#card * { box-sizing: border-box; }
#card header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; background: #1c5e34; color: #fff; }
#card header .title { font-weight: 700; letter-spacing: .02em; }
#card header .sub { font-size: 11.5px; color: #cfe6d8; }
.strip { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; padding: 5px 10px; min-height: 28px;
  background: #eef3ee; border-bottom: 1px solid #dde4dd; font-size: 12px; color: #33433a; }
.strip b { color: #15110c; }
.strip .tier { margin-left: auto; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 1px 7px; border-radius: 999px; background: #dbe8de; color: #2f6b46; }
.strip .tier.medium { background: #fbeac2; color: #7a5b1e; }
.strip .tier.hard { background: #f6d3d3; color: #8a1c0e; }
.strip .tier.practice { background: #dde3ea; color: #4a5a70; }
.body { flex: 1 1 auto; overflow: auto; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.note { margin: 0; color: #6b7770; font-size: 12.5px; }
.ask { font-size: 13px; color: #55615a; margin: 0; }

/* the two clubs */
.clubs { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.club { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #ccd2da; border-radius: 8px; background: #fff; min-width: 0; }
.club img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.club .cn { font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.amp { font-weight: 800; color: #7a8a80; }

/* search-as-you-type */
.searchwrap { position: relative; }
.search { width: 100%; padding: 8px 10px; border: 1px solid #c7cfd6; border-radius: 6px; font: inherit; background: #fff; color: inherit; }
.search:focus { outline: 2px solid #1c7d3a; outline-offset: 1px; border-color: #1c7d3a; }
.sugg { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin: 2px 0 0; padding: 0; list-style: none;
  background: #fff; border: 1px solid #c7cfd6; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.15); max-height: 190px; overflow: auto; }
.sugg li { padding: 6px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.sugg li:hover, .sugg li.on { background: #eef6f0; }
.sugg li small { color: #7a8a80; }
.sugg li.empty { color: #7a8a80; cursor: default; }

.tools { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12.5px; }
.tools .dots { letter-spacing: 2px; color: #c0651a; }
.tools button { font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid #c7cfd6; background: #fff; cursor: pointer; color: inherit; }
.tools button:hover:not(:disabled) { border-color: #1c7d3a; color: #1c7d3a; }
.tools button:disabled { opacity: .5; cursor: default; }
.tools .giveup { margin-left: auto; border: 0; color: #8a948e; text-decoration: underline; background: transparent; }
.hints { margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: #55615a; }
.hints li { padding: 2px 0 2px 16px; position: relative; }
.hints li::before { content: "💡"; position: absolute; left: 0; font-size: 11px; }
.feedback { font-size: 13px; font-weight: 600; min-height: 18px; }
.feedback.ok { color: #1c7d3a; }
.feedback.bad { color: #b00020; }
.feedback .more { display: block; font-weight: 400; color: #55615a; font-size: 12px; margin-top: 2px; }
.feedback a { color: #1c7d3a; font-weight: 600; text-decoration: none; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #fff7e6; color: #7a5b1e; margin-left: 6px; }
.action { margin-top: auto; padding: 8px; border: 0; border-radius: 6px; background: #1c7d3a; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.action:disabled { background: #a9c7b4; cursor: default; }
.action.secondary { background: transparent; color: #1c7d3a; border: 1px solid #1c7d3a; font-size: 13px; padding: 6px; }
.row { display: flex; gap: 6px; }
.row .action { flex: 1; margin-top: 0; }

/* intro + summary */
.big { font-size: 30px; font-weight: 800; color: #1c5e34; line-height: 1.1; margin: 4px 0 0; }
.big small { font-size: 14px; font-weight: 600; color: #6b7770; margin-left: 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: #33433a; }
.facts b { color: #15110c; }
.streak { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #fff7e6; color: #7a5b1e; font-weight: 700; font-size: 12px; }
h4 { margin: 8px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #7a8a80; }
table.board, table.results { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.board td, table.results td { padding: 3px 4px; border-bottom: 1px solid #e6ece8; }
table.board td.n, table.results td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.board tr.you td { font-weight: 700; background: #fff7e6; }
table.results .ok { color: #1c7d3a; font-weight: 700; }
table.results .bad { color: #b00020; font-weight: 700; }
table.results .pr { color: #55615a; font-size: 12px; }
.copied { color: #1c7d3a; font-size: 12px; font-weight: 600; }
select#pastday { flex: 1; font: inherit; font-size: 12.5px; padding: 5px 6px; border: 1px solid #c7cfd6; border-radius: 6px; background: #fff; color: inherit; }
ol.archive { margin: 4px 0 0; padding-left: 20px; font-size: 12.5px; }
ol.archive li { padding: 5px 0; border-bottom: 1px solid #e6ece8; }
ol.archive .ap { font-weight: 700; }
ol.archive .al { color: #55615a; font-size: 12px; }
ol.archive .al a { color: #1c7d3a; text-decoration: none; }
ol.archive .ay { font-size: 11.5px; margin-top: 2px; }
ol.archive .ok { color: #1c7d3a; font-weight: 700; }
ol.archive .bad { color: #b00020; font-weight: 700; }

/* ---- dark theme (host page's toggle or system preference) ---- */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="dark"] #card { background: #14191d; color: #e4e7ea; border-color: #333b44; }
:root[data-theme="dark"] .club, :root[data-theme="dark"] .search, :root[data-theme="dark"] .sugg, :root[data-theme="dark"] .tools button, :root[data-theme="dark"] select#pastday { background: #1c2329; color: #e4e7ea; border-color: #333b44; }
:root[data-theme="dark"] .sugg li:hover, :root[data-theme="dark"] .sugg li.on { background: #243040; }
:root[data-theme="dark"] .strip { background: #1a2430; border-color: #2a3a4c; color: #b6c0c9; }
:root[data-theme="dark"] .strip b, :root[data-theme="dark"] .facts b { color: #e4e7ea; }
:root[data-theme="dark"] .note, :root[data-theme="dark"] .ask, :root[data-theme="dark"] .hints, :root[data-theme="dark"] .facts, :root[data-theme="dark"] .feedback .more, :root[data-theme="dark"] table.results .pr, :root[data-theme="dark"] ol.archive .al { color: #b6c0c9; }
:root[data-theme="dark"] .big { color: #7fd0a0; }
:root[data-theme="dark"] table.board td, :root[data-theme="dark"] table.results td, :root[data-theme="dark"] ol.archive li { border-color: #2a3a4c; }
:root[data-theme="dark"] table.board tr.you td, :root[data-theme="dark"] .streak, :root[data-theme="dark"] .badge { background: #3a2f12; color: #f2d48a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #card { background: #14191d; color: #e4e7ea; border-color: #333b44; }
  :root:not([data-theme="light"]) .club, :root:not([data-theme="light"]) .search, :root:not([data-theme="light"]) .sugg, :root:not([data-theme="light"]) .tools button, :root:not([data-theme="light"]) select#pastday { background: #1c2329; color: #e4e7ea; border-color: #333b44; }
  :root:not([data-theme="light"]) .sugg li:hover, :root:not([data-theme="light"]) .sugg li.on { background: #243040; }
  :root:not([data-theme="light"]) .strip { background: #1a2430; border-color: #2a3a4c; color: #b6c0c9; }
  :root:not([data-theme="light"]) .strip b, :root:not([data-theme="light"]) .facts b { color: #e4e7ea; }
  :root:not([data-theme="light"]) .note, :root:not([data-theme="light"]) .ask, :root:not([data-theme="light"]) .hints, :root:not([data-theme="light"]) .facts, :root:not([data-theme="light"]) .feedback .more, :root:not([data-theme="light"]) table.results .pr, :root:not([data-theme="light"]) ol.archive .al { color: #b6c0c9; }
  :root:not([data-theme="light"]) .big { color: #7fd0a0; }
  :root:not([data-theme="light"]) table.board td, :root:not([data-theme="light"]) table.results td, :root:not([data-theme="light"]) ol.archive li { border-color: #2a3a4c; }
  :root:not([data-theme="light"]) table.board tr.you td, :root:not([data-theme="light"]) .streak, :root:not([data-theme="light"]) .badge { background: #3a2f12; color: #f2d48a; }
}

/* ---- v2: era line, hint ladder, the five-name list, everyone panel ---- */
.era { margin: 0; font-size: 12px; color: #6b7770; }
.tools .worth { color: #33433a; }
.tools .worth small { color: #7a8a80; }
.ladder { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ladder button { font: inherit; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid #c7cfd6; background: #fff; cursor: pointer; color: inherit; }
.ladder button em { font-style: normal; font-size: 11px; color: #c0651a; font-weight: 700; }
.ladder button:hover:not(:disabled) { border-color: #1c7d3a; color: #1c7d3a; }
.ladder button:disabled { opacity: .45; cursor: default; }
.ladder .free { font-size: 11.5px; color: #7a5b1e; background: #fff7e6; padding: 3px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.ladder .free.used { color: #7a8a80; background: #eef1ee; }
ul.names { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
ul.names li { min-width: 0; }
ul.names .pickbtn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #c7cfd6; border-radius: 8px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: inherit; cursor: pointer; text-align: left; }
ul.names .pickbtn:hover:not(:disabled) { border-color: #1c7d3a; background: #eef6f0; }
ul.names .pickbtn:disabled { cursor: default; opacity: .7; }
ul.names .pickbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.names .struck { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border: 1px dashed #d5dbe2; border-radius: 8px; color: #8a948e; font-size: 12.5px; }
ul.names .struck .nm { display: flex; align-items: center; gap: 8px; font-weight: 600; }
ul.names .struck .why { font-size: 11px; color: #b00020; padding-left: 36px; }
.av { width: 28px; height: 28px; border-radius: 50%; flex: none; object-fit: cover; background: #dfe5e0; }
.av.emo { display: inline-flex; align-items: center; justify-content: center; font-size: 17px; line-height: 1; background: #eef1ee; }
.av.sil { background: radial-gradient(circle at 50% 38%, #b9c2bb 0 30%, transparent 32%), radial-gradient(circle at 50% 95%, #b9c2bb 0 45%, transparent 47%), #e6ebe6; }
details.everyone { font-size: 12.5px; }
.action#next { margin-top: 8px; }   /* follows the result instead of sitting at the bottom of the frame */
details.everyone summary { cursor: pointer; color: #1c7d3a; font-weight: 600; }
details.everyone .al { color: #55615a; margin-top: 3px; }
details.everyone .al a { color: #1c7d3a; text-decoration: none; }
:root[data-theme="dark"] .era, :root[data-theme="dark"] .tools .worth { color: #b6c0c9; }
:root[data-theme="dark"] .ladder button, :root[data-theme="dark"] ul.names .pickbtn { background: #1c2329; color: #e4e7ea; border-color: #333b44; }
:root[data-theme="dark"] ul.names .pickbtn:hover:not(:disabled) { background: #243040; }
:root[data-theme="dark"] ul.names .struck { border-color: #3a4450; color: #8f9aa4; }
:root[data-theme="dark"] .av, :root[data-theme="dark"] .av.sil { background-color: #2a333c; }
:root[data-theme="dark"] .ladder .free { background: #3a2f12; color: #f2d48a; }
:root[data-theme="dark"] .ladder .free.used { background: #242c33; color: #8f9aa4; }
:root[data-theme="dark"] details.everyone .al { color: #b6c0c9; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .era, :root:not([data-theme="light"]) .tools .worth { color: #b6c0c9; }
  :root:not([data-theme="light"]) .ladder button, :root:not([data-theme="light"]) ul.names .pickbtn { background: #1c2329; color: #e4e7ea; border-color: #333b44; }
  :root:not([data-theme="light"]) ul.names .pickbtn:hover:not(:disabled) { background: #243040; }
  :root:not([data-theme="light"]) ul.names .struck { border-color: #3a4450; color: #8f9aa4; }
  :root:not([data-theme="light"]) .av, :root:not([data-theme="light"]) .av.sil { background-color: #2a333c; }
  :root:not([data-theme="light"]) .ladder .free { background: #3a2f12; color: #f2d48a; }
  :root:not([data-theme="light"]) .ladder .free.used { background: #242c33; color: #8f9aa4; }
  :root:not([data-theme="light"]) details.everyone .al { color: #b6c0c9; }
}

/* answers are links: show it */
.feedback a, details.everyone .al a, ol.archive .al a, table.results .pr a { text-decoration: underline; text-decoration-color: rgba(28,125,58,.45); text-underline-offset: 2px; cursor: pointer; }
.feedback a:hover, details.everyone .al a:hover, ol.archive .al a:hover, table.results .pr a:hover { text-decoration-color: currentColor; }
a.wl::after { content: "W"; font: 700 9px/1 Georgia, serif; vertical-align: super; margin-left: 2px; opacity: .75; }   /* opens Wikipedia in a window on the page */

/* Arcade host: the frame follows the content (index.html reports the card's height) */
html.autosize, html.autosize body { height: auto; background: transparent !important; }
html.autosize #card { height: auto; max-height: 1100px; }

/* Past days: "✕ Close" beside the day picker (shown once a day is open) */
.closeday { font: inherit; font-size: 12.5px; padding: 5px 10px; border: 1px solid rgba(128,128,128,.45); border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.closeday[hidden] { display: none; }
