.wheel-body .site-layout { display:block; min-width:0; }
.wheel-page { max-width: 1180px; margin: 12px auto 48px; }
.wheel-heading { display:flex; justify-content:space-between; align-items:center; gap:24px; margin-bottom:28px; }
.wheel-page h1 { font-size:clamp(28px,4vw,44px); margin:8px 0 12px; letter-spacing:-.04em; }
.wheel-heading p,.wheel-muted,.wheel-rules p,.wheel-card small { color:var(--text-muted); }
.wheel-layout { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(280px,1fr); gap:24px; align-items:start; }
.wheel-card { background:var(--surface); border:1px solid var(--border); border-radius:22px; padding:26px; }
.wheel-stats { display:flex; justify-content:space-between; gap:18px; }
.wheel-stats>div { display:grid; gap:7px; }.wheel-stats>div:last-child{text-align:right;}
.wheel-stats strong { font-size:30px; font-variant-numeric:tabular-nums; }.wheel-stats span { color:var(--text-muted);font-size:13px; }
.wheel-frame { position:relative; width:min(100%,420px); margin:32px auto 18px; }
#wheel-canvas { display:block; width:100%; aspect-ratio:1; border-radius:50%; box-shadow:0 0 0 8px var(--surface),0 0 0 10px var(--border),0 16px 38px #0002; }
.wheel-pointer { position:absolute; z-index:2; top:-13px; left:calc(50% - 13px); width:0; height:0; border-left:13px solid transparent; border-right:13px solid transparent; border-top:29px solid var(--text); filter:drop-shadow(0 3px 2px #0004); }
.wheel-center { position:absolute; inset:36%; border-radius:50%; background:var(--surface); display:flex;flex-direction:column;align-items:center;justify-content:center; box-shadow:0 3px 24px #0002; pointer-events:none; }
.wheel-center span{font-size:10px;letter-spacing:.14em;color:var(--text-muted)}.wheel-center strong{font-size:28px;}
.wheel-result{min-height:24px;text-align:center;font-weight:650;}.wheel-purchase{border-top:1px solid var(--border);padding-top:22px;display:grid;gap:14px;}
.wheel-buy-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}.wheel-stepper{display:flex;border:1px solid var(--border);border-radius:12px;overflow:hidden;height:44px;}
.wheel-stepper button{width:36px;border:0;background:var(--surface);color:var(--text);font-size:22px;cursor:pointer;}.wheel-stepper input{width:54px;border:0;background:var(--surface);color:var(--text);text-align:center;appearance:textfield;}.wheel-stepper input::-webkit-inner-spin-button{appearance:none;}
.wheel-primary{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 18px;background:var(--accent);color:white;border:0;border-radius:12px;font:inherit;font-weight:650;text-decoration:none;cursor:pointer;}.wheel-primary:disabled{opacity:.5;cursor:default;}
.wheel-side{display:grid;gap:20px;}.wheel-card h2,.wheel-rules h2{font-size:19px;margin:0;}.free-ticket{background:linear-gradient(135deg,var(--accent-soft),var(--surface));}.ticket-icon{font-size:32px;display:block;margin-bottom:14px;}.free-ticket p{line-height:1.6;}.free-ticket small{display:block;margin-top:12px;}
.participants-title{display:flex;justify-content:space-between;align-items:center;}.participants-title>span{padding:4px 10px;border-radius:8px;background:var(--accent-soft);}.wheel-participants{list-style:none;margin:0;padding:0;max-height:420px;overflow:auto;}.wheel-participants li{display:grid;grid-template-columns:12px minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:14px 0;border-bottom:1px solid var(--border);font-size:13px;}.wheel-participants .dot{width:10px;height:10px;border-radius:50%;}.wheel-participants .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.wheel-participants .chance{min-width:52px;text-align:right;font-weight:650;}.wheel-rules{padding:8px 10px;font-size:13px;line-height:1.65;}#empty{color:var(--text-muted);line-height:1.6;font-size:14px;}#wheel-message{position:sticky;bottom:16px;background:var(--surface);border-radius:12px;box-shadow:0 4px 25px #0002;}#wheel-message:not(:empty){padding:16px;border:1px solid var(--border);}.wheel-admin{max-width:600px;display:grid;gap:20px;}.wheel-admin label{display:grid;gap:8px;}.wheel-admin input{padding:12px;border:1px solid var(--border);border-radius:8px;color:var(--text);background:var(--surface);font:inherit;}
@media(max-width:850px){.wheel-layout{grid-template-columns:1fr;}.wheel-heading{align-items:start;flex-direction:column;}.wheel-card{padding:20px;}.wheel-stats strong{font-size:25px;}}
@media(max-width:700px){.wheel-body .wheel-center strong{font-size:22px;}.wheel-body .wheel-stats strong{font-size:23px;}}

/* Единые, отчётливо обозначенные поля настроек игр. */
body form:is(.wheel-admin, .loot-admin) label { font-weight: 600; line-height: 1.5; min-width: 0; }
body form:is(.wheel-admin, .loot-admin) :is(input:not([type=hidden]):not([type=checkbox]):not([type=file]), select) {
  width: 100%; min-width: 0; min-height: 46px; padding: 11px 14px;
  /* Приоритет над глобальным сбросом рамок input в base.css. */
  border: 1px solid var(--border) !important;
  border-radius: .75rem; background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; font-variant-numeric: tabular-nums;
}
body form:is(.wheel-admin, .loot-admin) :is(input:not([type=hidden]):not([type=checkbox]):not([type=file]), select):hover {
  border-color: var(--text-muted) !important;
  background: var(--surface-hover);
}
body form:is(.wheel-admin, .loot-admin) :is(input:not([type=hidden]):not([type=checkbox]):not([type=file]), select):focus {
  border-color: var(--accent) !important;
  outline: 2px solid var(--accent) !important; outline-offset: 2px !important;
  background: var(--surface);
}

/* Одна аккуратная карточка, подписи непосредственно над полями. */
form.game-settings { max-width: 640px; margin-top: 24px; display: grid; gap: 22px; padding: 28px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: 0 10px 30px var(--shadow); }
.game-settings .game-setting-field { display: grid; gap: 8px; }
body #demo-subscribers-count { background: var(--surface-hover); }
.game-settings .game-setting-field small { color: var(--text-muted); font-weight: 400; line-height: 1.5; }
.game-settings-note { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.65; }
.game-settings-footer { display: flex; justify-content: flex-start; }

@media(max-width:600px) {
  form.game-settings { padding: 20px 16px; border-radius: 18px; }
  .game-settings-footer .wheel-primary { width: 100%; }
}

/* У разделов настроек нет стандартной прямоугольной рамки fieldset. */
.wheel-admin fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}
.wheel-admin fieldset legend { padding: 0; margin-bottom: 12px; }
.wheel-admin .game-settings-fields { display: grid; gap: 18px; }
.wheel-admin .game-settings-checklist {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 18px;
}
body form.game-settings .game-settings-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  cursor: pointer;
}
body form.game-settings .game-settings-checkbox input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  padding: 0;
  flex: 0 0 18px;
  accent-color: var(--accent);
}
body form.game-settings .game-settings-checkbox span { min-width: 0; }
.wheel-page .loot-admin-nav { display:flex; flex-wrap:wrap; gap:8px; margin:20px 0; }
.wheel-page .demo-admin-capper { display:inline-flex; overflow:hidden; border:1px solid var(--border); border-radius:10px; }
.wheel-page .demo-admin-capper:has(a[aria-current='page']) { border-color:var(--accent); }
.wheel-page .loot-admin-nav a { padding:8px 12px; color:var(--text); text-decoration:none; }
.wheel-page .loot-admin-nav a[aria-current='page'] { border-color:var(--accent); background:var(--accent-soft); color:var(--accent); }
.wheel-page .loot-admin-nav .demo-admin-profile-link { border-left:1px solid var(--border); color:var(--text-muted); font-size:12px; }
.wheel-page .loot-admin-nav .demo-admin-profile-link:hover { background:var(--surface-hover); color:var(--accent); }
.purchase-admin-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; }
.purchase-admin-heading h1 { margin-bottom:6px; }
.purchase-admin-heading p { margin-bottom:0; }
.purchase-admin-filters { display:flex; flex-wrap:wrap; gap:8px; margin:24px 0 16px; }
.purchase-admin-filters a { padding:9px 13px; border:1px solid var(--border); border-radius:10px; color:var(--text-muted); }
.purchase-admin-filters a[aria-current='page'] { border-color:var(--accent); background:var(--accent-soft); color:var(--accent); }
.purchase-admin-sort { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin:-4px 0 14px; color:var(--text-muted); font-size:13px; }
.purchase-admin-sort span { margin-right:3px; font-weight:650; }
.purchase-admin-sort a { padding:7px 10px; border:1px solid var(--border); border-radius:9px; color:var(--text-muted); white-space:nowrap; }
.purchase-admin-sort a[aria-current='page'] { border-color:var(--accent); background:var(--accent-soft); color:var(--accent); }
.purchase-admin-filter-form { display:grid; grid-template-columns:minmax(130px,.9fr) minmax(130px,.9fr) minmax(105px,.72fr) minmax(105px,.72fr) auto; align-items:end; gap:10px; margin-bottom:18px; padding:16px; border:1px solid var(--border); border-radius:16px; background:var(--surface); }
.purchase-admin-filter-form label { display:grid; gap:7px; color:var(--text-muted); font-size:12px; font-weight:650; }
.purchase-admin-filter-form :is(input,select) { width:100%; min-width:0; min-height:42px; padding:9px 11px; border:1px solid var(--border); border-radius:9px; background:var(--surface-hover); color:var(--text); font:inherit; font-variant-numeric:tabular-nums; }
.purchase-admin-filter-form :is(input,select):focus { border-color:var(--accent); outline:2px solid color-mix(in srgb,var(--accent) 30%,transparent); }
.purchase-admin-filter-actions { display:flex; gap:7px; }
.purchase-admin-filter-actions .button { min-width:0; padding:10px 13px; font-size:13px; white-space:nowrap; }
.purchase-admin-filter-error { margin:0 0 18px; padding:10px 12px; border:1px solid var(--danger); border-radius:10px; background:var(--danger-soft); color:var(--danger); font-size:13px; }
.purchase-admin-stats { display:grid; grid-template-columns:repeat(2,minmax(0,220px)); gap:14px; margin-bottom:20px; }
.purchase-admin-stats .wheel-card { display:grid; gap:5px; padding:18px 20px; }
.purchase-admin-stats span,.purchase-admin-row span,.purchase-admin-row small { color:var(--text-muted); font-size:12px; }
.purchase-admin-stats strong { font-size:24px; font-variant-numeric:tabular-nums; }
.purchase-admin-history { margin-top:24px; }
.purchase-admin-list { display:grid; margin-top:14px; }
.purchase-admin-row { display:grid; grid-template-columns:minmax(220px,2fr) minmax(140px,1fr) minmax(140px,1fr) auto; align-items:center; gap:18px; padding:16px 0; border-bottom:1px solid var(--border); }
.purchase-admin-row:last-child { border-bottom:0; }
.purchase-admin-row>div { display:grid; min-width:0; gap:4px; }
.purchase-admin-row a { min-width:0; overflow:hidden; color:var(--text); text-overflow:ellipsis; white-space:nowrap; }
.purchase-admin-row a:hover { color:var(--accent); }
.purchase-admin-row .purchase-admin-kind { width:fit-content; padding:3px 7px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-size:10px; font-weight:750; }
.purchase-admin-amount { justify-items:end; text-align:right; }
.purchase-admin-amount strong { font-variant-numeric:tabular-nums; white-space:nowrap; }
.purchase-admin-row-compact { grid-template-columns:minmax(220px,2fr) minmax(140px,1fr) auto; }
.demo-purchase-history { max-width:900px; }
.purchase-admin-pagination { display:flex; align-items:center; justify-content:center; gap:18px; margin-top:20px; color:var(--text-muted); font-size:13px; }
.purchase-admin-pagination a { color:var(--accent); font-weight:700; }
@media(max-width:760px) {
  .purchase-admin-heading { align-items:flex-start; flex-direction:column; }
  .purchase-admin-stats { grid-template-columns:1fr 1fr; }
  .purchase-admin-row,.purchase-admin-row-compact { grid-template-columns:1fr auto; }
  .purchase-admin-row>div:first-child { grid-column:1/-1; }
  .purchase-admin-filter-form { grid-template-columns:1fr 1fr; }
  .purchase-admin-filter-actions { grid-column:1/-1; }
}
@media(max-width:480px) { .purchase-admin-filter-form { grid-template-columns:1fr; } .purchase-admin-filter-actions { grid-column:auto; } }
.free-import-form { max-width:760px; }
.free-import-form textarea { width:100%; min-width:0; padding:11px 14px; border:1px solid var(--border); border-radius:.75rem; background:var(--surface); color:var(--text); font:inherit; line-height:1.5; resize:vertical; }
.free-import-form textarea:focus { border-color:var(--accent); outline:2px solid var(--accent); outline-offset:2px; }
body #free-import-settings input { background: var(--surface-hover); }
.free-import-actions { gap:10px; flex-wrap:wrap; }
.free-import-status { max-width:760px; display:flex; flex-wrap:wrap; gap:24px; margin-top:20px; }
.free-import-status>div { display:grid; gap:5px; }
.free-import-status span { color:var(--text-muted); font-size:12px; }
.free-import-status p { flex-basis:100%; margin:0; color:var(--danger); }
.free-import-errors { max-width:760px; margin-top:20px; }
.free-import-errors h2 { margin:0; font-size:18px; }
.free-import-errors-list { display:grid; gap:12px; margin-top:16px; }
.free-import-errors-list article { display:grid; gap:5px; padding:12px; border:1px solid color-mix(in srgb,var(--danger) 35%,var(--border)); border-radius:10px; background:var(--surface-hover); }
.free-import-errors-list strong { font-size:13px; }
.free-import-errors-list a { overflow:hidden; color:var(--accent); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.free-import-errors-list code { overflow-wrap:anywhere; color:var(--danger); font-size:12px; white-space:pre-wrap; }

.wheel-modes { display:flex; flex-wrap:wrap; gap:10px; margin:0 0 22px; }
.wheel-modes a { padding:12px 18px; border:1px solid var(--border); border-radius:12px; color:var(--text); text-decoration:none; }
.wheel-modes a[aria-current='page'] { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); font-weight:650; }

