* { box-sizing: border-box; }
:root { color-scheme: dark; --ink: #211640; --paper: #fffaf2; --lime: #e5ff77; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: system-ui, sans-serif; }
.table { width: min(100%, 46rem); margin-inline: auto; padding: max(.65rem, env(safe-area-inset-top)) clamp(.875rem, 4vw, 2rem) 2rem; }
.masthead { min-height: 3.5rem; display: flex; align-items: center; justify-content: space-between; font-weight: 800; letter-spacing: .12em; font-size: .8rem; }
.masthead-actions { display: flex; align-items: center; gap: .55rem; }
#card-language-control { display: flex; align-items: center; gap: .4rem; letter-spacing: normal; }
#card-language { min-height: 42px; padding: .3rem; border-radius: 8px; font: inherit; }
@media (max-width: 375px) {
  #card-language-control span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
.sheet { color-scheme: light; background: var(--paper); color: var(--ink); border-radius: 16px; padding: clamp(1.15rem, 5vw, 2.5rem); }
#intro { overflow: hidden; padding: 0; }
.intro-title { background: #ded0ff; border-bottom: 1px solid var(--ink); padding: clamp(1.1rem, 5vw, 2rem); position: relative; isolation: isolate; min-height: 10rem; overflow: hidden; }
.intro-title h1 { width: fit-content; max-width: calc(100% - 5.5rem); font-size: clamp(2.8rem, 12vw, 5.5rem); }
.intro-title p { max-width: calc(100% - 5rem); margin-bottom: 0; font-weight: 650; }
#account-panel { padding: .75rem clamp(1.1rem, 5vw, 2rem); background: #fbf5ff; border-bottom: 1px solid var(--ink); }
#account-panel summary { cursor: pointer; font-weight: 750; padding: .5rem 0; }
#account-panel form:not([hidden]) { display: grid; gap: .4rem; max-width: 25rem; margin: .5rem 0; }
#account-panel input { min-width: 0; font: inherit; padding: .65rem; border: 1px solid var(--ink); border-radius: 8px; }
#account-address { overflow-wrap: anywhere; }
#account-status { margin: .35rem 0 0; }
#account-status:empty { display: none; }
#absurd-offer { margin: 1rem 0; padding: .85rem; border: 1px solid var(--ink); border-radius: 12px; background: #fbf5ff; }
#absurd-offer summary { cursor: pointer; font-weight: 750; }
#absurd-examples { padding-inline-start: 1.25rem; }
#absurd-examples li + li { margin-top: .4rem; }
#question-count { width: min(calc(100% - 2rem), 25rem); border: 0; }
#question-count::backdrop { background: rgb(33 22 64 / .72); }
.mode-cards, .setup-actions { display: grid; gap: .65rem; }
.mode-card { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .7rem .75rem; text-align: start; color: var(--ink); border: 1px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
#classic-mode { background: var(--lime); }
#introduction-mode { background: #ffcce1; }
#night-mode { background: var(--ink); color: var(--paper); }
#mix-mode { background: #ded0ff; }
.mode-card strong, .mode-card small { display: block; }
.mode-card strong { font-size: 1.05rem; line-height: 1.2; }
.mode-card small { margin-top: .2rem; font-size: .825rem; font-weight: 550; line-height: 1.35; }
.mode-emblem { display: grid; place-items: center; width: 2.15rem; height: 2.65rem; border: 1px solid var(--ink); border-radius: 6px; background: var(--paper); color: var(--ink); transform: rotate(-7deg); font-size: 1.25rem; }
#night-mode .mode-emblem { background: #ded0ff; }
.mode-arrow { font-size: 1.35rem; line-height: 1; }
.length-field { display: grid; gap: .5rem; margin-block: 1rem; font-weight: 750; }
.length-field select, .count-input { min-height: 48px; border: 1px solid var(--ink); border-radius: 10px; padding: .65rem .8rem; font: inherit; color: var(--ink); background: var(--paper); }
.length-field select:focus-visible, .count-input:focus-visible { outline: 3px solid #641bc3; outline-offset: 2px; }
.length-field .count-input:read-only { background: #eee5f9; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .mode-card:hover:not(:disabled) { box-shadow: 0 4px 0 var(--ink); } }
.intro-controls { padding: clamp(1.25rem, 5vw, 2rem); }
.mode-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .25rem .65rem; margin-bottom: .65rem; }
.mode-heading h2, #join-room h2 { font-size: clamp(1.2rem, 5vw, 1.65rem); }
#join-room h2 { margin-bottom: .75rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(4rem, 15vw, 6rem); line-height: .88; letter-spacing: -.04em; font-weight: 900; }
.period { color: #641bc3; }
h2 { font-size: clamp(1.65rem, 6vw, 2.65rem); line-height: 1.13; letter-spacing: -.03em; text-wrap: balance; }
.card-fan { position: absolute; right: 1.15rem; top: 1.6rem; width: 6rem; height: 7rem; pointer-events: none; }
.card-fan span { position: absolute; inset: 0; display: grid; align-content: end; padding: .55rem; border: 1px solid var(--ink); border-radius: 10px; background: var(--paper); font-size: .8rem; line-height: 1.05; font-weight: 850; transform: translateX(-1rem) rotate(-15deg); }
.card-fan span:nth-child(2) { background: #ffcce1; transform: translateX(.4rem) rotate(15deg); }
.card-fan span:last-child { background: var(--ink); color: var(--paper); transform: translateY(.35rem) rotate(-5deg); }
p { line-height: 1.55; margin-block: .75rem; }
.lede { margin-block-start: 1.4rem; font-weight: 750; font-size: 1.125rem; }
button { font: inherit; font-weight: 750; cursor: pointer; border-radius: 10px; min-height: 48px; padding: .7rem .9rem; transition: transform 120ms ease-out; touch-action: manipulation; }
button:active { transform: scale(.97); }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible { outline: 3px solid #641bc3; outline-offset: 3px; }
.masthead button:focus-visible { outline-color: var(--lime); }
.primary { color: white; background: var(--ink); border: 1px solid var(--ink); }
@media (hover: hover) {
  .primary:hover:not(:disabled) { background: #3d2865; }
  .secondary:hover:not(:disabled) { background: #eee5f9; }
}
#replay { margin-top: .75rem; width: 100%; }
.secondary { background: transparent; border: 1px solid var(--ink); color: inherit; }
.text-button { color: inherit; background: transparent; border: 0; text-decoration: underline; text-underline-offset: .18em; }
.actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: .65rem; margin-top: 1.35rem; }
.round { display: flex; justify-content: space-between; gap: .5rem; font-weight: 750; }
#position { white-space: nowrap; font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: .45rem; margin: .65rem 0 1.4rem; accent-color: #641bc3; }
.question-face { padding: clamp(1rem, 4vw, 1.8rem); border-radius: 12px; background: #eee5f9; }
[data-mode="sizceKim"] .question-face { background: var(--lime); }
[data-mode="hicYapmadim"] .question-face { background: #ffcce1; }
[data-mode="rahatTanisma"] .question-face { background: var(--lime); }
[data-mode="sohbet"] .question-face { background: #ded0ff; }
[data-mode="tatliAtisma"] .question-face { background: #ffdbc1; }
.question-face p { margin-block-end: 0; }
#choices { list-style: upper-alpha inside; padding: 0; margin-block: 1.2rem; }
#choices li { padding: .8rem .9rem; background: var(--paper); border-radius: 10px; line-height: 1.45; }
#choices li + li { margin-top: .55rem; }
#choices li::marker { color: #641bc3; font-weight: 800; }
#rule, #defense { color: #4a3566; }
#status:empty { display: none; }
#room-status:empty { display: none; }
#intro h1 { font-size: clamp(2.75rem, 11vw, 4.5rem); }
#room-start { width: 100%; }
#edit-room-settings { margin-bottom: 1rem; }
.name-input { width: 100%; min-height: 48px; padding: .65rem .8rem; margin-bottom: .55rem; font: inherit; border: 1px solid var(--ink); border-radius: 10px; color: var(--ink); background: var(--paper); }
.player-list { list-style: none; padding: 0; }
.player-list li { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid #dcd1ed; overflow-wrap: anywhere; }
.player-list li span { flex-shrink: 0; }
.player-list .remove-player { margin-inline-start: auto; flex-shrink: 0; }
#player-ready[aria-pressed="true"] { background: var(--lime); }
#join-room { margin-top: 1rem; border-top: 1px solid #dcd1ed; padding-top: 1rem; }
#join-room label { display: block; font-weight: 750; margin-bottom: .45rem; }
.join-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; }
#room-input { min-width: 0; font: inherit; text-transform: uppercase; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 10px; padding: .65rem .8rem; }
#room-input:focus-visible { outline: 3px solid #641bc3; outline-offset: 2px; }
.room-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 0 .25rem .35rem; }
#leave-room { margin-inline-start: auto; }
.room-bar button:focus-visible { outline-color: var(--lime); }
.lobby-code { display: grid; gap: .2rem; background: var(--lime); padding: .8rem 1rem; border-radius: 10px; }
.lobby-code span { font-weight: 750; }
#lobby-code { font-size: clamp(1.4rem, 7vw, 2.5rem); letter-spacing: .12em; font-variant-numeric: tabular-nums; user-select: all; }
#room-invite { display: grid; justify-items: center; margin-block: .5rem 1rem; }
#room-qr { display: block; max-width: 100%; height: auto; }
#room-link { padding: .65rem; }
#room-code { color: var(--lime); font-variant-numeric: tabular-nums; letter-spacing: .12em; margin-inline-start: .35rem; }
#guest-hint { margin-top: 1.25rem; font-size: .9rem; color: #4a3566; }
::selection { background: #641bc3; color: white; }
@media (min-width: 44rem) {
  .mode-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-title h1 { max-width: calc(100% - 11rem); }
  .card-fan { right: 3rem; width: 7.5rem; }
  .lobby-layout:has(#room-invite:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 15rem); align-items: center; gap: 1.5rem; }
}
@media (max-width: 23rem) { .card-fan { transform: scale(.8); transform-origin: top right; } }
@media (prefers-reduced-motion: reduce) { button { transition: none; } button:active { transform: none; } }

.mix-editor {
  margin: 1.25rem 0; min-inline-size: 0; padding: .85rem;
  color: var(--paper); background: var(--ink); border: 0; border-radius: 16px;
}
.mix-editor legend {
  float: left; width: 100%; padding: .1rem .15rem .65rem;
  font-size: 1.15rem; letter-spacing: -.025em; font-weight: 850;
}
.mix-methods { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  padding: 3px; margin-bottom: .65rem; border: 1px solid #816fa3; border-radius: 10px; }
.mix-methods label, .mix-row label { position: relative; cursor: pointer; }
.mix-methods input, .mix-row input[type=checkbox] {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.mix-methods span { display: grid; place-items: center; min-height: 40px;
  border-radius: 7px; font-weight: 750; font-size: .875rem; text-align: center; }
.mix-methods input:checked + span { background: var(--lime); color: var(--ink); }
.mix-methods input:focus-visible + span, .mix-row:has(input:focus-visible) { outline: 3px solid #ded0ff; outline-offset: 2px; }
.mix-row { display: flex; align-items: center; gap: .4rem; border-radius: 8px; margin-block: 3px; padding-right: .65rem; }
.mix-row:has(:checked) { background: var(--paper); color: var(--ink); }
.mix-row label { flex: 1; display: flex; align-items: center; gap: .65rem; min-height: 44px; padding: .3rem .45rem; font-weight: 680; line-height: 1.15; }
.pack-emblem { position: relative; flex: none; display: grid; place-items: center; width: 25px; height: 30px;
  border: 1px solid currentColor; border-radius: 5px; transform: rotate(-7deg); font: bold 1.15rem/1 system-ui; }
.mix-row:has(:checked) .pack-emblem { background: #ded0ff; box-shadow: 2px 2px 0 var(--ink); }
.mix-row:nth-of-type(even):has(:checked) .pack-emblem { background: #ffcce1; }
.mix-row:has(:checked) .pack-emblem::after { content: "✓"; position: absolute; inset: auto -5px -4px auto; padding: 2px; border-radius: 50%; background: var(--ink); color: white; font-size: .6rem; }
.mix-share { font-size: .8rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.mix-row input[type=number] { width: 3.3rem; min-height: 40px; font: inherit; font-weight: 750;
  text-align: center; border: 1px solid var(--ink); color: var(--ink); background: white; border-radius: 7px; }
.mix-editor output { display: block; margin-top: .65rem; padding: .6rem .2rem 0; border-top: 1px dashed #816fa3;
  font-weight: 800; text-align: right; color: var(--lime); font-variant-numeric: tabular-nums; }
.mix-incomplete output { color: #ffcce1; }
.preset-list { clear: both; display: flex; flex-wrap: wrap; gap: .35rem; }
.preset-list:not(:empty) { margin-bottom: .75rem; }
.preset-list button { max-width: 100%; overflow-wrap: anywhere; min-height: 40px; padding: .4rem .7rem; background: #ded0ff; color: var(--ink); border: 0; }
.preset-save { display: flex; gap: .4rem; margin-top: .65rem; }
.preset-save input { width: 0; flex: 1; font: inherit; border: 0; border-radius: 8px; padding: .5rem; }
.preset-save button { min-height: 42px; background: var(--lime); color: var(--ink); border: 0; }
#question-count { max-height: 90dvh; overflow-y: auto; }

.play-guide-link { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px;
  color: var(--ink); font-size: .9rem; font-weight: 750; text-decoration: underline; text-underline-offset: .2em; }
.play-guide-link:hover { text-decoration: underline; text-underline-offset: .2em; }
.play-guide-link:focus-visible, .guide-back:focus-visible { outline: 3px solid #641bc3; outline-offset: 3px; }
.guide-header { background: #ded0ff; padding: clamp(1.2rem, 5vw, 2.5rem); border-bottom: 1px solid var(--ink); }
.guide-header h1 { font-size: clamp(2.4rem, 9vw, 5rem); line-height: .98; }
.guide-header p { max-width: 44ch; margin-bottom: 0; }
.guide-back { display: inline-flex; align-items: center; min-height: 44px; color: inherit; font-weight: 750; text-underline-offset: .2em; }
.guide-header .guide-back { margin-bottom: .65rem; }
.guide-sheet { padding: 0; overflow: hidden; }
.guide-layout { display: grid; }
.guide-mode { padding: clamp(1.15rem, 4vw, 1.75rem); }
.guide-mode + .guide-mode { border-top: 1px solid var(--ink); }
.guide-example { display: block; max-width: 23rem; margin: .35rem 0 1.15rem; padding: .85rem; border: 1px solid var(--ink);
  border-radius: 10px; background: #ffcce1; box-shadow: 3px 4px 0 var(--ink); font-weight: 850; transform: rotate(-1deg); }
.guide-mode + .guide-mode .guide-example { background: var(--lime); transform: rotate(1deg); }
.guide-mode ol { padding-inline-start: 1.3rem; margin-bottom: 0; }
.guide-mode li { padding-inline-start: .25rem; margin-top: .6rem; line-height: 1.5; }
.guide-mode li::marker { font-weight: 850; color: #641bc3; }
.guide-footer { background: var(--ink); color: var(--paper); padding: 1.15rem; }
.guide-footer p { margin: 0; }
.guide-footer a { color: var(--lime); }
.guide-footer a:focus-visible { outline-color: var(--lime); }
@media (min-width: 40rem) {
  .guide-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-mode + .guide-mode { border-top: 0; border-inline-start: 1px solid var(--ink); }
}
