:root {
  color-scheme: dark;
  --bg: #08010f;
  --panel: rgba(18, 10, 29, 0.72);
  --panel-strong: rgba(24, 13, 39, 0.9);
  --line: rgba(255, 255, 255, 0.15);
  --line-strong: rgba(255, 255, 255, 0.34);
  --text: #fff8ff;
  --muted: #b7a9c8;
  --soft: #7f728d;
  --blue: #6d5dff;
  --cyan: #78ecff;
  --violet: #bd43ff;
  --orange: #ff874d;
  --mint: #4ff4b0;
  --gold: #ffd166;
  --danger: #ff6c86;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  --glow: 0 0 34px rgba(189, 67, 255, 0.34);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 7% 6%, rgba(255, 179, 89, 0.82), transparent 22%),
    radial-gradient(circle at 95% 11%, rgba(173, 60, 255, 0.9), transparent 30%),
    radial-gradient(circle at 82% 74%, rgba(124, 66, 255, 0.55), transparent 30%),
    linear-gradient(145deg, #0b0613 0%, #12051b 45%, #09030f 100%);
  background-color: var(--bg);
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 28% 0%, rgba(255, 255, 255, 0.18), transparent 18%),
    radial-gradient(circle at 45% 18%, rgba(255, 255, 255, 0.08) 1px, transparent 1.5px);
  background-size: auto, 18px 18px;
  opacity: 0.42;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 74%);
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 7% 50%, rgba(255, 117, 66, 0.35), transparent 58%),
    radial-gradient(780px 520px at 94% 47%, rgba(148, 48, 255, 0.52), transparent 56%);
  filter: blur(4px);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  padding: 54px clamp(18px, 5vw, 88px);
  overflow-x: hidden;
}

.glass-panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(145deg, rgba(24, 13, 39, 0.84), rgba(8, 3, 15, 0.74));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
}

.auth-screen,
.main-screen {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 32px;
  background:
    radial-gradient(circle at 8% 55%, rgba(255, 116, 55, 0.28), transparent 28%),
    radial-gradient(circle at 93% 46%, rgba(169, 47, 255, 0.36), transparent 30%),
    linear-gradient(180deg, rgba(17, 5, 26, 0.94), rgba(8, 2, 15, 0.96));
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.55);
}

.auth-screen::before,
.main-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1.5px);
  background-size: 16px 16px;
  opacity: 0.22;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 54%);
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 28px;
  align-items: center;
  min-height: calc(100vh - 108px);
  padding: clamp(26px, 5vw, 68px);
}

.brand-panel {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(10px, 4vw, 42px);
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 135, 77, 0.22), rgba(189, 67, 255, 0.22));
  box-shadow: 0 0 42px rgba(255, 135, 77, 0.26);
}

.scale-icon {
  color: var(--cyan);
  font-size: 28px;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(46px, 7vw, 82px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0;
}

.brand-panel > p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.brand-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.brand-metrics span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.brand-metrics strong {
  color: var(--text);
}

.auth-card {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 22px;
  border-radius: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}

.tab-button,
.ghost-button,
.primary-button,
.select-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.tab-button {
  background: transparent;
  color: var(--muted);
}

.tab-button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.auth-form,
.form-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.group-tools {
  display: grid;
  align-content: start;
  gap: 14px;
}

label,
.field-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.34);
}

input:focus,
select:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(189, 67, 255, 0.18);
}

.primary-button {
  min-height: 48px;
  padding: 0 20px;
  background: linear-gradient(135deg, #171019 0%, #3c153e 42%, var(--orange) 100%);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 34px rgba(189, 67, 255, 0.34), 0 0 18px rgba(255, 135, 77, 0.22);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-strong);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
}

.danger-button {
  padding: 0 12px;
  color: #ffd8df;
  background: rgba(255, 108, 134, 0.13);
  border-color: rgba(255, 108, 134, 0.44);
}

.member-photo-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(120, 236, 255, 0.34);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(120, 236, 255, 0.09);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.member-photo-button:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 236, 255, 0.58);
  background: rgba(120, 236, 255, 0.14);
}

.member-photo-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.select-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.52);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.main-screen {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  min-height: calc(100vh - 108px);
  padding: clamp(18px, 3vw, 42px);
}

.sidebar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.logo-row .scale-icon {
  font-size: 22px;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.profile-upload {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.profile-upload:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.1);
}

