/* Колесо розыгрыша (/wheel): поверх landing.css */
.wheel-hero { padding: 36px 0 8px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: center; }

/* --- прошлые победители: барабан из карточек, медленно крутится ---------------------------------- */
.winners { display: flex; flex-direction: column; align-items: center; gap: 2px; transform: rotate(-5deg); }
.winners-title { transform: rotate(-2deg); }
.drum {
  position: relative; width: 290px; height: 190px; perspective: 800px;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
.drum-ring { position: absolute; inset: 0; transform-style: preserve-3d; animation: drum var(--period, 30s) linear infinite; }
@keyframes drum {
  from { transform: translateZ(calc(-1 * var(--r))) rotateX(0deg); }
  to { transform: translateZ(calc(-1 * var(--r))) rotateX(360deg); }
}
.drum-card {
  position: absolute; left: 8px; right: 8px; top: 50%; height: 50px; margin-top: -25px;
  transform: rotateX(calc(-1 * var(--a))) translateZ(var(--r)); backface-visibility: hidden;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--paper-2); border: var(--line); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink);
}
.drum-card img, .drum-card .ph { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--pink); flex-shrink: 0; }
.drum-card b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.drum-card span { margin-left: auto; font: 700 19px/1 var(--font-hand); color: var(--green-ink); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .drum-ring { animation: none; } }
@media (max-width: 760px) { .wheel-hero { grid-template-columns: minmax(0, 1fr); } .winners { transform: none; } }

/* --- режим для OBS: только лента, список и колесо ------------------------------------------------- */
.obs-exit { display: none; }
body.obs .nav, body.obs .wheel-hero, body.obs #spins, body.obs .footer, body.obs .desk, body.obs .skip { display: none !important; }
body.obs main { padding-top: 16px; }
body.obs .wheel-box { width: min(100%, calc(100vh - 110px)); }
body.obs .people-col { max-height: calc(100vh - 110px); }
body.obs .obs-exit {
  display: grid; place-items: center; position: fixed; top: 10px; right: 10px; z-index: 300; width: 34px; height: 34px;
  border: var(--line); border-radius: 50%; background: var(--paper-2); font: 700 20px/1 var(--font); cursor: pointer;
  opacity: 0; transition: opacity .2s;
}
body.obs .obs-exit:hover, body.obs .obs-exit:focus-visible { opacity: 1; }
body.obs .status .btn.check { display: none; }
.wheel-hero .title { margin-top: 6px; }
.wheel-hero .lead a { color: var(--green-ink); text-decoration: underline wavy rgba(70, 135, 104, 0.5); text-underline-offset: 4px; }

.card {
  background: var(--paper-2); border: var(--line); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); padding: 16px 18px;
}
.card h3 { font-size: 15px; margin-bottom: 10px; }

.stage {
  display: grid; grid-template-columns: 270px minmax(0, 1fr); grid-template-areas: "tape tape" "people wheel";
  gap: 26px; align-items: start; padding-top: 18px;
}
.tape-wrap { grid-area: tape; margin-bottom: -6px; }
.tape-title { font-size: 16px; margin-bottom: 0; }
.tape { width: 100%; height: 58px; display: block; }
.people-col { grid-area: people; display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 140px); }
.wheel-box { grid-area: wheel; }

/* --- колесо ---------------------------------------------------------------------------- */
.wheel-box { container-type: inline-size; position: relative; width: min(100%, calc(100vh - 140px)); min-width: min(100%, 420px); aspect-ratio: 1; margin: 0 auto; }
#wheel { width: 100%; height: 100%; display: block; }
.wheel-pointer {
  position: absolute; left: 50%; top: -6px; z-index: 2; width: 44px; height: 54px; transform: translateX(-50%);
  background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.wheel-pointer::after {
  content: ""; position: absolute; inset: 4px 6px 9px; background: var(--pink-ink); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.wheel-hub {
  position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); padding: 0;
  border-radius: 50%; border: var(--line); background: var(--paper-2); box-shadow: 3px 3px 0 var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1);
}
.wheel-hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.07); }
.wheel-hub:active:not(:disabled) { transform: translate(-50%, -50%) scale(0.96); }
.wheel-hub:disabled { cursor: default; }
.wheel-hub img, .hub-label { grid-area: 1 / 1; }
.wheel-hub img { width: 82%; height: 82%; object-fit: contain; }
.hub-label {
  font: 400 2.7cqw/1 var(--font-display);  /* от ширины колеса: слово влезает в бочку */ word-spacing: -0.35em; color: #fff; text-transform: uppercase;
  -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--ink);
}
.wheel-hub:disabled .hub-label { opacity: .85; }
.spin-error {
  position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); z-index: 3; max-width: 80%; text-align: center;
  background: var(--paper-2); border: var(--line); border-radius: 8px; padding: 6px 12px; font-weight: 700; color: var(--live);
}

