/* Tamsi noir tema, optimizuota iPad Safari: dideli mygtukai, be hover logikos. */
:root {
  --bg: #0f0e0d;
  --bg2: #171513;
  --panel: #1e1b18;
  --panel2: #27231f;
  --line: #3a342d;
  --text: #ece6dc;
  --muted: #a39a8c;
  --gold: #d6a84e;
  --gold-dim: #8f7034;
  --red: #c0392b;
  --red-dim: #6e2019;
  --green: #4f9a5b;
  --blue: #4f7fa8;
  --violet: #8a68b0;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Georgia", "Times New Roman", serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 18px; line-height: 1.4; }
body { min-height: 100vh; min-height: 100dvh; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; color: var(--gold); }
p { margin: .4em 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

.wrap { max-width: 980px; margin: 0 auto; padding: 16px; padding-bottom: 80px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 14px; }
.card.gold { border-color: var(--gold-dim); }
.card.red { border-color: var(--red); }

button, .btn {
  font: inherit; font-size: 1rem; font-weight: 600; color: var(--text);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; min-height: 52px; cursor: pointer; touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
button:active { transform: scale(.98); }
button:disabled { opacity: .4; }
button.primary { background: var(--gold); color: #1b1408; border-color: var(--gold); }
button.danger { background: var(--red-dim); border-color: var(--red); }
button.ghost { background: transparent; }
button.sel { outline: 3px solid var(--gold); background: #3a2f1c; }
button.big { font-size: 1.25rem; padding: 18px 22px; min-height: 64px; width: 100%; }
button.tiny { min-height: 40px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }

input, select {
  font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; min-height: 50px; width: 100%;
}
input[type=checkbox] { width: 26px; height: 26px; min-height: 0; accent-color: var(--gold); }
label { display: block; }
label.check { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.field { margin: 10px 0; }
.field > span { display: block; color: var(--muted); font-size: .9rem; margin-bottom: 4px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--panel2); border: 1px solid var(--line); }
.pill.gold { color: var(--gold); border-color: var(--gold-dim); }
.pill.red { color: #ff8a7a; border-color: var(--red); }
.pill.green { color: #8fd49a; border-color: var(--green); }
.pill.blue { color: #9cc4e6; border-color: var(--blue); }
.pill.violet { color: #c7a8ec; border-color: var(--violet); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--green); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: var(--red-dim); border: 1px solid var(--red); color: #fff; padding: 14px 20px;
  border-radius: 12px; max-width: 90vw; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.toast.ok { background: #1f3a24; border-color: var(--green); }
.conn { position: fixed; top: 8px; right: 10px; z-index: 50; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
.item.dead { opacity: .5; }
.item .name { font-weight: 600; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid button { width: 100%; }

.timer { font-variant-numeric: tabular-nums; font-family: var(--serif); }
.timer.huge { font-size: 7rem; line-height: 1; text-align: center; color: var(--gold); }
.timer.warn { color: #ff6b57; }
.timer.done { color: var(--red); }

.gesture { text-align: center; padding: 18px; border-radius: var(--radius); background: #2d2414; border: 2px solid var(--gold); }
.gesture .icon { font-size: 5rem; line-height: 1.1; }
.gesture .txt { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.phrase { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: #e9d7b0; border-left: 3px solid var(--gold-dim); padding: 4px 0 4px 12px; margin: 10px 0; }

table { width: 100%; border-collapse: collapse; }
td, th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tabs button { flex: 0 0 auto; min-height: 46px; }
.tabs button.on { background: var(--gold); color: #1b1408; border-color: var(--gold); }

.night-body { background: #050505; }

/* ---------- taisyklių langas ---------- */
body.rules-open { overflow: hidden; }
.rules-overlay { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; }
.rules-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); background: var(--panel); font-size: 1.15rem; }
.rules-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px 40px; max-width: 760px; width: 100%; margin: 0 auto; }
.rules-nav { position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; background: var(--bg); }
.rules-nav a { flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--gold-dim); color: var(--gold); text-decoration: none; font-size: .9rem; font-weight: 600; }
.rules-body section { padding-top: 8px; scroll-margin-top: 58px; }
.rules-body h3 { margin-top: 18px; font-size: 1.35rem; }
.rules-body h4 { margin: 16px 0 4px; color: var(--text); font-family: var(--serif); }
.rules-body ol, .rules-body ul { padding-left: 22px; margin: 6px 0; }
.rules-body li { margin: 6px 0; }
.rules-body dt { font-weight: 700; color: var(--gold); margin-top: 10px; }
.rules-body dd { margin: 2px 0 0; }
.rules-body details > summary { cursor: pointer; padding: 10px 0; color: var(--gold); font-weight: 600; }
.rules-body .gest { list-style: none; padding-left: 0; }
.rr { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.rr-h { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.rr-i { font-size: 1.4rem; }
.rr-d { margin-top: 4px; font-size: .95rem; }
.rr-g { margin-top: 4px; font-size: .9rem; color: var(--muted); }
.rules-btn { min-height: 40px; padding: 6px 12px; font-size: .9rem; border-radius: 999px; border-color: var(--gold-dim); color: var(--gold); background: transparent; }
.logo { font-family: var(--serif); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