.profile-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-upload strong,
.profile-upload small {
  display: block;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-upload strong {
  color: var(--text);
  font-size: 12px;
}

.profile-upload small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.profile-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(120, 236, 255, 0.38);
  border-radius: 50%;
  color: var(--text);
  background:
    radial-gradient(circle at 22% 16%, rgba(255, 135, 77, 0.34), transparent 34%),
    rgba(189, 67, 255, 0.22);
  font-size: 13px;
  font-weight: 800;
}

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

.side-nav {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.nav-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link.active,
.nav-link:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.42);
}

#logout-button {
  min-height: 38px;
  padding: 0 16px;
}

.workspace {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 24px;
  min-width: 0;
}

.workspace.has-compact-topbar {
  gap: 14px;
}

.topbar {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: clamp(30px, 5vw, 62px) 20px 26px;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.topbar.is-compact {
  display: none;
}

.topbar h2 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(38px, 6vw, 66px);
  font-weight: 600;
  line-height: 1.02;
  color: rgba(255, 255, 255, 0.92);
}

.active-group-pill {
  display: inline-grid;
  gap: 3px;
  min-width: 220px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  box-shadow: var(--glow);
}

.active-group-pill span {
  color: var(--soft);
  font-size: 12px;
}

.page-section {
  display: none;
  gap: 18px;
}

.page-section.active {
  display: grid;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h3 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
}

.section-group-pill {
  display: inline-grid;
  gap: 3px;
  min-width: 150px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  text-align: center;
}

.section-group-pill span {
  color: var(--soft);
  font-size: 11px;
}

.section-group-pill strong {
  font-size: 14px;
}

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

.dashboard-grid .compact-panel:last-child {
  grid-column: 1 / -1;
}

.status-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  min-height: 230px;
  padding: 28px;
  border-radius: 22px;
}

.status-label {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.08);
}

.status-label.balanced {
  color: var(--mint);
  border-color: rgba(79, 244, 176, 0.5);
}

.status-label.watch {
  color: var(--gold);
  border-color: rgba(255, 209, 102, 0.5);
}

.status-label.danger {
  color: var(--danger);
  border-color: rgba(255, 108, 134, 0.52);
}

.score-ring {
  display: grid;
  width: 140px;
  height: 140px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(9, 3, 15, 0.96) 55%, transparent 56%),
    conic-gradient(var(--orange), var(--violet), rgba(255, 255, 255, 0.16));
  box-shadow: 0 0 38px rgba(255, 135, 77, 0.26), 0 0 46px rgba(189, 67, 255, 0.22);
}

.score-ring strong {
  font-size: 42px;
}

.score-ring span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.compact-panel,
.form-panel,
.assignment-panel {
  padding: 22px;
  border-radius: 22px;
}

.form-panel {
  align-self: start;
}

.compact-panel h4,
.assignment-panel h4 {
  margin-bottom: 16px;
  font-size: 18px;
}

.member-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.member-card,
.reward-card,
.history-item,
.list-item,
.assignment-box,
.probability-row,
.simulation-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.member-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.member-card.is-leader,
.reward-card.is-leader {
  border-color: rgba(120, 236, 255, 0.42);
  background:
    radial-gradient(circle at 12% 8%, rgba(120, 236, 255, 0.12), transparent 34%),
    rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 30px rgba(120, 236, 255, 0.1);
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: var(--text);
  font-weight: 800;
  background: linear-gradient(135deg, rgba(255, 135, 77, 0.34), rgba(189, 67, 255, 0.34));
}

.avatar.has-image {
  border-color: rgba(120, 236, 255, 0.42);
  background: rgba(120, 236, 255, 0.08);
  box-shadow: 0 0 18px rgba(120, 236, 255, 0.12);
}

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

.member-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-points {
  font-size: 30px;
  font-weight: 800;
}

.tiny-muted,
.empty-state,
small {
  color: var(--muted);
}

.reward-badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
  font-size: 12px;
}

.effort-badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid rgba(120, 236, 255, 0.45);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(120, 236, 255, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.reward-badge.medium {
  color: var(--gold);
  border-color: rgba(255, 209, 102, 0.5);
}

.reward-badge.high {
  color: var(--mint);
  border-color: rgba(79, 244, 176, 0.5);
}

.stack-list,
.history-list {
  display: grid;
  gap: 10px;
}

.list-item,
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
}

.list-item strong,
.history-item strong {
  display: block;
}