/* --- статус прокрута ----------------------------------------------------------------------- */
.status {
  position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%); width: min(66%, 420px);
  padding: 22px 24px 18px; text-align: center; box-shadow: 6px 6px 0 var(--ink);
}
.status .close {
  position: absolute; top: 6px; right: 8px; border: 0; background: none; cursor: pointer; padding: 4px 6px;
  font: 700 22px/1 var(--font); color: var(--ink-soft);
}
.status .close:hover { color: var(--pink-ink); }
.status .big.win { font-size: 40px; }
.status .result-row { justify-content: center; }
.status .label { font: 700 22px/1 var(--font-hand); color: var(--green-ink); }
.status .big { font: 400 30px/1.15 var(--font-display); word-spacing: -0.35em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 3px 3px 0; }
.status .big.win { color: var(--pink-ink); text-shadow: 2px 2px 0 var(--ink); }
.status p { margin-top: 6px; }
.status code, .entropy code, .verify code { font-size: 12.5px; word-break: break-all; }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.result-row .ticket { font: 700 24px/1 var(--font-hand); color: var(--ink-soft); }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.field input {
  font: 600 15px var(--font); color: var(--ink); padding: 8px 10px; border: var(--line); border-radius: 8px; background: #fff; min-width: 0;
}
.field input[type="number"] { width: 110px; }
.field.grow { flex: 1 1 240px; }
.error { color: var(--live); font-weight: 700; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }


