:root {
  --bg: #0a0507;
  --card: #170a0f;
  --text: #f4e9ea;
  --muted: #b38f95;
  --accent: #b0102f;
  --accent-hi: #e11d48;
  --gold: #c9a24a;
  --steel: #8c9099;
  --border: #4d0e1d;
  --plus: #d4183d;
  --minus: #6f747e;
  --font-display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% -10%, #4a0a1a 0%, #1a060c 45%, #0a0507 80%) fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
}

/* Bőrszerű textúra a háttéren */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.28) 0 2px, transparent 2px 5px);
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 {
  margin: 8px 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  text-shadow: 0 0 18px rgba(225, 29, 72, 0.7);
}

.sub {
  margin: 0;
  text-align: center;
  color: var(--muted);
}

.section-title {
  margin: 8px 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--gold);
}

/* ---------------------------------------------------------- fejléc */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding-top: 8px;
}

.lock {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 0 10px rgba(225, 29, 72, 0.65));
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4em;
}

.hero h1 {
  margin: 0;
  font-size: 2.2rem;
}

/* Lánc-elválasztó */
.chain {
  width: 100%;
  height: 12px;
  background-image: radial-gradient(
    ellipse 9px 4.5px at 50% 50%,
    transparent 58%,
    var(--gold) 66%,
    var(--gold) 88%,
    transparent 96%
  );
  background-size: 20px 12px;
  background-repeat: repeat-x;
  opacity: 0.85;
}

.lead {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.35;
  color: #fff;
}