.wheel-wallet { display:grid; gap:12px; margin:20px 0; }
.wheel-wallet>div { display:flex; justify-content:space-between; align-items:baseline; gap:12px; flex-wrap:wrap; }
.wheel-wallet dt { color:var(--text-muted); font-size:13px; }
.wheel-wallet dd { margin:0; font-size:20px; font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.wheel-participants .name { display:flex; align-items:center; gap:6px; }
.wheel-participants .name-text { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.game-player-link { color:inherit; text-decoration:underline; text-decoration-color:var(--border); text-underline-offset:3px; }
.game-player-link:hover { color:var(--accent); text-decoration-color:currentColor; }
.game-player-link:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:3px; }
.wheel-auto-note { margin-bottom:0; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.wheel-stats { flex-wrap:wrap; }
.level-ticket-controls { display: grid; gap: .7rem; }
.level-ticket-controls input { width: 100%; padding: .75rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--surface-hover); color: var(--text); font: inherit; }
.level-ticket-controls input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#level-tickets[hidden] { display: none; }
[data-mode=bonus][hidden], [data-level-ticket-status][hidden] { display: none; }

#demo-subscriptions { margin-top: 24px; scroll-margin-top: 110px; }
#demo-subscriptions form.game-settings { max-width: none; box-shadow: none; }
#demo-subscriptions .game-settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#demo-subscriptions .game-settings-footer { flex-wrap: wrap; align-items: center; gap: 16px; }
body #demo-subscriptions form.game-settings :is(input:not([type='hidden']):not([type='checkbox']):not([type='radio']), select, textarea) {
  width: 100%; min-width: 0; min-height: 46px; padding: 11px 14px;
  border: 1px solid var(--text-muted) !important; border-radius: .75rem;
  background: var(--surface-hover); color: var(--text); font: inherit;
}
body #demo-subscriptions form.game-settings :is(input, select, textarea):focus {
  border-color: var(--accent) !important; outline: 2px solid var(--accent) !important; outline-offset: 2px;
  background: var(--surface-hover);
}
#demo-subscriptions textarea { resize: vertical; }
@media(max-width:620px) { #demo-subscriptions .game-settings-fields { grid-template-columns: 1fr; } }
#demo-subscriptions .game-settings > .wheel-primary { justify-self: start; }
#demo-subscriptions fieldset > .game-settings-fields { margin-top: 18px; }

#demo-subscriptions .subscription-notice { padding: 14px 18px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
#demo-subscriptions .subscription_error { border-color: var(--danger); background: var(--danger-soft); }

/* Shared phone sizing for wheel, auction, crash and their management forms. */
@media (max-width: 767px) {
  .wheel-page { margin: 0 auto 24px; }
  .wheel-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .wheel-card { padding: 20px; min-width: 0; }
  .wheel-heading { align-items: flex-start; flex-wrap: wrap; gap: 16px; }
  .wheel-frame { width: min(calc(100% - 20px), 420px); }
  .wheel-stats > div { min-width: 0; }
  .wheel-stats strong { font-size: clamp(20px, 5vw, 28px); overflow-wrap: anywhere; }
  .wheel-center strong { font-size: clamp(16px, 4vw, 24px); }
  .wheel-center span { font-size: 9px; letter-spacing: .04em; }
  .wheel-stepper button { width: 44px; min-height: 44px; }
  .wheel-buy-row > .wheel-primary { flex: 1 1 180px; }
  .wheel-participants li { gap: 8px; grid-template-columns: 10px minmax(0, 1fr) auto; }
  .wheel-participants .chance { grid-column: 3; }
  #wheel-message { bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .wheel-card { padding: 16px; }
  .wheel-heading > .button { width: 100%; }
}
