:root {
  color-scheme: dark;
  --ui-font: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display-font: Orbitron, Inter, system-ui, sans-serif;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0e27 0%, #1a0033 50%, #2d0052 100%);
  color: #ff00ff;
  font-family: var(--ui-font);
}

.container {
  width: min(1100px, 100% - 32px);
  margin: 24px auto;
}

.card {
  background: #0d0515;
  border: 2px solid #ff00ff;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.4), 0 20px 44px rgba(0, 0, 0, 0.7);
}

.login-card {
  position: relative;
  overflow: hidden;
  max-width: 520px;
  margin: 9vh auto;
}

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

.disco-ball {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 64px;
  height: 64px;
  z-index: 2;
  pointer-events: none;
}

.disco-ball::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 255, 0.2), rgba(255, 0, 255, 0));
  filter: blur(3px);
}

.disco-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(0, 255, 255, 0.55);
  overflow: hidden;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.95) 0 9%, rgba(255, 255, 255, 0) 28%),
    radial-gradient(circle at 50% 58%, #2d145d 0%, #19092f 72%, #12061f 100%);
  box-shadow:
    inset -7px -10px 13px rgba(0, 0, 0, 0.45),
    inset 5px 5px 8px rgba(255, 255, 255, 0.08),
    0 0 14px rgba(255, 0, 255, 0.42),
    0 0 22px rgba(0, 255, 255, 0.2);
}

.disco-core::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 255, 255, 0.2) 0 3px,
      rgba(255, 0, 255, 0.18) 3px 6px,
      rgba(20, 8, 35, 0.08) 6px 7px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 0, 255, 0.22) 0 3px,
      rgba(0, 255, 255, 0.18) 3px 6px,
      rgba(20, 8, 35, 0.08) 6px 7px
    );
  background-size: 100% 100%, 100% 100%;
  animation: disco-tiles-horizontal 2.2s linear infinite;
}

.disco-core::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.42) 28%,
      rgba(255, 255, 255, 0.08) 44%,
      rgba(255, 255, 255, 0) 66%
    );
  mix-blend-mode: screen;
  animation: disco-reflection-sweep 2.2s linear infinite;
}

@keyframes disco-tiles-horizontal {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 0, 14px 0;
  }
}

@keyframes disco-reflection-sweep {
  from {
    transform: translateX(-58%);
    opacity: 0.72;
  }
  50% {
    opacity: 0.94;
  }
  to {
    transform: translateX(58%);
    opacity: 0.72;
  }
}

@media (prefers-reduced-motion: reduce) {
  .disco-core::before,
  .disco-core::after {
    animation: none;
  }
}

.login-fx {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  background: rgba(10, 5, 20, 0.95);
  transition: opacity 240ms ease;
}

.login-fx-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 0, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.35;
}

.login-fx-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 22%;
  background: linear-gradient(
    to bottom,
    rgba(255, 0, 255, 0),
    rgba(255, 0, 255, 0.25),
    rgba(0, 255, 255, 0)
  );
}

.login-fx-text {
  margin: 0;
  padding: 10px 16px;
  border: 2px solid #ff00ff;
  background: rgba(10, 5, 20, 0.92);
  color: #00ffff;
  font-family: var(--display-font);
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

body.login-fx-active .login-fx {
  opacity: 1;
}

body.login-fx-active .login-fx-scan {
  animation: login-scan 760ms ease-in-out forwards;
}

body.login-fx-active .login-fx-text {
  animation: login-flicker 760ms ease-out;
}

@keyframes login-scan {
  0% {
    transform: translateY(0);
    opacity: 0.1;
  }
  22% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(620%);
    opacity: 0;
  }
}

@keyframes login-flicker {
  0%,
  100% {
    opacity: 1;
    filter: blur(0);
  }
  24% {
    opacity: 0.45;
  }
  48% {
    opacity: 0.9;
    filter: blur(0.7px);
  }
  74% {
    opacity: 0.6;
  }
}

.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 0, 255, 0.03),
    rgba(255, 0, 255, 0.03) 1px,
    transparent 1px,
    transparent 5px
  );
}

.terminal-tag {
  margin: 0 0 8px;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: #00ffff;
}

.hidden {
  display: none;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: #ff00ff;
  letter-spacing: 0.03em;
  font-family: var(--display-font);
  text-transform: uppercase;
}

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

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  border: 1px solid #ff00ff;
  border-radius: 2px;
  padding: 10px;
  background: #1a0033;
  color: #00ffff;
}

input:focus,
textarea:focus,
select:focus {
  outline: 1px solid #00ffff;
  border-color: #ff00ff;
}

