:root {
  --bg: #0f1118;
  --bg-soft: #141827;
  --panel: #1b2030;
  --panel-elev: #232a3f;
  --line: #36405b;
  --line-strong: #4a5779;
  --txt: #f3f6ff;
  --txt-dim: #b7c1d9;
  --brand: #ff6a2a;
  --brand-2: #ffb14a;
  --ok: #54d38e;
  --warn: #ffd166;
  --danger: #ff5f7f;
  --chip: #2b3350;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  color: var(--txt);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.07rem;
  line-height: 1.35;
  background:
    radial-gradient(circle at 20% -10%, rgba(255, 106, 42, 0.18), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(255, 177, 74, 0.1), transparent 34%),
    linear-gradient(180deg, #0d1017 0%, #111523 34%, #101422 100%);
  padding: 12px;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 44px
    ),
    linear-gradient(180deg, transparent 0%, rgba(255, 106, 42, 0.07) 100%);
  opacity: 0.9;
  animation: lane-shift 18s linear infinite;
}

@keyframes lane-shift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(22px);
  }
}

h1,
h2,
h3,
button {
  margin: 0;
  font-family: 'Saira Condensed', sans-serif;
  letter-spacing: 0.02em;
}

header,
nav,
aside,
main {
  width: min(1320px, 100%);
  margin-inline: auto;
}

.panel {
  background: linear-gradient(180deg, var(--panel-elev), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.eyebrow {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warn);
}

.title {
  margin-top: 2px;
  font-size: clamp(1.35rem, 3.2vw, 2.1rem);
  color: #fff3e7;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--txt-dim);
  max-width: 70ch;
}

.me-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#meName {
  margin: 0;
  color: #ffdcbf;
  font-weight: 700;
}

#mePoints {
  display: block;
  color: var(--ok);
  font-size: 1.45rem;
  line-height: 1;
}

.header-stat {
  margin: 6px 0 0;
}

.logout-btn,
.notif-btn {
  min-height: 42px;
}

