:root {
  --bg: #08070a;
  --bg-soft: #0e0b10;
  --panel: rgba(21, 16, 20, 0.92);
  --panel-strong: #191217;
  --line: rgba(255, 96, 112, 0.14);
  --line-strong: rgba(255, 96, 112, 0.28);
  --text: #f6eef0;
  --muted: #b39aa1;
  --dim: #856a71;
  --accent: #ff2e4d;
  --accent-strong: #ff5c72;
  --accent-soft: rgba(255, 46, 77, 0.16);
  --success: #43e0a0;
  --danger: #ff8a5c;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 18% -10%, rgba(255, 46, 77, 0.22), transparent 62%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 120, 70, 0.12), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(255, 46, 77, 0.42);
  color: #fff;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #6f1322 #0e0b10;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #0e0b10;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid #0e0b10;
  border-radius: 999px;
  background: #6f1322;
}

*::-webkit-scrollbar-thumb:hover {
  background: #b31c34;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 18px clamp(14px, 3vw, 28px) 20px;
  gap: 16px;
}

/* ------------------------------------------------------------- стартовый экран */

.landing {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: clamp(22px, 4vw, 40px);
  width: min(100%, 980px);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 52px) 4px;
}

.landing-hero {
  max-width: 640px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c9c0ff;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px rgba(61, 220, 151, 0.8);
}

.landing-hero h1 {
  margin: 14px 0 0;
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.landing-hero h1 span {
  background: linear-gradient(100deg, #c9c0ff, #8e79ff 45%, #66d9ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-hero p {
  max-width: 520px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.mode-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    radial-gradient(320px 180px at 8% 0%, rgba(255, 46, 77, 0.2), transparent 70%),
    linear-gradient(180deg, rgba(31, 28, 54, 0.88), rgba(15, 18, 26, 0.96)),
    var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.mode-card--games {
  background:
    radial-gradient(320px 180px at 8% 0%, rgba(48, 170, 255, 0.18), transparent 70%),
    linear-gradient(180deg, rgba(24, 35, 54, 0.88), rgba(15, 18, 26, 0.96)),
    var(--panel);
}

.mode-card--profile {
  background:
    radial-gradient(320px 180px at 8% 0%, rgba(61, 220, 151, 0.15), transparent 70%),
    linear-gradient(180deg, rgba(24, 43, 40, 0.88), rgba(15, 18, 26, 0.96)),
    var(--panel);
}

.mode-card--profile:hover {
  border-color: rgba(61, 220, 151, 0.45);
}

.mode-card--profile .mode-icon {
  border-color: rgba(61, 220, 151, 0.35);
  background: rgba(61, 220, 151, 0.12);
  color: #bfffe4;
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 46, 77, 0.5);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.52);
}

.mode-card--games:hover {
  border-color: rgba(88, 176, 255, 0.5);
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 46, 77, 0.35);
  border-radius: 17px;
  background: rgba(255, 46, 77, 0.16);
  color: #d7cfff;
}

.mode-card--games .mode-icon {
  border-color: rgba(88, 176, 255, 0.35);
  background: rgba(88, 176, 255, 0.14);
  color: #c4e6ff;
}

.mode-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mode-copy strong {
  font-size: 19px;
  letter-spacing: -0.01em;
}

.mode-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.mode-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 22px;
  transition: transform 0.16s ease, color 0.16s ease;
}

.mode-card:hover .mode-arrow {
  color: #fff;
  transform: translateX(4px);
}

.landing-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 11px;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(255, 46, 77, 0.35);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #d8d0ff;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px;
}

.activity-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-icon {
  border-radius: 11px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 8px 24px rgba(0, 0, 0, 0.35);
  object-fit: cover;
}

.activity-id-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.activity-id-copy strong {
  font-size: 15px;
  letter-spacing: 0.01em;
}

.activity-id-copy span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.status-pill.is-online {
  color: #c9ffe7;
  border-color: rgba(61, 220, 151, 0.28);
  background: rgba(61, 220, 151, 0.08);
}

.status-pill.is-online::before {
  background: var(--success);
  box-shadow: 0 0 12px rgba(61, 220, 151, 0.8);
}

.status-pill.is-error {
  color: #ffd2d9;
  border-color: rgba(255, 107, 129, 0.3);
  background: rgba(255, 107, 129, 0.08);
}

.status-pill.is-error::before {
  background: var(--danger);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  max-width: 190px;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.user-chip:hover {
  border-color: rgba(255, 46, 77, 0.5);
  background: rgba(255, 46, 77, 0.12);
}

.user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-strong);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.player-pane,
.side-pane {
  min-width: 0;
}

.player-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(620px 320px at 18% 8%, rgba(255, 46, 77, 0.24), transparent 68%),
    linear-gradient(180deg, rgba(35, 29, 64, 0.92), rgba(15, 18, 26, 0.96) 52%),
    var(--panel);
  box-shadow: var(--shadow);
}

.player-pane::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 26%);
}

.pane-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 6px;
}

.back-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.back-mark:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.pane-title {
  min-width: 0;
}

.pane-title h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane-title p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-dot {
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03);
}

.live-dot.is-live {
  background: var(--success);
  box-shadow: 0 0 16px rgba(61, 220, 151, 0.85);
}

.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 16px 24px 22px;
  text-align: center;
}