button {
  background: #ff00ff;
  color: #000;
  border: none;
  border-radius: 2px;
  padding: 10px 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.83rem;
  font-family: var(--display-font);
  font-weight: bold;
}

button.secondary {
  background: #00ffff;
  color: #000;
}

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

.hint {
  color: #00ffff;
  font-size: 0.9rem;
}

#invite-section {
  padding: 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 620px;
  position: relative;
}

#invite-section.hidden {
  display: none;
}

.sidebar {
  border-right: 2px solid #ff00ff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(to bottom, #0d0515, #1a0033);
}

.sidebar-close,
.sidebar-toggle,
.sidebar-overlay {
  display: none;
}

.sidebar-close {
  align-self: flex-end;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #1a0033;
  color: #00ffff;
  border: 1px solid #ff00ff;
  line-height: 1;
  font-size: 1.2rem;
}

.sidebar-title {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.sidebar-user {
  margin: 0;
  color: #00ffff;
}

.tab-nav {
  display: grid;
  gap: 10px;
}

.tab-btn {
  text-align: left;
  background: #1a0033;
  border: 1px solid #ff00ff;
  color: #00ffff;
  width: 100%;
}

.tab-btn.active {
  background: #ff00ff;
  border-color: #00ffff;
  color: #000;
}

.content {
  padding: 24px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.rsvp-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.rsvp-option {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #ff00ff;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(26, 0, 51, 0.9), rgba(38, 10, 70, 0.9));
  cursor: pointer;
  min-height: 92px;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.rsvp-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rsvp-option-title {
  font-family: var(--display-font);
  letter-spacing: 0.03em;
  color: #f7dfff;
  font-size: 0.95rem;
}

.rsvp-option-subtitle {
  font-size: 0.84rem;
  color: #9de6ff;
}

.rsvp-option.selected {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 14px rgba(255, 0, 255, 0.35);
}

.rsvp-option.attending.selected {
  border-color: #00ff88;
  background: linear-gradient(135deg, rgba(0, 70, 45, 0.52), rgba(20, 25, 50, 0.92));
}

.rsvp-option.not-attending.selected {
  border-color: #ff4d88;
  background: linear-gradient(135deg, rgba(105, 0, 45, 0.5), rgba(30, 10, 45, 0.92));
}

.rsvp-current {
  margin: 2px 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 8px;
  color: #d7fbff;
  background: rgba(0, 255, 255, 0.08);
}

.rsvp-current.attending {
  border-color: rgba(0, 255, 136, 0.55);
  background: rgba(0, 255, 136, 0.14);
  color: #b7ffd8;
}

.rsvp-current.not-attending {
  border-color: rgba(255, 77, 136, 0.55);
  background: rgba(255, 77, 136, 0.12);
  color: #ffc5d9;
}

.plus-one-toggle {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--ui-font);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #00ffff, #4fffff);
  color: #001017;
}

.plus-one-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.plus-one-field {
  margin-bottom: 10px;
}

.plus-one-field label {
  display: block;
  margin-bottom: 6px;
}

.invitation-box {
  background: #0d0515;
  border: 1px solid #ff00ff;
  border-radius: 3px;
  padding: 14px;
  margin-bottom: 12px;
}

.news-composer {
  position: sticky;
  top: 12px;
  z-index: 3;
  backdrop-filter: blur(6px);
}

.countdown-label {
  margin: 0 0 10px;
  color: #00ffff;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.countdown-cell {
  border: 1px solid #ff00ff;
  background: #1a0033;
  padding: 10px 8px;
  text-align: center;
}

.countdown-cell span {
  display: block;
  font-size: 1.4rem;
  line-height: 1.1;
  color: #00ffff;
  font-family: var(--display-font);
}

.countdown-cell small {
  color: #ff00ff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.visualizer {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  align-items: end;
  height: 52px;
}

.visualizer span {
  display: block;
  height: 10px;
  background: linear-gradient(to top, #ff00ff, #00ffff);
  animation: pulse 1.2s ease-in-out infinite;
}

.visualizer span:nth-child(2n) {
  animation-duration: 1.6s;
}

.visualizer span:nth-child(3n) {
  animation-duration: 0.9s;
}

@keyframes pulse {
  0%,
  100% {
    height: 10px;
    opacity: 0.45;
  }
  50% {
    height: 46px;
    opacity: 1;
  }
}

.status {
  min-height: 20px;
  margin: 4px 0 0;
  color: #00ffff;
}

.admin-only.hidden {
  display: none;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  border: 2px solid #ff00ff;
  background: linear-gradient(135deg, #1a0033, #2d0052);
  padding: 20px;
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
}

.stat-card.attending {
  border-color: #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.stat-card.not-attending {
  border-color: #ff0066;
  box-shadow: 0 0 20px rgba(255, 0, 102, 0.3);
}

.stat-number {
  font-size: 2.5rem;
  color: #00ffff;
  font-family: var(--display-font);
  font-weight: bold;
  margin-bottom: 8px;
}

.stat-card.attending .stat-number {
  color: #00ff88;
}

.stat-card.not-attending .stat-number {
  color: #ff0066;
}

.stat-label {
  color: #ff00ff;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.attending-list,
.users-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.attending-list li,
.users-list li {
  padding: 10px 12px;
  border-bottom: 1px solid #ff00ff;
  color: #00ffff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.attending-list li:last-child,
.users-list li:last-child {
  border-bottom: none;
}

.attending-list li strong {
  color: #ff00ff;
}

.users-list li span {
  font-size: 0.85rem;
  color: #00ff88;
}

.guest-status {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.guest-status-yes {
  background: rgba(0, 255, 136, 0.16);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.45);
}

.guest-status-no {
  background: rgba(255, 0, 102, 0.16);
  color: #ff4d88;
  border: 1px solid rgba(255, 0, 102, 0.45);
}

.guest-status-pending {
  background: rgba(0, 255, 255, 0.12);
  color: #00ffff;
  border: 1px solid rgba(0, 255, 255, 0.35);
}

.news-feed {
  display: grid;
  gap: 10px;
}

.news-empty {
  margin: 0;
  color: #00ffff;
}

.news-post {
  border: 1px solid #ff00ff;
  background: #17072d;
  padding: 12px;
  border-radius: 4px;
}

.news-post-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.post-action-btn {
  padding: 8px 10px;
  border-radius: 999px;
  background: #1a0033;
  color: #00ffff;
  border: 1px solid #00ffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  white-space: nowrap;
}

.post-action-btn.danger {
  border-color: #ff0066;
  color: #ff4d88;
}

.news-meta {
  margin: 0 0 8px;
  color: #00ffff;
  font-size: 0.85rem;
}

.news-content {
  margin: 0 0 10px;
  color: #f7dfff;
  white-space: pre-wrap;
}

.news-reactions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reply-thread {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 0, 255, 0.35);
}

.reply-thread h4 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: #00ffff;
}

.reply-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.reply-item {
  border: 1px solid rgba(0, 255, 255, 0.28);
  background: rgba(26, 0, 51, 0.75);
  border-radius: 4px;
  padding: 10px;
}

.reply-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
  color: #00ffff;
  margin-bottom: 6px;
}

.reply-item p {
  margin: 0;
  color: #f7dfff;
  white-space: pre-wrap;
}

.reply-empty {
  margin: 0 0 10px;
  color: #00ffff;
  font-size: 0.9rem;
}

.reply-form {
  gap: 8px;
}

.reply-form textarea {
  min-height: 74px;
  resize: vertical;
}

.reaction-btn {
  background: #220a3f;
  color: #00ffff;
  border: 1px solid #ff00ff;
  padding: 6px 10px;
  border-radius: 999px;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--ui-font);
  font-size: 0.9rem;
}

.reaction-btn.active {
  background: #ff00ff;
  color: #060012;
}

.reaction-btn span {
  margin-left: 6px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .container {
    width: min(1100px, 100% - 20px);
  }

  .login-card {
    margin: 28px auto;
  }

  #invite-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .sidebar {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 320px);
    transform: translateX(-105%);
    transition: transform 220ms ease;
    z-index: 30;
    border-right: 2px solid #ff00ff;
    border-bottom: 0;
    padding: 16px;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 29;
    align-items: center;
    gap: 8px;
    background: #ff00ff;
    color: #000;
    border: 1px solid #00ffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }

  .sidebar-close {
    display: inline-flex;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(5, 0, 15, 0.68);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .tab-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .tab-btn {
    text-align: center;
    padding: 10px 6px;
  }

  .content {
    padding: 68px 16px 16px;
  }

  .news-composer {
    top: 72px;
  }

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

  .rsvp-options {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .rsvp-option {
    min-height: 100px;
    padding: 16px;
  }
}

@media (max-width: 560px) {
  .card {
    padding: 16px;
    border-radius: 12px;
  }

  .terminal-tag {
    font-size: 0.72rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .sidebar-title {
    font-size: 0.95rem;
  }

  .sidebar-user {
    font-size: 0.9rem;
  }

  .news-post-head,
  .reply-meta {
    flex-direction: column;
  }

  .post-action-btn {
    width: 100%;
    justify-content: center;
  }
}