.admin-btn {
  border-color: #5a7ea8;
  background: linear-gradient(180deg, #2e5476, #264563);
}

.options-btn {
  border-color: #6a7396;
  background: linear-gradient(180deg, #3a4361, #313954);
}

.notif-btn {
  border-color: #576388;
  background: linear-gradient(180deg, #36435f, #2e3851);
}

.logout-btn {
  border-color: #9f5360;
  background: linear-gradient(180deg, #72303c, #5a2630);
}

#notifBadge {
  display: inline-block;
  margin-left: 6px;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #1a0e06;
  font-weight: 800;
  text-align: center;
}

.notif-drawer {
  margin-top: 10px;
  display: none;
}

.notif-drawer.open {
  display: block;
  animation: panel-in 180ms ease-out;
}

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

.tabs {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#preOpenNotice {
  margin-top: 10px;
  border-color: #8d6640;
  border-left: 5px solid var(--brand);
  background: linear-gradient(180deg, #31231c, #2a201b);
  color: #ffe2c2;
  font-weight: 700;
}

.tab {
  border: 1px solid #495675;
  background: linear-gradient(180deg, #2f3852, #273047);
  color: #e9efff;
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 42px;
  cursor: pointer;
  font-size: 1rem;
}

.tab.active {
  border-color: var(--brand-2);
  background: linear-gradient(180deg, #5f3c1f, #4d3119);
  color: #fff4e6;
  box-shadow: inset 0 0 0 1px rgba(255, 177, 74, 0.3);
}

main {
  margin-top: 10px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fade-in 160ms ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.panel-head h2 {
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.48rem);
  color: #fff0df;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--txt-dim);
}

.form-grid {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #eef3ff;
}

input,
select,
textarea,
button {
  border-radius: 10px;
  border: 1px solid #4a5778;
  background: #12192a;
  color: var(--txt);
  padding: 10px 12px;
  min-height: 44px;
  font-size: 1rem;
}

input::placeholder,
textarea::placeholder {
  color: #8f9abc;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(255, 177, 74, 0.8);
  outline-offset: 1px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

#predictionTargetUsers {
  min-height: 150px;
}

#predictionTargetUsersWrap small {
  margin-top: 2px;
}

button {
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(180deg, #5f3c1f, #4d3119);
  border-color: #97623c;
}

button:hover {
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: none;
}

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

.cards {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  max-height: 64vh;
  overflow: auto;
  padding-right: 3px;
}

.cards.short {
  max-height: 38vh;
}

.card {
  border: 1px solid #404b6b;
  border-radius: 11px;
  background: #181e2d;
  padding: 11px;
}

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

.meta {
  color: var(--txt-dim);
  font-size: 0.92rem;
}

.status-chip {
  border-radius: 999px;
  padding: 2px 9px;
  border: 1px solid #4a5578;
  background: var(--chip);
  font-size: 0.78rem;
  text-transform: uppercase;
  line-height: 1.45;
}

.status-ouverte {
  color: #8dc2ff;
}

.status-revendiquee {
  color: var(--warn);
}

.status-validee {
  color: var(--ok);
}

.status-refusee {
  color: var(--danger);
}

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

.card-actions button {
  flex: 1 1 210px;
}

.card-actions .meta {
  display: inline-flex;
  align-items: center;
}

.result-box {
  margin-top: 10px;
  border: 1px solid #4b587b;
  border-radius: 11px;
  padding: 10px;
  background: #171e2e;
}

.wheel-visual-wrap {
  margin: 10px 0 12px;
  display: grid;
  place-items: center;
}

.wheel-pointer {
  color: #ffd88d;
  font-size: 1.25rem;
  margin-bottom: -4px;
  z-index: 2;
}

.wheel-disk {
  width: min(325px, 80vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 4px solid #ad7447;
  background: conic-gradient(
    #4a2a1a 0deg 20deg,
    #5f3520 20deg 40deg,
    #6e3b22 40deg 60deg,
    #50333a 60deg 80deg,
    #3e344c 80deg 100deg,
    #2f3f57 100deg 120deg,
    #4a2a1a 120deg 140deg,
    #5f3520 140deg 160deg,
    #6e3b22 160deg 180deg,
    #50333a 180deg 200deg,
    #3e344c 200deg 220deg,
    #2f3f57 220deg 240deg,
    #4a2a1a 240deg 260deg,
    #5f3520 260deg 280deg,
    #6e3b22 280deg 300deg,
    #50333a 300deg 320deg,
    #3e344c 320deg 340deg,
    #2f3f57 340deg 360deg
  );
  box-shadow:
    inset 0 0 0 2px rgba(255, 218, 176, 0.15),
    0 12px 24px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  transition: transform 4.2s cubic-bezier(0.16, 0.84, 0.22, 1);
  transform: rotate(0deg);
}

.wheel-center {
  width: 35%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid #c68f56;
  background: #1b1d29;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #ffe6c7;
  letter-spacing: 0.04em;
}

.wheel-highlight {
  margin: 8px 0 10px;
  border: 1px solid #966540;
  border-left: 5px solid var(--brand);
  border-radius: 11px;
  padding: 10px;
  background: #2b1f1a;
  color: #ffe3ca;
}

.spin-btn {
  background: linear-gradient(180deg, #286740, #215236);
  border-color: #4f9f72;
}

.danger-btn {
  background: linear-gradient(180deg, #832f45, #672436);
  border-color: #cb5d7b;
}

.leaderboard,
.list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}

.leaderboard li,
.list li {
  border: 1px solid #3f4a69;
  border-radius: 10px;
  background: #171e2d;
  padding: 9px 10px;
}

.leaderboard li {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.night-grid,
.night-guide {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.night-card {
  border: 1px solid #3f4a69;
  border-radius: 12px;
  background: #1a2132;
  padding: 12px;
}

.night-card h3 {
  color: #ffe4c5;
}

.night-card.hardcore {
  border-color: #c25673;
  box-shadow: inset 0 0 0 1px rgba(194, 86, 115, 0.25);
}

.mt {
  margin-top: 12px;
}

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

.profile-btn {
  min-height: 76px;
  text-align: left;
  background: linear-gradient(180deg, #36435f, #2d374f);
  border-color: #5a688e;
}

.error {
  margin: 0;
  min-height: 1.1em;
  color: #ff8aa3;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 14px;
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(3px);
}

.modal.open {
  display: grid;
}

.login-panel {
  width: min(760px, 100%);
}

@media (max-width: 1080px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .cards,
  .cards.short {
    max-height: 46vh;
  }
}

@media (max-width: 760px) {
  body {
    padding: 10px;
    font-size: 1.02rem;
  }

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

  .me-wrap {
    justify-content: flex-start;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tab {
    width: 100%;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .tabs {
    grid-template-columns: 1fr;
  }

  .card-actions button {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-glow,
  .tab-panel.active {
    animation: none;
  }

  .wheel-disk {
    transition: none;
  }
}
