/* FlirtDice: light, calm, one warm accent. Mobile first. */
:root {
  --bg: #fffaf7;
  --surface: #ffffff;
  --soft: #fdeef0;
  --line: #f0e3e3;
  --text: #2a1d22;
  --muted: #8a7a80;
  --accent: #e8475f;
  --accent-dark: #c8324a;
  --dark: #2a1d22;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(60, 20, 30, 0.05), 0 6px 20px rgba(60, 20, 30, 0.06);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
body.age-locked { overflow: hidden; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0.4em 0 0.3em; }
h2 { font-size: 1.4rem; margin: 0; }
h3 { font-size: 1.08rem; margin: 0.2em 0; }
main { max-width: 1040px; margin: 0 auto; padding: 0 16px 48px; }
section { margin: 36px 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; justify-content: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.empty { color: var(--muted); padding: 32px 0; text-align: center; }
.notice { background: #fff6dc; border: 1px solid #f4e2a6; padding: 10px 14px; border-radius: 12px; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(255, 250, 247, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.logo:hover { text-decoration: none; }
.logo.big { font-size: 1.8rem; justify-content: center; }
.logo-die { color: var(--accent); font-size: 1.35em; line-height: 1; transform: rotate(-12deg); display: inline-block; }
.topbar nav { display: flex; align-items: center; gap: 14px; }
.topbar nav > a:not(.btn) { color: var(--text); font-weight: 500; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; font-weight: 500; padding: 4px 2px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ' ▾'; color: var(--muted); }
.menu-body { position: absolute; right: 0; top: 130%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 170px; padding: 6px; }
.menu-body a { color: var(--text); padding: 8px 12px; border-radius: 8px; }
.menu-body a:hover { background: var(--soft); text-decoration: none; }
@media (max-width: 520px) { .topbar nav > a:first-child { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 999px; transition: transform 0.08s, background 0.15s; text-decoration: none; }
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-lg { padding: 14px 28px; font-size: 1.08rem; min-width: 140px; }
.btn-sm { padding: 6px 14px; font-size: 0.9rem; }
.btn-ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--soft); }
.btn-dark { background: var(--dark); }
.btn-dark:hover { background: #000; }
.subtle { color: var(--muted); }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 1.1rem; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--soft); }
.icon-btn.on { color: var(--accent); }

/* Home */
.hero { text-align: center; padding: 36px 0 8px; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 3.6rem); }
.hero em { color: var(--accent); font-style: italic; }
.lead { font-size: 1.1rem; color: #5a4a50; max-width: 620px; margin: 0 auto 8px; }
.game .lead { margin: 0 0 8px; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.type-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column;
  gap: 4px; color: var(--text); transition: transform 0.12s, box-shadow 0.12s; }
.type-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.type-tile .muted { font-size: 0.85rem; }
.tt-icon { font-size: 1.8rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 14px; }
.ideas-grid > div { background: var(--soft); border-radius: var(--radius); padding: 16px 18px; }
.ideas-grid p { margin: 0.3em 0 0; color: #5a4a50; }

/* Game cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.game-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text);
  display: flex; flex-direction: column; gap: 4px; transition: transform 0.12s, box-shadow 0.12s; }
.game-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.gc-top { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); }
.gc-icon { font-size: 1.1rem; }
.gc-desc { margin: 0; font-size: 0.9rem; color: #6a5a60; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gc-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 0.82rem; color: var(--muted); margin-top: auto; padding-top: 6px; align-items: center; }
.badge { background: var(--soft); color: var(--accent-dark); border-radius: 6px; padding: 0 6px; font-weight: 600; font-size: 0.75rem; }
.heat { white-space: nowrap; font-size: 0.8rem; }
.heat-name { color: var(--text); font-weight: 500; }
.tag { color: var(--muted); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filters input[type=search] { flex: 1 1 100%; }
.filters select { flex: 1 1 130px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(232, 71, 95, 0.35); outline-offset: 0; border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
label.check { flex-direction: row; align-items: center; font-weight: 400; }
label.check input { width: auto; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
legend { font-weight: 500; margin-bottom: 6px; width: 100%; }
.chip { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 0.9rem; }
.chip input { width: auto; margin: 0; accent-color: var(--accent); }
.chip:has(input:checked) { background: var(--soft); border-color: var(--accent); }
.form-error { color: var(--accent-dark); margin: 0; }
.pager { margin-top: 24px; }

/* Game page */
.game-head { text-align: center; max-width: 680px; margin: 0 auto; }
.game-head .gc-meta { justify-content: center; font-size: 0.9rem; }
.crumbs { margin-top: 20px; font-size: 0.9rem; }
.play { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px 16px; margin: 24px auto; max-width: 680px; box-shadow: var(--shadow); }
.game-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; max-width: 680px; margin: 0 auto; }
.vote { display: inline-flex; align-items: center; background: var(--surface); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); padding: 0 4px; }
.vote-score { min-width: 2ch; text-align: center; font-weight: 600; }
.contents { max-width: 680px; margin: 24px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; }
.contents summary { cursor: pointer; font-weight: 600; }
.contents h4 { margin: 12px 0 4px; }
.contents-list { margin: 8px 0; padding-left: 1.4em; color: #4a3a40; }

.result { min-height: 3.4em; text-align: center; margin: 18px auto; max-width: 520px; }
.result-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--accent); font-weight: 700; }
.result-line { font-family: var(--display); font-size: clamp(1.4rem, 5vw, 1.9rem); line-height: 1.25; }
.result.big .result-line { font-size: clamp(1.8rem, 7vw, 2.6rem); }
.pop { animation: pop 0.35s ease-out; }
@keyframes pop { from { transform: scale(0.92); opacity: 0.2; } to { transform: none; opacity: 1; } }