.cover {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(150px, 28vw, 208px);
  aspect-ratio: 1;
  margin: 8px 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 46, 77, 0.22), rgba(17, 20, 30, 0.8) 60%),
    var(--panel-strong);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42);
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.72);
}

.cover.is-empty {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 46, 77, 0.2), transparent 66%),
    var(--panel-strong);
}

.track-copy {
  max-width: 440px;
}

.track-copy h2 {
  margin: 0;
  font-size: clamp(18px, 2.3vw, 22px);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.track-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: min(100%, 560px);
  margin-top: 16px;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: rgba(8, 10, 16, 0.55);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search input::placeholder {
  color: var(--dim);
}

.search input:focus,
.search-source:focus {
  border-color: rgba(255, 46, 77, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 46, 77, 0.18);
}

.search-source {
  height: 42px;
  max-width: 132px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: rgba(8, 10, 16, 0.55);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.search-results {
  width: min(100%, 520px);
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(10, 12, 19, 0.78);
  text-align: left;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.search-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.search-results-head strong {
  display: block;
  font-size: 12px;
}

.search-results-head small {
  color: var(--dim);
  font-size: 10px;
}

.icon-btn--sm {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
}

.search-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.search-result:hover {
  background: rgba(255, 255, 255, 0.06);
}

.search-result img,
.search-result-thumb {
  display: grid;
  place-items: center;
  width: 42px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel-strong);
  color: var(--dim);
  font-size: 12px;
}

.search-result-copy {
  flex: 1;
  min-width: 0;
}

.search-result-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 550;
}

.search-result-copy small {
  color: var(--dim);
  font-size: 10px;
}

.search-result-play {
  flex: 0 0 auto;
  color: #ffc2cb;
  font-size: 15px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #fff;
  box-shadow: 0 8px 22px rgba(255, 46, 77, 0.32);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #a18aff, #8466ff);
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-find {
  margin-top: 18px;
  height: 44px;
  padding: 0 22px;
}

.progress-wrap {
  width: min(100%, 430px);
  margin-top: 22px;
}

progress {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  appearance: none;
}

progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ff8093);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ff8093);
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.icon-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.icon-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.icon-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.play-btn {
  width: 54px;
  height: 54px;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  box-shadow: 0 10px 26px rgba(255, 46, 77, 0.42);
}

.play-btn:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(180deg, #a18aff, #8466ff);
}

.icon-play {
  margin-left: 3px;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 300px);
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.volume-row svg {
  flex: 0 0 auto;
  opacity: 0.8;
}

.volume-row input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}