.select-button {
  min-height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--line);
}

.select-button.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.16);
}

.two-column {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.task-workbench {
  display: grid;
  gap: 18px;
  align-self: start;
}

.task-form,
.task-queue-panel,
.assignment-panel {
  min-width: 0;
}

.task-queue-panel .panel-title {
  margin-bottom: 14px;
}

.task-list-item {
  align-items: flex-start;
  padding: 15px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.task-list-item.is-selected {
  border-color: rgba(120, 236, 255, 0.5);
  background:
    radial-gradient(circle at 12% 20%, rgba(120, 236, 255, 0.12), transparent 32%),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 28px rgba(120, 236, 255, 0.1);
}

.task-list-copy {
  display: grid;
  gap: 4px;
}

.task-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
  font-size: 12px;
  font-weight: 700;
}

.task-status.ready {
  color: var(--mint);
  border-color: rgba(79, 244, 176, 0.42);
}

.task-status.voting {
  color: var(--cyan);
  border-color: rgba(120, 236, 255, 0.36);
}

.task-creation-note {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.votes-area {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.vote-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 96px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.vote-row span {
  display: grid;
  gap: 3px;
}

.vote-row strong {
  color: var(--text);
}

.vote-row small {
  color: var(--muted);
}

.difficulty-preview {
  display: grid;
  gap: 4px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.26);
}

.difficulty-preview strong {
  color: var(--orange);
  font-size: 42px;
  text-shadow: 0 0 28px rgba(255, 135, 77, 0.42);
}

.assignment-content {
  display: grid;
  gap: 14px;
}

.assignment-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-color: rgba(255, 255, 255, 0.18);
}

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

.single-vote-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.vote-progress {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
}

.vote-progress strong {
  color: var(--orange);
  font-size: 28px;
}

.draw-status {
  width: fit-content;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 24px rgba(189, 67, 255, 0.22);
}

.probability-row {
  display: grid;
  grid-template-columns: 44px 1fr 50px;
  gap: 12px;
  align-items: center;
  padding: 10px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.probability-row:hover,
.probability-row:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.probability-row.is-drawing {
  transform: scale(1.025);
  border-color: rgba(255, 135, 77, 0.72);
  background: rgba(255, 135, 77, 0.12);
  box-shadow: 0 0 32px rgba(255, 135, 77, 0.28), 0 0 40px rgba(189, 67, 255, 0.18);
}

.probability-row.is-selected {
  border-color: rgba(120, 236, 255, 0.5);
  background: rgba(120, 236, 255, 0.08);
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--violet));
}

.simulation-box {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.simulation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.simulation-cell {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.24);
}

.simulation-cell strong {
  display: block;
  color: var(--cyan);
  font-size: 30px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.history-item .points {
  color: var(--orange);
  font-size: 22px;
  font-weight: 800;
}

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

.reward-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  min-height: 190px;
  position: relative;
  overflow: hidden;
}

.reward-card.medium {
  border-color: rgba(255, 209, 102, 0.56);
  box-shadow: 0 0 28px rgba(255, 209, 102, 0.14);
}

.reward-card.high {
  border-color: rgba(79, 244, 176, 0.56);
  box-shadow: 0 0 30px rgba(79, 244, 176, 0.18);
}

.reward-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.reward-progress div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--violet), var(--cyan));
  box-shadow: 0 0 20px rgba(189, 67, 255, 0.35);
}

.reward-progress.big {
  height: 13px;
}

.message {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(11, 4, 18, 0.88);
  box-shadow: var(--shadow);
}

.message-area {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  width: min(420px, calc(100vw - 36px));
}

.message.success {
  color: var(--mint);
  border-color: rgba(79, 244, 176, 0.5);
}

.message.error {
  color: var(--danger);
  border-color: rgba(255, 108, 134, 0.5);
}

.message.info {
  color: var(--cyan);
}

.celebration-modal,
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
}

.confirm-modal {
  z-index: 22;
}

.celebration-backdrop,
.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 1, 9, 0.72);
  backdrop-filter: blur(10px);
}

.celebration-card {
  position: relative;
  width: min(560px, 100%);
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 30px;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 135, 77, 0.28), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(189, 67, 255, 0.32), transparent 34%),
    linear-gradient(145deg, rgba(30, 14, 46, 0.96), rgba(8, 3, 15, 0.96));
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.66), 0 0 48px rgba(189, 67, 255, 0.24);
  animation: prize-pop 520ms cubic-bezier(0.2, 1.2, 0.2, 1) both;
}

