:root {
  --bg: #fafaf8; --fg: #1d1d1b; --muted: #6b6b66; --line: #deded8; --card: #fff;
  --b1: #2f7fe0; --b2: #14a3b8; --b3: #f0b400; --b4: #f27c10; --b5: #ee4126; --b6: #d3122e;
}
[hidden] { display: none !important; }  /* inak ho prebíjajú pravidlá display (napr. form { display: flex }) */
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --fg: #ececE8; --muted: #9a9a94; --line: #333330; --card: #1f1f1d; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.4 system-ui, sans-serif; }
main { max-width: 560px; margin: 0 auto; padding: 16px; }
h1 { margin: 8px 0 0; font-size: 1.8rem; font-weight: 800; letter-spacing: -.01em; width: fit-content;
  background: linear-gradient(90deg, var(--b6), var(--b4), var(--b3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 20px 0 6px; }
.sub { margin: 2px 0 12px; color: var(--muted); }
.rules { margin-bottom: 12px; color: var(--muted); font-size: .9rem; }
.rules summary { cursor: pointer; }
form { display: flex; gap: 8px; }
input { flex: 1; min-width: 0; padding: 10px 12px; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
button { padding: 10px 16px; font-size: 1rem; font-weight: 600; border: 0; border-radius: 8px; background: var(--fg); color: var(--bg); cursor: pointer; transition: transform .12s, filter .12s; }
button:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
button:disabled { opacity: .4; cursor: default; }
button.link { background: none; color: var(--muted); text-decoration: underline; padding: 12px 0; font-size: .9rem; }
#message { min-height: 1.4em; margin: 6px 0; color: var(--muted); font-size: .9rem; }
#result { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin-bottom: 8px; animation: pop .4s ease-out; }
#result.win { border-color: var(--b3); background: linear-gradient(135deg, rgba(240, 180, 0, .22), var(--card) 60%); box-shadow: 0 0 0 2px rgba(240, 180, 0, .35); }
#result p { margin: 0 0 8px; }
.guesses { list-style: none; margin: 0; padding: 0; }
.guess { position: relative; display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 9px 12px; margin-bottom: 5px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--line); overflow: hidden; }
.guess .bar { position: absolute; inset: 0 auto 0 0; opacity: .55; }
.guess > span { position: relative; }
.guess .word { font-weight: 600; }
.guess .rank { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
.guess .temp { font-weight: 700; min-width: 5.5em; text-align: right; }
.guess .deg { font-weight: 800; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.band-b1 { border-left-color: var(--b1); } .band-b2 { border-left-color: var(--b2); } .band-b3 { border-left-color: var(--b3); }
.band-b4 { border-left-color: var(--b4); } .band-b5 { border-left-color: var(--b5); } .band-b6 { border-left-color: var(--b6); }
.bar.b1 { background: var(--b1); } .bar.b2 { background: var(--b2); } .bar.b3 { background: var(--b3); }
.bar.b4 { background: var(--b4); } .bar.b5 { background: var(--b5); } .bar.b6 { background: var(--b6); }
#last .guess, #hint .guess { animation: pop .3s ease-out; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
#history { padding-left: 20px; margin: 0; color: var(--muted); font-size: .9rem; }
footer { margin-top: 32px; font-size: .75rem; color: var(--muted); }
button.inline { padding: 0; font-size: inherit; }
#player-line { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }
#alias-message { min-height: 1.4em; margin: 6px 0; color: var(--muted); font-size: .9rem; }
#result h2 { margin-top: 12px; }
#result button#next { margin-top: 10px; }
#board-wrap select { padding: 8px 10px; font-size: .95rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); max-width: 100%; }
#board-message { min-height: 1.2em; margin: 6px 0; color: var(--muted); font-size: .9rem; }
#board { width: 100%; border-collapse: collapse; font-size: .9rem; }
#board th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--line); }
#board td { padding: 6px; border-bottom: 1px solid var(--line); }
#board td.num, #board th:nth-child(1), #board th:nth-child(3), #board th:nth-child(4) { font-variant-numeric: tabular-nums; }
#board tr.me td { font-weight: 700; background: var(--card); }
#board td.gaveup { color: var(--muted); }
.quip { font-weight: 600; font-size: 1.05rem; margin: 0 0 4px; }
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.modal-card { width: 100%; max-width: 420px; padding: 22px; border-radius: 14px; background: var(--card); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); animation: pop .2s ease-out; }
.modal-card h3 { margin: 0 0 10px; font-size: 1.25rem; }
.modal-card p { margin: 0 0 18px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
button.secondary { background: var(--line); color: var(--fg); }
#board td.playing { color: var(--b4); font-weight: 700; }
#board tr.st-paused td { color: var(--muted); }

/* pomôcky a žetóny */
#helps { margin: 4px 0 8px; }
.helps-bar { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 8px; align-items: stretch; }
.tokens { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; padding: 8px 10px;
  border-radius: 12px; background: linear-gradient(160deg, rgba(240, 180, 0, .28), rgba(242, 124, 16, .18)); border: 1px solid rgba(240, 180, 0, .55); }
.tokens .coin { font-size: 1.3rem; line-height: 1; }
.tokens b { font-size: 1.35rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tokens .dots { font-size: .6rem; letter-spacing: 2px; color: var(--b3); }
.tokens.bump { animation: bump .6s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.18); box-shadow: 0 0 18px rgba(240, 180, 0, .7); } 100% { transform: scale(1); } }
.help-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px;
  background: var(--card); color: var(--fg); border: 1px solid var(--line); font-weight: 600; }
.help-btn .icon { font-size: 1.4rem; line-height: 1.1; }
.help-btn .name { font-size: .68rem; line-height: 1.15; text-align: center; color: var(--muted); font-weight: 600; }
.help-btn .cost { position: absolute; top: -7px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--b3); color: #1d1d1b; font-size: .75rem; font-weight: 800; line-height: 20px; text-align: center; }
.help-btn:disabled { opacity: .45; }
.help-btn.used { opacity: 1; border-color: var(--b2); background: rgba(20, 163, 184, .16); }
.help-btn.used .cost { display: none; }
.help-btn.used::after { content: "✓"; position: absolute; top: -7px; right: -5px; width: 20px; height: 20px; border-radius: 10px;
  background: var(--b2); color: #fff; font-size: .8rem; line-height: 20px; text-align: center; }
.helps-info { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.help-chip { padding: 5px 12px; border-radius: 999px; background: rgba(20, 163, 184, .18); border: 1px solid var(--b2); font-weight: 700; letter-spacing: .02em; }
.help-row { flex: 1 1 100%; }
.help-label { display: block; margin: 2px 0 4px; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.reward { margin: 0 0 8px; font-weight: 700; color: var(--b4); }
.blesk { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--b3);
  background: linear-gradient(135deg, rgba(240, 180, 0, .26), rgba(242, 124, 16, .12)); font-weight: 600; font-size: .92rem; }
.blesk.late { border-color: var(--b5); background: linear-gradient(135deg, rgba(238, 65, 38, .22), rgba(240, 180, 0, .1)); }
.blesk-track { height: 6px; margin-top: 8px; border-radius: 3px; background: rgba(0, 0, 0, .12); overflow: hidden; }
.blesk-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--b4), var(--b3)); transition: width .9s linear; }

/* konto */
.stack { flex-direction: column; align-items: stretch; }
.card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 10px; }
.card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.row { display: flex; gap: 8px; }
.auth { margin: 4px 0 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab { flex: 1; background: var(--line); color: var(--muted); }
.tab.active { background: var(--fg); color: var(--bg); }
.check { display: flex; gap: 6px; align-items: center; font-size: .85rem; color: var(--muted); }
.check input { flex: 0 0 auto; width: auto; }
.note { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
#auth-message, #password-message { min-height: 1.2em; margin: 6px 0 0; font-size: .9rem; color: var(--b5); }
.player-line { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.player-line button.link { padding: 6px 0; }
.banner { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--b3); background: rgba(240, 180, 0, .15); font-size: .9rem; }

/* životy */
.lives { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; }
.hearts { font-size: 1.25rem; letter-spacing: 2px; line-height: 1; }
.lives-text { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.modal-cost { margin: -8px 0 18px; font-weight: 700; color: var(--b5); }

/* záložky rebríčka */
.board-tabs { display: flex; gap: 6px; margin: 0 0 10px; }
.board-tabs .tab { padding: 8px 12px; font-size: .9rem; }
#total { width: 100%; border-collapse: collapse; font-size: .9rem; }
#total th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--line); }
#total td { padding: 6px; border-bottom: 1px solid var(--line); }
#total tr.me td { font-weight: 700; background: var(--card); }

/* prehľad tipov so značkou „zlá teplota“ */
.review-card { max-width: 480px; max-height: 90vh; overflow-y: auto; }
.review-item { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; }
.review-item ul { flex: 1; min-width: 0; margin: 0; }
.review-item .guess { margin-bottom: 0; }
.flag-btn { flex: 0 0 auto; padding: 8px 10px; font-size: 1rem; line-height: 1; background: var(--line); color: var(--fg); filter: grayscale(.7); }
.flag-btn.on { background: var(--b5); filter: none; }
#review-msg { min-height: 1.2em; margin: 8px 0 0; font-size: .9rem; color: var(--muted); }