.volume-row input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#volume-label {
  width: 40px;
  text-align: right;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.hint {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 22px 4px;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

.beta {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  text-align: center;
}

.side-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.tab {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tab.is-active {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.card-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.text-btn:hover:not(:disabled) {
  color: var(--text);
}

.text-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.setting-row:last-of-type {
  border-bottom: 0;
}

.setting-btn {
  min-width: 76px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.setting-btn.is-active {
  border-color: rgba(255, 46, 77, 0.46);
  background: var(--accent-soft);
  color: #e4ddff;
}

.setting-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.setting-btn--wide {
  width: 100%;
  margin-top: 9px;
}

.mini-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-chart li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.mini-chart .chart-rank {
  width: 16px;
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 10px;
  text-align: right;
}

.mini-chart .chart-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-chart .chart-count {
  color: var(--dim);
  font-size: 10px;
}

.compact-list {
  gap: 6px;
}

.compact-list .person {
  font-size: 11px;
}

.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}

.card h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

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

.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

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

.person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.person img {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-strong);
}

.person span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.person small {
  margin-left: auto;
  color: var(--dim);
  font-size: 10px;
}

.empty {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.chip {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.chip.is-active {
  border-color: rgba(255, 46, 77, 0.42);
  background: var(--accent-soft);
  color: #dcd5ff;
}

.chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.queue-card {
  flex: 1;
}

.queue {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: queue;
}

.queue li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  counter-increment: queue;
}

.queue li::before {
  content: counter(queue);
  width: 18px;
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.queue-copy {
  min-width: 0;
  flex: 1;
}

.queue-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}

.queue-copy small {
  color: var(--dim);
  font-size: 10px;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.queue-action {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.queue-action:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.history-list li::before {
  content: "♪";
  color: rgba(255, 46, 77, 0.7);
}

.history-list .queue-copy strong {
  color: var(--muted);
}

/* -------------------------------------------------------------------- игры */

.games-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 4px 2px 10px;
}

.games-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.games-heading {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.games-heading h1 {
  margin: 0;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.back-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

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

.games-hub-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.games-hub-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.session-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(61, 220, 151, 0.1), transparent 70%),
    var(--panel);
}

.session-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.session-head h2 {
  margin: 5px 0 0;
  font-size: 16px;
  font-weight: 650;
}

.session-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.session-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.session-item.is-you {
  background: rgba(255, 46, 77, 0.12);
}

.session-item.is-mvp {
  box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.28);
}

.session-rank {
  width: 18px;
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.session-item img,
.session-avatar {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-strong);
}

.session-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.session-mvp {
  color: #bfffe4;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.session-points {
  color: #d9d2ff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.session-wins {
  color: var(--dim);
  font-size: 10px;
  white-space: nowrap;
}

.game-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.game-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(320px 160px at 0% 0%, rgba(255, 46, 77, 0.1), transparent 75%),
    var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.game-pick:hover {
  border-color: rgba(255, 46, 77, 0.48);
  background:
    radial-gradient(320px 160px at 0% 0%, rgba(255, 46, 77, 0.2), transparent 75%),
    rgba(19, 22, 32, 0.98);
  transform: translateY(-1px);
}

.game-pick-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  color: #d9d2ff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.game-pick-icon.is-xo {
  color: #ffc2cb;
  letter-spacing: -0.08em;
}

.game-pick-icon.is-quiz {
  color: #ffd88a;
}

.game-pick-icon.is-quizboard {
  color: #8fd7ff;
  font-size: 23px;
}

.game-pick-icon.is-horserace {
  color: #ffd166;
  font-size: 23px;
}

.game-pick-icon.is-rps {
  font-size: 22px;
}

.game-pick-icon.is-hangman {
  color: #7ee7c0;
}

.game-pick-icon.is-roulette {
  color: #ff8f9e;
  font-size: 24px;
}

.game-pick-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.game-pick-copy strong {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  white-space: normal;
}

.game-pick-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.games-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.games-stage-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.games-stage-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-panel {
  width: min(100%, 760px);
  margin: 0 auto;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(420px 220px at 12% 0%, rgba(255, 46, 77, 0.12), transparent 72%),
    var(--panel);
  box-shadow: var(--shadow);
}

.game-card:nth-child(2) {
  background:
    radial-gradient(420px 220px at 12% 0%, rgba(48, 170, 255, 0.12), transparent 72%),
    var(--panel);
}

.game-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.game-card-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.game-card-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.game-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.game-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.segmented-btn {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.segmented-btn:hover {
  color: var(--text);
}

.segmented-btn.is-active {
  background: rgba(255, 46, 77, 0.22);
  color: #e7e1ff;
  box-shadow: inset 0 0 0 1px rgba(255, 46, 77, 0.28);
}

.game-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(61, 220, 151, 0.75);
}

.online-players {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 8px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
}

.player-chip.is-active {
  border-color: rgba(255, 46, 77, 0.42);
  background: rgba(255, 46, 77, 0.1);
  color: var(--text);
}

.player-chip.is-you {
  box-shadow: inset 0 0 0 1px rgba(126, 231, 192, 0.22);
}

.player-chip.is-spectator {
  opacity: 0.62;
}

.player-chip img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.player-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-mark {
  color: #ffc2cb;
  font-size: 13px;
  font-weight: 700;
}

.player-score {
  min-width: 16px;
  padding: 0 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.btn-sm {
  height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12px;
}

.games-subtitle {
  margin: 4px 2px -4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rps {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.rps-status,
.hangman-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.rps-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.rps-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 86px;
  padding: 10px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(8, 10, 16, 0.5);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.rps-choice:hover:not(:disabled) {
  border-color: rgba(255, 46, 77, 0.55);
  background: rgba(255, 46, 77, 0.12);
  transform: translateY(-1px);
}

.rps-choice:disabled {
  cursor: default;
}

.rps-choice:disabled:not(.is-selected, .is-winner) {
  opacity: 0.55;
}

.rps-choice.is-selected {
  border-color: rgba(255, 46, 77, 0.7);
  background: rgba(255, 46, 77, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 46, 77, 0.18);
}

.rps-choice.is-winner {
  border-color: rgba(61, 220, 151, 0.6);
  background: rgba(61, 220, 151, 0.12);
  box-shadow: 0 0 22px rgba(61, 220, 151, 0.16);
}

.rps-icon {
  font-size: 26px;
  line-height: 1;
}

.hangman {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

.hangman-word {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
}

.hangman-letter {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 38px;
  padding: 0 5px;
  border-bottom: 2px solid var(--line-strong);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hangman-letter.is-revealed {
  border-color: rgba(255, 46, 77, 0.6);
  color: #e7e1ff;
}

.hangman-letters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  gap: 4px;
}

.hangman-letter-btn {
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.hangman-letter-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.hangman-letter-btn:disabled {
  cursor: default;
}

.hangman-letter-btn.is-correct {
  border-color: rgba(61, 220, 151, 0.45);
  background: rgba(61, 220, 151, 0.1);
  color: #b9f3d9;
  opacity: 1;
}

.hangman-letter-btn.is-wrong {
  border-color: rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.08);
  color: #ffb3be;
  opacity: 0.6;
  text-decoration: line-through;
}

.roulette {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.roulette-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.roulette-result-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.roulette-result-label {
  max-width: 58px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.25;
  text-transform: uppercase;
}

.roulette-result {
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.14), transparent 58%),
    rgba(8, 10, 16, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 8px 20px rgba(0, 0, 0, 0.26);
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.roulette-result.is-red {
  border-color: rgba(255, 107, 129, 0.65);
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.16), transparent 58%),
    rgba(201, 46, 70, 0.46);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 26px rgba(220, 60, 85, 0.22);
}

.roulette-result.is-black {
  border-color: rgba(170, 180, 205, 0.5);
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.12), transparent 58%),
    rgba(8, 10, 16, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 24px rgba(0, 0, 0, 0.35);
}

.roulette-result.is-green {
  border-color: rgba(61, 220, 151, 0.62);
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.15), transparent 58%),
    rgba(25, 142, 84, 0.56);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 26px rgba(61, 220, 151, 0.24);
}

.roulette-result.is-pop {
  animation: roulette-pop 0.42s ease-out;
}

@keyframes roulette-pop {
  0% {
    transform: scale(0.78) rotate(-8deg);
  }
  65% {
    transform: scale(1.06) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.roulette-status {
  flex: 1;
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.roulette-table-shell {
  position: relative;
  padding: 9px;
  border: 1px solid rgba(198, 154, 72, 0.48);
  border-radius: 22px;
  background:
    linear-gradient(145deg, #4a2f1b 0%, #25170e 42%, #352215 65%, #180f09 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 166, 0.18),
    inset 0 -3px 7px rgba(0, 0, 0, 0.5),
    0 20px 38px rgba(0, 0, 0, 0.32);
}

.roulette-table {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 6px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 226, 168, 0.2);
  border-radius: 15px;
  background:
    radial-gradient(120% 120% at 50% -20%, rgba(67, 204, 137, 0.2), transparent 55%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.012) 0 2px,
      transparent 2px 4px
    ),
    linear-gradient(180deg, #116744 0%, #0b5538 48%, #073c28 100%);
  box-shadow:
    inset 0 0 40px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.roulette-zero,
.roulette-number,
.roulette-outside-bet {
  position: relative;
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.14s ease,
    filter 0.14s ease,
    box-shadow 0.14s ease,
    transform 0.14s ease;
}

.roulette-zero {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 11px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.18), transparent 50%),
    linear-gradient(180deg, #1aa06a 0%, #087447 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.roulette-zero-number {
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.roulette-zero-caption {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  opacity: 0.78;
}

.roulette-numbers {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(38px, 1fr));
  gap: 4px;
}

.roulette-number {
  position: relative;
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  font-size: clamp(11px, 1.35vw, 14px);
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  grid-column: var(--col-wide);
  grid-row: var(--row-wide);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.roulette-color-mark {
  position: absolute;
  top: 2px;
  right: 3px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 6px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.roulette-history-empty {
  color: var(--dim);
  font-size: 10px;
}

.roulette-number.is-red {
  background: linear-gradient(180deg, #bb3746 0%, #7d1f2c 100%);
}

.roulette-number.is-black {
  background: linear-gradient(180deg, #292d37 0%, #0c0f14 100%);
}

.roulette-zero:hover:not(:disabled),
.roulette-number:hover:not(:disabled),
.roulette-outside-bet:hover:not(:disabled) {
  filter: brightness(1.16);
  transform: translateY(-1px);
}

.roulette-zero:disabled,
.roulette-number:disabled,
.roulette-outside-bet:disabled {
  cursor: default;
}

.roulette-zero.is-selected,
.roulette-number.is-selected,
.roulette-outside-bet.is-selected {
  z-index: 2;
  border-color: rgba(255, 226, 138, 0.95);
  box-shadow:
    0 0 0 2px rgba(255, 205, 87, 0.36),
    0 0 18px rgba(255, 190, 60, 0.24);
}

.roulette-zero.is-selected::after,
.roulette-number.is-selected::after,
.roulette-outside-bet.is-selected::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #fff6c6,
    #ffc94b 38%,
    #b87308 72%,
    #f5d37c
  );
  box-shadow:
    0 0 0 1px rgba(53, 30, 0, 0.7),
    0 2px 5px rgba(0, 0, 0, 0.45);
}

.roulette-zero.is-winning::before,
.roulette-number.is-winning::before,
.roulette-outside-bet.is-winning::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 30%,
    #ffffff,
    #eceff6 45%,
    #a9b0c0
  );
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.55),
    0 0 8px rgba(255, 255, 255, 0.55);
  animation: roulette-ball-drop 0.35s ease-out;
}

.roulette-zero.is-winning,
.roulette-number.is-winning,
.roulette-outside-bet.is-winning {
  border-color: rgba(255, 236, 169, 0.9);
  animation: roulette-win-pulse 0.55s ease-out;
}

.roulette-outside {
  display: grid;
  grid-column: 2;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.roulette-outside--even {
  grid-row: 2;
}

.roulette-outside--dozens {
  grid-row: 3;
}

.roulette-outside-bet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.roulette-outside-bet span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roulette-outside-bet.is-red {
  background: linear-gradient(180deg, #b73543 0%, #7e1f2b 100%);
}

.roulette-outside-bet.is-black {
  background: linear-gradient(180deg, #242832 0%, #0d0f14 100%);
}

.roulette-odds {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

.roulette-table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -3px 2px 0;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.35;
}

.roulette-table-meta span:last-child {
  color: #e8d7a7;
  font-weight: 650;
  text-align: right;
}

.roulette-history-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 24px;
  margin: -2px 2px 0;
}

.roulette-history-label {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.roulette-history {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.roulette-history-item {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.roulette-history-item.is-red {
  background: linear-gradient(180deg, #b73543 0%, #7e1f2b 100%);
}

.roulette-history-item.is-black {
  background: linear-gradient(180deg, #242832 0%, #0d0f14 100%);
}

.roulette-history-item.is-green {
  background: linear-gradient(180deg, #1aa06a 0%, #087447 100%);
}

.roulette-bet-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.roulette-bet-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.roulette-amount-label {
  color: var(--dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.roulette-amount {
  width: 82px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.roulette-amount:disabled {
  opacity: 0.46;
}

.roulette-quick {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 6px;
}

.roulette-chip {
  min-width: 38px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.08), transparent 55%),
    rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.roulette-chip:hover:not(:disabled),
.roulette-chip.is-active {
  border-color: rgba(255, 205, 87, 0.5);
  background: rgba(255, 205, 87, 0.11);
  color: #ffe6a8;
}

.roulette-chip:disabled {
  cursor: default;
  opacity: 0.38;
}

.roulette-note {
  margin: -2px 0 0;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
}

@keyframes roulette-ball-drop {
  0% {
    opacity: 0;
    transform: scale(0.2) translateY(-8px);
  }
  70% {
    opacity: 1;
    transform: scale(1.2) translateY(1px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

@keyframes roulette-win-pulse {
  0% {
    filter: brightness(1.65);
  }
  100% {
    filter: brightness(1);
  }
}

@media (max-width: 620px) {
  .roulette-head {
    align-items: flex-start;
  }

  .roulette-table-shell {
    padding: 7px;
    border-radius: 18px;
  }

  .roulette-table {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    gap: 6px;
    padding: 8px;
  }

  .roulette-zero {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    gap: 8px;
    min-height: 40px;
  }

  .roulette-zero-number {
    font-size: 18px;
  }

  .roulette-numbers {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(6, 34px);
    gap: 4px;
  }

  .roulette-number {
    grid-column: var(--col-narrow);
    grid-row: var(--row-narrow);
    font-size: 12px;
  }

  .roulette-outside {
    grid-column: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .roulette-outside--even {
    grid-row: 3;
  }

  .roulette-outside--dozens {
    grid-row: 4;
  }

  .roulette-table-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .roulette-table-meta span:last-child {
    text-align: left;
  }

  .roulette-bet-panel {
    gap: 8px;
  }

  .roulette-quick {
    order: 3;
    flex-basis: 100%;
    justify-content: space-between;
  }

  .roulette-chip {
    flex: 1;
  }
}

.ttt {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ttt-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 278px);
  margin: 2px 0 4px;
}

.ttt-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.06), transparent 70%),
    rgba(8, 10, 16, 0.5);
  color: var(--text);
  font: inherit;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.ttt-cell:hover:not(:disabled) {
  border-color: rgba(255, 46, 77, 0.55);
  background: rgba(255, 46, 77, 0.12);
  transform: translateY(-1px);
}

.ttt-cell.is-x {
  color: #ffc2cb;
}

.ttt-cell.is-o {
  color: #7ee7c0;
}

.ttt-cell.is-win {
  border-color: rgba(61, 220, 151, 0.55);
  background: rgba(61, 220, 151, 0.12);
  box-shadow: 0 0 22px rgba(61, 220, 151, 0.16);
}

.ttt-cell:disabled {
  cursor: default;
}

.quizboard {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
}

.quizboard-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.quizboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.quizboard-category {
  display: grid;
  place-items: center;
  min-height: 32px;
  padding: 4px;
  border: 1px solid rgba(255, 46, 77, 0.3);
  border-radius: 8px;
  background: rgba(255, 46, 77, 0.14);
  color: #d9d2ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
}

.quizboard-cell {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: #ffd88a;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.quizboard-cell:hover:not(:disabled) {
  border-color: rgba(143, 215, 255, 0.55);
  background: rgba(143, 215, 255, 0.12);
  transform: translateY(-1px);
}

.quizboard-cell.is-used {
  color: var(--dim);
  background: rgba(255, 255, 255, 0.012);
  opacity: 0.55;
}

.quizboard-cell.is-selected {
  border-color: rgba(255, 216, 138, 0.72);
  background: rgba(255, 216, 138, 0.14);
  color: #ffe7ae;
  opacity: 1;
  box-shadow: 0 0 16px rgba(255, 216, 138, 0.12);
}

.quizboard-cell:disabled {
  cursor: default;
}

.quizboard-question {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(143, 215, 255, 0.28);
  border-radius: 13px;
  background:
    radial-gradient(300px 140px at 0% 0%, rgba(143, 215, 255, 0.08), transparent 75%),
    rgba(255, 255, 255, 0.025);
}

.quizboard-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #c9eaff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quizboard-question-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.quizboard-timer {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.horserace {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
}

.horserace-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.race-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 146px;
  gap: 16px;
  align-items: start;
}

.race-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.race-lane {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--lane-color, #ff2e4d);
  border-radius: 12px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--lane-color, #ff2e4d) 8%, transparent), transparent 55%),
    rgba(255, 255, 255, 0.025);
  transition: border-color 0.14s ease, background 0.14s ease;
}

.race-lane.is-you {
  border-color: rgba(255, 216, 138, 0.58);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--lane-color, #ff2e4d) 16%, transparent), transparent 62%),
    rgba(255, 216, 138, 0.045);
  box-shadow: 0 0 18px rgba(255, 216, 138, 0.07);
}

.race-lane.is-finished {
  border-color: rgba(61, 220, 151, 0.62);
}

.race-lane-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
}

.race-avatar {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  object-fit: cover;
}

.race-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-pos {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--dim);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.race-spin-chip {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid rgba(255, 216, 138, 0.3);
  border-radius: 999px;
  background: rgba(255, 216, 138, 0.1);
  color: #ffe7ae;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.race-spin-chip.is-pending {
  border-color: rgba(143, 215, 255, 0.35);
  background: rgba(143, 215, 255, 0.1);
  color: #c9eaff;
}

.race-road {
  position: relative;
  height: 24px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.07) 0 1px,
      transparent 1px 12px
    ),
    rgba(255, 255, 255, 0.025);
}

.race-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent,
    var(--lane-color, #ff2e4d)
  );
  opacity: 0.28;
  transition: width 0.6s cubic-bezier(0.22, 0.85, 0.3, 1);
}

.race-horse {
  position: absolute;
  top: 50%;
  z-index: 2;
  font-size: 17px;
  line-height: 1;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  transition: left 0.6s cubic-bezier(0.22, 0.85, 0.3, 1);
}

.race-finish {
  position: absolute;
  top: 50%;
  right: 4px;
  z-index: 1;
  font-size: 14px;
  line-height: 1;
  transform: translateY(-50%);
  opacity: 0.9;
}

.race-wheel-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 209, 102, 0.26);
  border-radius: 14px;
  background:
    radial-gradient(180px 120px at 50% 0%, rgba(255, 209, 102, 0.1), transparent 75%),
    rgba(255, 255, 255, 0.025);
}

.race-wheel-wrap {
  position: relative;
  width: 104px;
  height: 104px;
}

.race-wheel {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: conic-gradient(
    from -30deg,
    #ff6b6b 0 60deg,
    #ffd166 60deg 120deg,
    #3ddc97 120deg 180deg,
    #57c7ff 180deg 240deg,
    #c084fc 240deg 300deg,
    #ff9f5a 300deg 360deg
  );
  box-shadow:
    inset 0 0 0 5px rgba(8, 10, 16, 0.55),
    0 10px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.8s cubic-bezier(0.22, 0.85, 0.3, 1);
}

.race-wheel.is-spinning {
  filter: brightness(1.08);
}

.race-wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  border-top: 14px solid #ffe7ae;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
  transform: translateX(-50%);
}

.race-wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(8, 10, 16, 0.82);
  font-size: 20px;
  transform: translate(-50%, -50%);
}

.race-wheel-result {
  display: grid;
  min-height: 34px;
  place-items: center;
  color: #ffe7ae;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.race-wheel-hint {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}

.quiz {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
}

.quiz-question {
  min-height: 54px;
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-answer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.quiz-answer::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dim);
}

.quiz-answer:hover:not(:disabled) {
  border-color: rgba(255, 46, 77, 0.48);
  background: rgba(255, 46, 77, 0.1);
  transform: translateX(2px);
}

.quiz-answer.is-correct {
  border-color: rgba(61, 220, 151, 0.55);
  background: rgba(61, 220, 151, 0.12);
}

.quiz-answer.is-correct::before {
  background: var(--success);
  box-shadow: 0 0 10px rgba(61, 220, 151, 0.7);
}

.quiz-answer.is-wrong {
  border-color: rgba(255, 107, 129, 0.55);
  background: rgba(255, 107, 129, 0.12);
}

.quiz-answer.is-wrong::before {
  background: var(--danger);
}

.quiz-answer:disabled {
  cursor: default;
}

.quiz-answer:disabled:not(.is-correct, .is-wrong) {
  opacity: 0.55;
}

.game-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: auto;
}

.game-score,
.quiz-progress {
  color: var(--dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.games-note {
  margin: 0;
  color: var(--dim);
  font-size: 11px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  max-width: min(92vw, 460px);
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(18, 21, 30, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 12px;
  transform: translateX(-50%);
}

/* --------------------------------------------------------------- профиль */

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}

.profile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(10px);
}

.profile-card {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: min(92vh, 760px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--panel-strong);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.6);
  animation: profile-in 0.18s ease-out;
}

@keyframes profile-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(7, 9, 14, 0.58);
  color: #fff;
  font: inherit;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.profile-close:hover {
  background: rgba(7, 9, 14, 0.82);
}

.profile-banner {
  position: relative;
  display: grid;
  place-items: center;
  height: 172px;
  overflow: hidden;
  border-radius: 21px 21px 0 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.24), transparent 42%),
    linear-gradient(120deg, var(--profile-accent, #ff2e4d), #241318 62%, #0c0709);
}

.profile-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(10, 12, 18, 0.72));
  pointer-events: none;
}

.profile-banner-fallback {
  color: rgba(255, 255, 255, 0.82);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.profile-body {
  position: relative;
  padding: 0 20px 20px;
}

.profile-identity {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: -42px;
  position: relative;
  z-index: 2;
}

.profile-avatar {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  border: 4px solid var(--panel-strong);
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel);
}

.profile-identity-copy {
  min-width: 0;
  padding-bottom: 5px;
}

.profile-identity-copy h2 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-identity-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.profile-accent-dot {
  width: 12px;
  height: 12px;
  margin-left: auto;
  margin-bottom: 12px;
  border: 2px solid var(--panel-strong);
  border-radius: 50%;
  background: var(--profile-accent, #ff2e4d);
}

.profile-title {
  margin: 12px 0 0;
  color: #d9d2ff;
  font-size: 12px;
  font-weight: 650;
}

.profile-bio {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}

.profile-stat {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.profile-stat span {
  display: block;
  color: var(--dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.profile-stat strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.profile-xp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

.profile-xp {
  width: 100%;
  height: 7px;
  margin-top: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--profile-accent, #ff2e4d);
  appearance: none;
}

.profile-xp::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.profile-xp::-webkit-progress-value {
  border-radius: 999px;
  background: var(--profile-accent, #ff2e4d);
}

.profile-xp::-moz-progress-bar {
  border-radius: 999px;
  background: var(--profile-accent, #ff2e4d);
}

.profile-meta {
  margin: 7px 0 0;
  color: var(--dim);
  font-size: 10px;
}

.profile-achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.profile-achievement {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 10px;
}

.profile-games {
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.profile-games-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.profile-games-head strong {
  font-size: 11px;
}

.profile-games-head span {
  color: var(--dim);
  font-size: 9px;
}

.profile-games-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.profile-game-achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.profile-game-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
}

.profile-game-badge.is-unlocked {
  border-color: rgba(255, 120, 90, 0.4);
  background: rgba(255, 46, 77, 0.12);
  color: #ffd2d8;
}

.profile-game-badge.is-locked {
  opacity: 0.55;
  border-style: dashed;
}

.profile-game-badge-icon {
  flex: 0 0 auto;
  font-size: 10px;
}

.profile-game-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.profile-game-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: rgba(255, 46, 77, 0.12);
  color: #ffc2cb;
  font-size: 11px;
}

.profile-game-name {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-game-score {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 9px;
}

.profile-game-score.is-win {
  color: #a5f3cf;
}

.profile-leaders {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.profile-leaders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.profile-leaders-head strong {
  font-size: 11px;
}

.profile-leaders-head select {
  max-width: 150px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 9px;
  font-family: inherit;
}

.profile-leaders-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-leader-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 3px 5px;
  border-radius: 7px;
}

.profile-leader-row.is-you {
  background: var(--accent-soft);
}

.profile-leader-rank {
  flex: 0 0 20px;
  color: var(--dim);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.profile-leader-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-soft);
  color: #ffc2cb;
  font-size: 9px;
  font-weight: 600;
}

.profile-leader-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-leader-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.profile-leader-info strong {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-leader-info small {
  overflow: hidden;
  color: var(--dim);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-leader-points {
  flex: 0 0 auto;
  color: #a5f3cf;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.profile-leaders-empty {
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.35;
}

.profile-error {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 107, 129, 0.28);
  border-radius: 9px;
  background: rgba(255, 107, 129, 0.08);
  color: #ffd2d9;
  font-size: 11px;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.profile-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.profile-form input,
.profile-form textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  background: rgba(6, 8, 13, 0.55);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  resize: vertical;
}

.profile-form input:focus,
.profile-form textarea:focus {
  border-color: rgba(255, 46, 77, 0.62);
  box-shadow: 0 0 0 3px rgba(255, 46, 77, 0.15);
}

.profile-form input[type="color"] {
  height: 36px;
  padding: 3px;
  cursor: pointer;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 9px;
}

.profile-hint {
  margin: -3px 0 2px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.45;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.profile-actions .btn {
  height: 36px;
  padding: 0 13px;
  font-size: 12px;
}

.profile-actions #profile-refresh {
  margin-left: auto;
}

/* ------------------------------------------------------ бункер и мафия */

.game-pick-icon.is-bunker {
  color: #ffb86b;
  font-size: 23px;
}

.game-pick-icon.is-mafia {
  color: #ff8f9e;
  font-size: 22px;
}

.bunker,
.mafia {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 13px;
}

.bunker-scenario {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 46, 77, 0.34);
  border-radius: 14px;
  background:
    radial-gradient(340px 120px at 0% 0%, rgba(255, 46, 77, 0.18), transparent 72%),
    rgba(255, 255, 255, 0.025);
}

.bunker-scenario-tag {
  display: grid;
  place-items: center;
  min-width: 52px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 216, 138, 0.34);
  border-radius: 999px;
  background: rgba(255, 216, 138, 0.08);
  color: #ffd88a;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bunker-scenario strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.bunker-scenario p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.bunker-status,
.mafia-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.bunker-timer,
.mafia-timer {
  align-self: flex-start;
  padding: 4px 9px;
  border: 1px solid rgba(255, 216, 138, 0.26);
  border-radius: 999px;
  background: rgba(255, 216, 138, 0.07);
  color: #ffd88a;
  font-size: 10px;
  font-weight: 600;
}

.bunker-card {
  padding: 12px;
  border: 1px solid rgba(255, 46, 77, 0.35);
  border-radius: 14px;
  background: rgba(255, 46, 77, 0.06);
}

.bunker-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.bunker-card-head strong {
  font-size: 12px;
}

.bunker-card-head span {
  color: var(--dim);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bunker-traits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.bunker-trait {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 10, 16, 0.5);
  color: var(--text);
  text-align: left;
  transition: border-color 0.14s ease, opacity 0.14s ease;
}

.bunker-trait:not(:disabled):hover {
  border-color: rgba(255, 216, 138, 0.58);
  cursor: pointer;
}

.bunker-trait.is-revealed {
  border-color: rgba(61, 220, 151, 0.4);
  background: rgba(61, 220, 151, 0.06);
  opacity: 0.86;
}

.bunker-trait-icon {
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1.15;
}

.bunker-trait-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bunker-trait-copy small {
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bunker-trait-copy strong {
  font-size: 11px;
  font-weight: 550;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.bunker-table {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bunker-row {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.022);
}

.bunker-row.is-you {
  border-color: rgba(255, 46, 77, 0.42);
}

.bunker-row.is-turn {
  border-color: rgba(255, 216, 138, 0.55);
  box-shadow: 0 0 16px rgba(255, 216, 138, 0.06);
}

.bunker-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.bunker-row-head strong {
  font-size: 11px;
}

.bunker-row-head span {
  color: var(--dim);
  font-size: 9px;
}

.bunker-row-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bunker-trait-chip {
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.bunker-empty {
  color: var(--dim);
  font-size: 9px;
  font-style: italic;
}

.bunker-vote,
.bunker-result {
  padding: 11px 12px;
  border: 1px solid rgba(255, 143, 158, 0.3);
  border-radius: 12px;
  background: rgba(255, 143, 158, 0.045);
}

.bunker-vote-title,
.mafia-targets-title {
  margin: 0 0 8px;
  color: #ffd0d6;
  font-size: 11px;
  font-weight: 600;
}

.bunker-vote-list,
.mafia-target-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bunker-vote-btn,
.mafia-target {
  padding: 6px 10px;
  border: 1px solid rgba(255, 143, 158, 0.32);
  border-radius: 8px;
  background: rgba(255, 143, 158, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 10px;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.bunker-vote-btn:not(:disabled):hover,
.mafia-target:not(:disabled):hover {
  border-color: rgba(255, 143, 158, 0.68);
  background: rgba(255, 143, 158, 0.16);
  cursor: pointer;
}

.bunker-result p {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
}

.bunker-result small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.bunker-library {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
}

.bunker-library .field {
  margin: 0;
}

.bunker-create {
  margin-top: 9px;
}

.bunker-create summary {
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.bunker-create-fields {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.bunker-create-fields textarea,
.bunker-create-fields input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.bunker-create-fields input[type="range"] {
  width: 100%;
  accent-color: #ff2e4d;
}

.bunker-create-fields .btn {
  justify-self: start;
}

.mafia-role {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(255, 46, 77, 0.38);
  border-radius: 13px;
  background:
    radial-gradient(260px 110px at 0% 0%, rgba(255, 46, 77, 0.18), transparent 72%),
    rgba(255, 255, 255, 0.025);
}

.mafia-role-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 46, 77, 0.34);
  border-radius: 12px;
  background: rgba(255, 46, 77, 0.1);
  font-size: 21px;
}

.mafia-role-caption {
  display: block;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mafia-role strong {
  display: block;
  margin: 1px 0 3px;
  font-size: 15px;
}

.mafia-role p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.mafia-team {
  margin-top: 6px;
  color: #ffb3bb;
  font-size: 10px;
}

.mafia-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 11px;
  border-left: 2px solid rgba(255, 216, 138, 0.5);
  border-radius: 4px 10px 10px 4px;
  background: rgba(255, 216, 138, 0.035);
}

.mafia-log p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.mafia-targets,
.mafia-vote {
  padding: 10px 11px;
  border: 1px solid rgba(255, 143, 158, 0.28);
  border-radius: 11px;
  background: rgba(255, 143, 158, 0.04);
}

.mafia-target.is-self {
  border-color: rgba(61, 220, 151, 0.36);
  background: rgba(61, 220, 151, 0.07);
}

.mafia-target.is-vote {
  border-color: rgba(255, 216, 138, 0.3);
  background: rgba(255, 216, 138, 0.07);
}

.mafia-action-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.mafia-detective {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid rgba(89, 199, 255, 0.28);
  border-radius: 10px;
  background: rgba(89, 199, 255, 0.045);
}

.mafia-detective strong {
  flex-basis: 100%;
  font-size: 10px;
}

.mafia-detective span {
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(61, 220, 151, 0.08);
  color: #a5f3cf;
  font-size: 9px;
}

.mafia-detective span.is-mafia {
  background: rgba(255, 143, 158, 0.12);
  color: #ffb3bb;
}

@media (max-width: 560px) {
  .bunker-traits {
    grid-template-columns: minmax(0, 1fr);
  }

  .bunker-scenario {
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .mode-grid,
  .game-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-pane {
    overflow: visible;
  }

  .player-pane {
    min-height: 560px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 12px 12px 16px;
  }

  .landing {
    padding: 14px 2px;
  }

  .landing-hero h1 {
    font-size: 32px;
  }

  .mode-card {
    padding: 18px;
  }

  .games-toolbar {
    flex-wrap: wrap;
  }

  .game-card {
    padding: 16px;
  }

  .quizboard-grid {
    gap: 4px;
  }

  .quizboard-category {
    min-height: 28px;
    padding: 3px 2px;
    font-size: 8px;
    letter-spacing: 0;
  }

  .quizboard-cell {
    min-height: 38px;
    font-size: 11px;
  }

  .race-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .race-wheel-side {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .race-wheel-wrap {
    width: 84px;
    height: 84px;
    flex: 0 0 auto;
  }

  .race-wheel-result {
    min-height: 0;
    text-align: left;
  }

  .race-wheel-hint {
    text-align: left;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .status-pill {
    padding: 5px 9px;
  }

  .stage {
    padding-inline: 16px;
  }

  .search {
    flex-wrap: wrap;
  }

  .search input {
    flex-basis: 100%;
  }

  .search .btn {
    flex: 1;
  }

  .controls {
    gap: 8px;
  }

  .cover {
    width: 160px;
  }

  .profile-modal {
    padding: 8px;
  }

  .profile-card {
    max-height: 96vh;
  }

  .profile-banner {
    height: 132px;
  }

  .profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .profile-stat {
    padding: 8px;
  }

  .profile-stat strong {
    font-size: 14px;
  }

  .profile-form-grid {
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  .session-head {
    flex-direction: column;
  }

  .session-head .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