.celebration-card h3 {
  margin-bottom: 12px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1;
}

.confirm-card {
  position: relative;
  width: min(540px, 100%);
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 108, 134, 0.28), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(255, 135, 77, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(30, 14, 46, 0.97), rgba(8, 3, 15, 0.98));
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.68), 0 0 44px rgba(255, 108, 134, 0.14);
  animation: prize-pop 360ms cubic-bezier(0.2, 1.12, 0.2, 1) both;
}

.confirm-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1.5px);
  background-size: 16px 16px;
  opacity: 0.14;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 62%);
}

.confirm-card > * {
  position: relative;
  z-index: 1;
}

.confirm-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgba(255, 108, 134, 0.58);
  border-radius: 50%;
  color: var(--danger);
  background: rgba(255, 108, 134, 0.12);
  box-shadow: 0 0 30px rgba(255, 108, 134, 0.22);
  font-size: 28px;
  font-weight: 800;
}

.confirm-card h3 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
}

.confirm-card p {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.55;
}

.confirm-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.confirm-actions {
  justify-content: flex-end;
  margin-top: 26px;
}

.confirm-danger {
  min-height: 48px;
  padding: 0 20px;
  border-color: rgba(255, 108, 134, 0.6);
  background:
    linear-gradient(135deg, rgba(255, 108, 134, 0.25), rgba(255, 135, 77, 0.44)),
    rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 26px rgba(255, 108, 134, 0.16);
}

.celebration-copy {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.celebration-copy strong {
  color: var(--orange);
}

.prize-box {
  display: grid;
  gap: 4px;
  margin: 22px 0 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
}

.prize-box span {
  color: var(--muted);
}

.prize-box strong {
  font-size: 28px;
}

.burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.burst span {
  position: absolute;
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(var(--cyan), var(--orange));
  opacity: 0;
  animation: confetti-pop 900ms ease-out both;
}

.burst span:nth-child(1) { left: 12%; top: 18%; animation-delay: 40ms; transform: rotate(22deg); }
.burst span:nth-child(2) { left: 28%; top: 8%; animation-delay: 120ms; transform: rotate(-34deg); }
.burst span:nth-child(3) { right: 16%; top: 16%; animation-delay: 90ms; transform: rotate(42deg); }
.burst span:nth-child(4) { right: 30%; top: 6%; animation-delay: 170ms; transform: rotate(-18deg); }
.burst span:nth-child(5) { left: 18%; bottom: 12%; animation-delay: 210ms; transform: rotate(-60deg); }
.burst span:nth-child(6) { right: 18%; bottom: 16%; animation-delay: 260ms; transform: rotate(64deg); }

@keyframes prize-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes confetti-pop {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.5);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-54px) scale(1.1) rotate(120deg);
  }
}

@media (max-width: 1040px) {
  .auth-screen,
  .dashboard-grid,
  .two-column,
  .task-layout {
    grid-template-columns: 1fr;
  }

  .main-screen {
    min-height: auto;
  }

  .sidebar {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .side-nav {
    justify-content: center;
  }
}

@media (max-width: 700px) {
  .app-shell {
    min-height: 100svh;
    padding: 0;
  }

  .auth-screen,
  .main-screen {
    min-height: 100svh;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .auth-screen,
  .main-screen {
    padding: 18px;
  }

  .sidebar,
  .workspace,
  .page-section,
  .section-heading,
  .dashboard-grid,
  .two-column,
  .task-layout {
    width: 100%;
    max-width: 100%;
  }

  .sidebar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .profile-upload {
    max-width: 100%;
  }

  .brand-panel {
    min-height: auto;
    padding: 16px 4px;
  }

  h1 {
    font-size: 40px;
  }

  .topbar {
    padding-top: 24px;
  }

  .topbar h2 {
    font-size: 36px;
  }

  .status-card,
  .list-item,
  .history-item {
    grid-template-columns: 1fr;
    align-items: stretch;
    flex-direction: column;
  }

  .status-card {
    justify-items: start;
  }

  .side-nav {
    width: 100%;
    border-radius: 22px;
  }

  .nav-link {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  .simulation-grid {
    grid-template-columns: 1fr;
  }

  .single-vote-row {
    grid-template-columns: 1fr;
  }
}