/* --- участники: слева от колеса, строка цвета своего куска ------------------------------------------ */
.people-col h2 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.window { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.people {
  position: relative; list-style: none; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; padding: 2px 10px 6px 2px; min-height: 0;
  scrollbar-width: thin; scrollbar-color: var(--pink-ink) transparent;
}
.people::-webkit-scrollbar { width: 8px; }
.people::-webkit-scrollbar-track { background: transparent; }
.people::-webkit-scrollbar-thumb { background: var(--pink-ink); border-radius: 8px; border: 1.5px solid var(--ink); }
.people::-webkit-scrollbar-thumb:hover { background: var(--green); }
.person {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 52px; align-items: center; gap: 8px;
  padding: 5px 10px; border: 1.5px solid var(--ink); border-radius: 8px; box-shadow: 2px 2px 0 var(--ink); font-size: 14px;
}
.person.won { outline: 3px solid var(--pink-ink); outline-offset: 1px; }
.person.hover { outline: 3px solid var(--ink); outline-offset: 1px; transform: translateX(4px); }
.person { transition: transform .12s ease; }
.wheel-tip {
  position: absolute; z-index: 4; pointer-events: none; white-space: nowrap; font-size: 14px;
  background: var(--paper-2); border: var(--line); border-radius: 8px; box-shadow: 3px 3px 0 var(--ink); padding: 4px 10px;
}
.person-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.person-name:hover { text-decoration: underline; }
.person-streak { font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 2px; }
.person-pct { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pencil {
  border: 0; background: none; cursor: pointer; padding: 0 2px; font-size: 13px; line-height: 1; color: inherit; opacity: .7;
}
.pencil:hover { opacity: 1; transform: scale(1.2); }
.excluded { margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.add-btn {
  width: 28px; height: 28px; border: var(--line); border-radius: 50%; background: var(--green); color: #fff; cursor: pointer;
  font: 700 18px/1 var(--font); box-shadow: 2px 2px 0 var(--ink); display: grid; place-items: center; padding: 0;
}
.add-btn:hover { background: var(--green-ink); }
.dialog-fields { display: flex; gap: 8px; margin-bottom: 14px; }
.dialog-fields input { font: 600 15px var(--font); color: var(--ink); padding: 8px 10px; border: var(--line); border-radius: 8px; background: #fff; min-width: 0; }
#add-login { flex: 1; }
#add-weight { width: 90px; }

.edit-dialog { margin: auto; padding: 20px 22px; max-width: 420px; width: calc(100% - 32px); color: var(--ink); }  /* margin: auto — сброс в landing.css снимает центровку окна */
.edit-dialog::backdrop { background: rgba(30, 42, 36, 0.45); }
.edit-dialog h3 { font-size: 16px; margin-bottom: 12px; overflow-wrap: anywhere; }
.edit-dialog .field input { width: 100%; font-size: 18px; }
.edit-dialog p { margin: 6px 0 14px; }
.dialog-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- прокруты -------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: var(--line); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); background: var(--paper-2); margin-top: 14px; }
.spins { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.spins th, .spins td { padding: 9px 12px; text-align: left; border-bottom: 1.5px solid rgba(30, 42, 36, 0.15); white-space: nowrap; }
.spins th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.spins tr:last-child td { border-bottom: 0; }
.spins tr.official td { background: rgba(254, 202, 218, 0.45); }
.spins td.who-won { font-weight: 800; }
.spins a { color: var(--green-ink); }
.spins .btn { padding: 4px 10px; font-size: 13px; box-shadow: 2px 2px 0 var(--ink); }
/* телефон: шесть колонок не влезают — строка становится карточкой: кто выпал и «Проверить», ниже дата и кто крутил,
   ещё ниже раунд и билет */
@media (max-width: 640px) {
  .spins thead { display: none; }
  .spins, .spins tbody { display: block; }
  .spins tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "won won act" "when by by" "rnd ticket ticket";
              gap: 3px 12px; align-items: center; padding: 11px 14px; border-bottom: 1.5px solid rgba(30, 42, 36, 0.15); }
  .spins tr:last-child { border-bottom: 0; }
  .spins tr.official { background: rgba(254, 202, 218, 0.45); }
  .spins td, .spins tr.official td { padding: 0; border: 0; background: none; white-space: normal; }
  .spins td.who-won { grid-area: won; font-size: 16px; }
  .spins td.act { grid-area: act; }
  .spins td.when { grid-area: when; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
  .spins td.by { grid-area: by; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .spins td.rnd { grid-area: rnd; font-size: 13px; }
  .spins td.ticket { grid-area: ticket; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
  .spins td.by::before { content: "крутил "; color: var(--ink-soft); }
  .spins td.ticket::before { content: "билет "; }
}
.kind { font-weight: 700; }
.verify { margin-top: 22px; }
.verify ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.verify li::before { content: "… "; }
.verify li.ok::before { content: "✓ "; color: var(--green); font-weight: 900; }
.verify li.bad::before { content: "✗ "; color: var(--live); font-weight: 900; }
.verify pre { font: 12.5px/1.45 ui-monospace, Consolas, monospace; background: #fff; border: 1.5px solid var(--ink); border-radius: 8px; padding: 10px; overflow: auto; max-height: 260px; }
.verify details { margin-top: 14px; font-size: 14px; }
.verify details p { margin: 6px 0; }
.verify summary { cursor: pointer; font-weight: 700; color: var(--green-ink); }
.verdict { font-size: 20px; margin-bottom: 4px; }
.verdict.ok { color: var(--green-ink); }
.verdict.bad { color: var(--live); }
.strip { position: relative; display: flex; height: 26px; margin: 18px 0 6px; border: var(--line); border-radius: 6px; overflow: visible; }
.strip span { height: 100%; border-right: 1px solid rgba(30, 42, 36, 0.35); }
.strip span:last-of-type { border-right: 0; }
.strip span.win { outline: 3px solid var(--pink-ink); outline-offset: -3px; }
.strip-mark { position: absolute; top: -12px; width: 0; height: 0; transform: translateX(-50%);
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 12px solid var(--ink); }
.strip-caption { font-size: 15px; }

@media (max-width: 1120px) {
  .stage { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; grid-template-areas: "tape" "wheel" "people"; }
}