/* Dice: 3D cubes */
.dice { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin: 12px auto 4px; padding: 8px; background: none; border: 0;
  font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.die { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.die-name { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cube-wrap { --s: 104px; width: var(--s); height: var(--s); perspective: 700px; }
.cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(-18deg) rotateY(24deg); }
.cube-side { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px;
  background: #fff; border: 2px solid #f3d4d9; border-radius: 18px; box-shadow: inset 0 0 18px rgba(232, 71, 95, 0.12);
  font-family: var(--display); font-weight: 600; font-size: 0.98rem; line-height: 1.1; overflow-wrap: anywhere; backface-visibility: hidden; }
.cube-front { transform: translateZ(calc(var(--s) / 2)); }
.cube-back { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube-right { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube-left { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cube-top { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.cube-bottom { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
@media (max-width: 420px) { .dice:has(.die:nth-child(3)) .cube-wrap { --s: 86px; } .dice { gap: 16px; } }
.dice-some .cube-wrap { --s: 78px; }
.dice-some .cube-side { font-size: 0.8rem; border-radius: 14px; }
.dice-many { gap: 14px 10px; }
.dice-many .cube-wrap { --s: 62px; }
.dice-many .cube-side { font-size: 0.66rem; padding: 4px; border-radius: 12px; border-width: 1.5px; }
.dice-many .die-name, .dice-some .die-name { font-size: 0.66rem; max-width: 80px; text-align: center; }
.result-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; text-align: left; max-width: 420px; margin: 0 auto; }
.result-list dt { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 4px; }
.result-list dd { margin: 0; font-family: var(--display); font-size: 1.15rem; font-weight: 600; }
.hint { font-family: var(--font) !important; font-size: 1rem !important; color: var(--muted); }
.btn-main { min-width: min(100%, 260px); }
.whose-turn { text-align: center; font-weight: 700; color: var(--accent-dark); margin-top: 10px; font-size: 1.05rem; }

/* Wheel */
.wheel { cursor: pointer; position: relative; width: min(100%, 380px); margin: 0 auto; }
.wheel-svg { width: 100%; display: block; filter: drop-shadow(0 4px 10px rgba(60, 20, 30, 0.12)); }
.wheel-svg text { fill: #3a2a30; font-family: var(--font); font-weight: 600; }
.wheel-pointer { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); width: 0; height: 0; z-index: 2;
  border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 22px solid var(--accent); }

/* Cards */
.card-face { width: min(100%, 300px); aspect-ratio: 5 / 7; margin: 8px auto 10px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: 24px; text-align: center; cursor: pointer; }
.card-face.back { background: repeating-linear-gradient(45deg, var(--accent) 0 12px, #ef6377 12px 24px); color: #fff; font-weight: 600; }
.card-face.back span { background: rgba(0, 0, 0, 0.18); border-radius: 999px; padding: 6px 14px; align-self: center; }
.card-title { font-family: var(--display); font-size: 1.5rem; font-weight: 600; color: var(--accent-dark); }
.card-text { font-size: 1.05rem; }

/* Timer */
.clock { --p: 1; width: 150px; height: 150px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 2rem; font-weight: 600; background:
  radial-gradient(closest-side, var(--surface) 82%, transparent 83%), conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--soft) 0); }
.result-timer { margin-top: 18px; font-size: 1.4rem; color: var(--muted); }
.result-timer.clock { color: var(--text); }

/* Bottle */
.players { max-width: 420px; margin: 0 auto 8px; }
.bottle-circle { cursor: pointer; position: relative; width: min(100%, 340px); aspect-ratio: 1; margin: 8px auto; border-radius: 50%; background: var(--soft); }
.bottle { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transform-origin: 50% 50%; line-height: 0; }
.bottle-player { position: absolute; transform: translate(-50%, -50%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; font-size: 0.85rem; font-weight: 600; white-space: nowrap; max-width: 34%; overflow: hidden; text-overflow: ellipsis; }

/* Turn page */
.turn-page { text-align: center; padding-top: 24px; }
.turn-page .result { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 18px; box-shadow: var(--shadow); }

/* Editor */
.editor { max-width: 680px; }
.die-edit { background: var(--soft); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* Lists, admin, prose */
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { border-bottom: 1px solid var(--line); }
.plain-list a { display: block; padding: 12px 4px; color: var(--text); }
table { border-collapse: collapse; width: 100%; }
td, th { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
.prose h2 { margin-top: 1.4em; font-size: 1.2rem; }
.prose li { margin: 4px 0; }

/* Footer, overlays */
.footer { text-align: center; padding: 28px 16px 48px; border-top: 1px solid var(--line); font-size: 0.9rem; }
.footer a { color: var(--muted); }
.age-gate { position: fixed; inset: 0; z-index: 50; background: rgba(255, 250, 247, 0.96); backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.age-card { text-align: center; max-width: 400px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.age-card p { margin: 0; color: #5a4a50; }
.cookie-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; max-width: 560px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; font-size: 0.92rem; }
.cookie-banner p { margin: 0; }
.cookie-banner .row { margin: 10px 0 0; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--dark); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 0.92rem; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Filters as chips */
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chips-row.center { flex-wrap: wrap; justify-content: center; overflow: visible; }
.fchip { flex: none; background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 14px; font-size: 0.92rem; white-space: nowrap; }
.fchip:hover { text-decoration: none; border-color: var(--accent); }
.fchip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.fchip-kinky { background: var(--dark); color: #fff; border-color: var(--dark); }
.audiences { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.audience-tile { background: var(--soft); border-radius: var(--radius); padding: 16px 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.audience-tile:hover { text-decoration: none; background: #fbe0e5; }
.audience-tile .muted { font-size: 0.8rem; }
.badge-ai { background: #f1ebff; color: #6a4bc4; }
.filters select { flex: 1 1 110px; }

/* What a game needs */
.item-icon { flex: none; color: var(--accent-dark); }
.gc-needs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.needs { max-width: 680px; margin: 18px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.needs.none { text-align: center; color: var(--muted); background: none; border: 0; padding: 0; font-size: 0.9rem; }
.needs-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.needs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.needs li { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 0.95rem; }
.chip-icon { display: inline-flex; }

/* Safety notes */
.safety { max-width: 680px; margin: 18px auto 0; background: #fff6e8; border: 1px solid #f3d9a8; border-radius: var(--radius); padding: 12px 16px; text-align: left; }
.safety summary { cursor: pointer; font-weight: 600; color: #8a5300; }
.safety-icon { display: inline-block; margin-right: 2px; }
.safety-general { margin: 10px 0 4px; font-weight: 500; }
.safety-topic h4 { margin: 12px 0 4px; font-size: 0.95rem; }
.safety-topic ul { margin: 0; padding-left: 1.2em; }
.safety-topic li { margin: 3px 0; font-size: 0.93rem; }
.safety-more { margin: 10px 0 0; font-size: 0.9rem; }

/* Countdown for tasks that mention a duration */
.task-timer { display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 4px 0 8px; }
.task-timer .row { margin: 10px 0 0; }
.pose-inline { display: inline; }
.pose-inline .pose { display: block; }
.clock-sm { width: 110px; height: 110px; font-size: 1.6rem; }

/* Position pictograms */
.pos-a { stroke: var(--accent); } .pos-a circle { fill: var(--accent); stroke: none; }
.pos-b { stroke: var(--dark); } .pos-b circle { fill: var(--dark); stroke: none; }
.pos-f { stroke: #d9c9cc; stroke-width: 2; }
.pose { display: block; line-height: 0; margin: 0 auto 4px; width: max-content; }
.result-list dd { display: flex; align-items: center; gap: 8px; }
.result-list dd .pose { margin: 0; }
.card-pose { line-height: 0; }

/* Ideas pages */
.idea section { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 4px; }
.idea h2 { margin-top: 18px; }
.pose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 18px 0; }
.pose-grid figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; }
.pose-grid figcaption { font-weight: 600; font-size: 0.9rem; margin-top: 4px; }