.rule {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

/* ------------------------------------------------------ kártyák */

/* Bőr kártya, varrással */
.card {
  position: relative;
  background: linear-gradient(180deg, #1d0c12, #12070b);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(201, 162, 74, 0.1);
}

.card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(201, 162, 74, 0.32);
  border-radius: 10px;
  pointer-events: none;
}

/* ---------------------------------------------------- gombok */

button {
  font: inherit;
  color: var(--text);
  border: 1px solid #5a1424;
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #2a1118, #160a0e);
  cursor: pointer;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.vote-btn {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  padding: 36px 16px;
  border: 2px solid var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.vote-btn.plus {
  background: linear-gradient(180deg, #e11d48, #8e0a26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 18px rgba(176, 16, 47, 0.45);
}

.vote-btn.minus {
  background: linear-gradient(180deg, #353a42, #0d0f12);
  border-color: var(--steel);
  color: #e8eaed;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 18px rgba(0, 0, 0, 0.55);
}

.vote-btn.selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 0 26px rgba(255, 255, 255, 0.35);
}

.vote-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.primary {
  background: linear-gradient(180deg, #d4183d, #8e0a26);
  border: 1px solid var(--gold);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.danger {
  background: linear-gradient(180deg, #4a0d14, #2a070c);
  border-color: #7a1a26;
}

.status {
  min-height: 1.4em;
  margin: 0;
  text-align: center;
  color: var(--muted);
}

.status.error {
  color: #ff6b81;
}

/* ------------------------------------------------------ űrlap */

input[type="password"],
input[type="number"],
input[type="text"],
input[type="time"] {
  font: inherit;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0a0507;
  color: var(--text);
}

input:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

label.row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

label.row input {
  width: 22px;
  height: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  color: var(--muted);
}

/* ---------------------------------------------------- admin */

.polls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.poll-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.poll-head strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.badge {
  flex: none;
  padding: 3px 10px;
  border: 1px solid var(--steel);
  border-radius: 999px;
  color: #d5d8dd;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-active {
  border-color: var(--accent-hi);
  background: rgba(225, 29, 72, 0.16);
  color: #ff8da1;
}

.badge-upcoming {
  border-color: var(--gold);
  color: var(--gold);
}

.badge-published {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.14);
  color: var(--gold);
}

.poll-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.poll-actions button {
  flex: 1;
}

.draft {
  box-sizing: border-box;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0a0507;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.sub.error {
  color: #ff6b81;
}

.recent-details summary {
  cursor: pointer;
  color: var(--muted);
}

.recent-details .recent {
  margin-top: 8px;
}

.big-number {
  text-align: center;
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 18px rgba(225, 29, 72, 0.5);
}

.big-number small {
  display: block;
  margin-top: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
  text-shadow: none;
}

.bar {
  display: flex;
  height: 26px;
  border-radius: 13px;
  overflow: hidden;
  background: #0a0507;
  border: 1px solid var(--border);
}

.bar .bar-plus {
  background: linear-gradient(180deg, #e11d48, #8e0a26);
  transition: width 0.4s;
}

.bar .bar-minus {
  background: linear-gradient(180deg, #7c818b, #3b3f46);
  transition: width 0.4s;
}

.counts {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.counts .plus {
  color: #ff6b81;
}

.counts .minus {
  color: #b8bcc4;
}

.recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.recent li {
  display: flex;
  justify-content: space-between;
}

/* ------------------------------------------------ szavazó oldal */

.poll-card {
  text-align: center;
}

.poll-title {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.poll-lead {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.35;
}

.poll-lead strong,
.lead strong {
  color: var(--accent-hi);
  text-shadow: 0 0 14px rgba(225, 29, 72, 0.55);
}

.vote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vote-grid .vote-btn {
  font-size: 1.6rem;
  padding: 32px 8px;
}

.game-details summary {
  padding: 6px 0;
  cursor: pointer;
  list-style: none;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
}

.game-details summary::-webkit-details-marker {
  display: none;
}

.game-details summary::after {
  content: " ▾";
}

.game-details[open] summary::after {
  content: " ▴";
}

.game-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
}

.game-body .primary {
  width: 100%;
  font-size: 1.3rem;
  padding: 16px;
}

/* Ügyességi sáv: a mutató ide-oda jár, a vörös zónában kell megállítani */
.game-track {
  position: relative;
  height: 52px;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: 26px;
  background: linear-gradient(180deg, #050203, #1a0a0f);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 18px rgba(225, 29, 72, 0.25);
  cursor: pointer;
  touch-action: manipulation;
}

.game-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.game-edge {
  background: repeating-linear-gradient(45deg, #8e0a26 0 6px, #5a0716 6px 12px);
}

.game-core {
  background: linear-gradient(180deg, #ff3b63, #c0102f);
  box-shadow: 0 0 16px rgba(255, 59, 99, 0.7);
  font-size: 1.1rem;
}

.game-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  margin-left: -3px;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 22px rgba(255, 255, 255, 0.6);
}

.game-track.hit-3 {
  box-shadow: 0 0 0 3px #ff3b63, 0 0 30px rgba(255, 59, 99, 0.85);
}

.game-track.hit-1 {
  box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(201, 162, 74, 0.6);
}

.game-track.miss {
  opacity: 0.7;
}

.game-result {
  min-height: 1.5em;
  margin: 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-align: center;
}

/* Szerencsekerék: hat mező, páros = plusz (vörös), páratlan = mínusz (acél) */
.wheel-wrap {
  position: relative;
  align-self: center;
  width: 250px;
  height: 250px;
  margin: 8px 0;
}

.wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border: 4px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(225, 29, 72, 0.35), inset 0 0 18px rgba(0, 0, 0, 0.6);
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  margin: -12px 0 0 -22px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 2;
  margin-left: -14px;
  border-top: 28px solid var(--gold);
  border-right: 14px solid transparent;
  border-left: 14px solid transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

/* Lufi: minden pumpával nagyobb, véletlenül kipukkadhat */
.balloon-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 210px;
}

.balloon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 100%;
  transition: transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.balloon {
  width: 110px;
  height: 132px;
  border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%;
  background: radial-gradient(circle at 34% 28%, #ff8da1 0, #e11d48 38%, #8e0a26 100%);
  box-shadow: inset -8px -10px 18px rgba(0, 0, 0, 0.35), 0 0 22px rgba(225, 29, 72, 0.4);
}

.balloon-knot {
  width: 0;
  height: 0;
  border-right: 8px solid transparent;
  border-bottom: 12px solid #8e0a26;
  border-left: 8px solid transparent;
}

.balloon-string {
  width: 2px;
  height: 26px;
  background: var(--gold);
}

.balloon-stage.popped .balloon-wrap {
  display: none;
}

.balloon-pop {
  display: none;
  align-self: center;
  color: #ff3b63;
  font-family: var(--font-display);
  font-size: 2.4rem;
  text-shadow: 0 0 22px rgba(255, 59, 99, 0.8);
  animation: pop-in 0.35s ease-out;
}

.balloon-stage.popped .balloon-pop {
  display: block;
}

@keyframes pop-in {
  from {
    transform: scale(0.2);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.balloon-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-body .balloon-actions button {
  width: 100%;
  font-size: 1.1rem;
  padding: 14px 8px;
}

/* ------------------------------------- hang gomb, felirat */

.sound-toggle {
  align-self: flex-end;
  padding: 4px 12px;
  border: 1px solid rgba(201, 162, 74, 0.5);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

/* ------------------------------------ becenév és toplista */

.nick-form .optional {
  color: var(--muted);
  font-size: 0.85em;
}

.nick-row {
  display: flex;
  gap: 8px;
}

.nick-row input {
  flex: 1;
  min-width: 0;
}

.nick-save {
  padding: 12px 18px;
}

.nick-status {
  min-height: 1.3em;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.nick-status.error {
  color: #ff6b81;
}

.leaderboard {
  text-align: center;
}

.nick-consent {
  font-size: 0.9rem;
}

.board-tabs {
  display: flex;
  gap: 8px;
}

.board-tab {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}

.board-tab.selected {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.14);
  color: var(--gold);
}

.board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.board-title {
  margin: 8px 0 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.board-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.board-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 5, 7, 0.6);
}

.board-row:nth-child(1) {
  border-color: var(--gold);
}

.board-row.mine {
  background: rgba(176, 16, 47, 0.28);
  border-color: var(--accent-hi);
}

.board-rank {
  min-width: 2ch;
  color: var(--gold);
  font-family: var(--font-display);
}

.board-nick {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.board-value {
  color: var(--accent-hi);
  white-space: nowrap;
}

.board-empty {
  color: var(--muted);
  font-style: italic;
}

.nick-profile {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nick-profile[hidden] {
  display: none;
}

.profile-line {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.badges:empty {
  display: none;
}

.badge {
  padding: 2px 8px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: rgba(201, 162, 74, 0.12);
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.board-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

.links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.links-title {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.links-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.link-btn {
  flex: 1 1 140px;
  padding: 12px 18px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: linear-gradient(180deg, #2a1118, #160a0e);
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-align: center;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.link-btn:hover,
.link-btn:focus-visible {
  background: linear-gradient(180deg, #d4183d, #8e0a26);
  outline: none;
}

.disclaimer {
  margin: 8px 0 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(201, 162, 74, 0.32);
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}

/* --------------------------------------- archívum, rekordok */

.records {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.record {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0a0507;
  text-align: center;
}

.record-label {
  color: var(--gold);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.record-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-shadow: 0 0 14px rgba(225, 29, 72, 0.45);
}

.record-detail {
  color: var(--muted);
  font-size: 0.78rem;
}

.chart {
  padding: 8px 4px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0a0507;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart text {
  fill: var(--muted);
  font-size: 11px;
  text-anchor: middle;
}

.chart .chart-value {
  fill: #fff;
  font-weight: 700;
}

.chart .chart-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.chart .chart-bar {
  fill: url(#chart-grad);
}

.chart .chart-bar.best {
  fill: var(--gold);
}

/* ---------------------------------------------------- naptár */

.calendar {
  background: #0a0507;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-head button {
  width: 44px;
  padding: 8px;
  font-size: 1.3rem;
  line-height: 1;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-weekdays {
  color: var(--gold);
  font-size: 0.85rem;
}

.cal-day {
  padding: 10px 0;
  border-radius: 10px;
  border-color: transparent;
  background: transparent;
  font-size: 1rem;
}

.cal-day:disabled {
  opacity: 0.25;
}

.cal-day.today {
  border: 1px solid var(--gold);
}

.cal-day.selected {
  background: linear-gradient(180deg, #e11d48, #8e0a26);
  font-weight: 700;
}

#dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hidden {
  display: none !important;
}
