:root {
  --pink: #FFB6E1;
  --pink-light: #FFE3F3;
  --pink-deep: #F28CC6;
  --yellow: #FFF08B;
  --yellow-deep: #EBCF45;
  --lavender: #C8CCF7;
  --lavender-light: #E6E8FC;
  --lavender-deep: #8E96E8;
  --text: #2D1B36;
  --text-soft: #5E4A68;
  --card: rgba(255, 255, 255, 0.74);
  --card-border: rgba(255, 255, 255, 0.9);
  --shadow: 0 12px 32px rgba(140, 60, 120, 0.16);
  --shadow-sm: 0 4px 14px rgba(140, 60, 120, 0.12);
  --radius-lg: 28px;
  --radius: 20px;
  --radius-sm: 14px;
  --font-title: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tabbar-height: 64px;
  --ink: #2D1B36;
  --surface: #FFFFFF;
  --input-bg: #FFF7FC;
  --input-border: #EED3E6;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--pink);
  background-image:
    radial-gradient(circle at 50% 0%, var(--yellow) 0, transparent 420px),
    radial-gradient(circle at 0% 55%, color-mix(in srgb, var(--lavender) 60%, transparent) 0, transparent 340px),
    radial-gradient(circle at 100% 85%, color-mix(in srgb, var(--lavender) 55%, transparent) 0, transparent 320px);
  background-repeat: no-repeat;
  padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 32px);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--lavender-deep);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.announcement {
  display: block;
  padding: 12px 20px;
  background: var(--yellow);
  color: var(--text);
  text-align: center;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

a.announcement[href] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.hero {
  text-align: center;
  padding: calc(36px + env(safe-area-inset-top)) 20px 12px;
}

.logo {
  width: 150px;
  height: 150px;
  margin: 0 auto 16px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #FFFFFF;
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--yellow) 55%, transparent), var(--shadow);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.15;
}

.tagline {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-weight: 700;
}

.section {
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 16px 8px;
}

.section-title {
  margin: 0 0 4px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.5rem;
}

.section-sub {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-weight: 600;
}

.section-title + .links,
.section-title + .events {
  margin-top: 14px;
}

.placeholder {
  margin: 0;
  padding: 18px;
  text-align: center;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--card);
  border-radius: var(--radius);
}

.links {
  display: grid;
  gap: 12px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 18px 10px 10px;
  background: var(--card);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.link-card:hover,
.link-card:active {
  background: var(--yellow);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(235, 207, 69, 0.45);
}

.link-icon {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--lavender-light);
  font-size: 1.3rem;
}

.link-title {
  flex: 1;
}

.link-arrow {
  color: var(--text-soft);
  font-size: 1.2rem;
}

.events {
  display: grid;
  gap: 18px;
}

.event-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.event-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--lavender-light);
}

.event-body {
  padding: 18px;
}

.event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.event-tags:empty {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
}

.chip-live {
  background: #FFE1E6;
  color: #A3123A;
}

.event-title {
  margin: 0 0 8px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.25;
}

.event-card.is-child .event-title {
  font-size: 1.1rem;
}

.event-meta {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 4px;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.95rem;
}

.event-meta li {
  display: flex;
  gap: 8px;
}

.event-desc {
  margin: 0;
  white-space: pre-line;
}

.event-desc.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-toggle {
  margin-top: 4px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.capacity {
  margin-top: 14px;
}

.capacity-text {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 0.9rem;
}

.capacity-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--lavender-light);
  overflow: hidden;
}

.capacity-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lavender-deep), var(--pink-deep));
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.event-actions:empty {
  display: none;
}

.stream {
  margin-top: 14px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--text);
}

.stream iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.event-children {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-left: 12px;
  border-left: 3px dashed var(--lavender-deep);
}

.children-title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--text-soft);
}

.event-card.is-child {
  background: var(--pink-light);
  box-shadow: none;
  border-radius: var(--radius);
}

.event-card.is-child .event-body {
  padding: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(2px);
}

.btn-primary {
  background: var(--yellow);
  box-shadow: 0 4px 0 var(--yellow-deep);
}

.btn-primary:active:not(:disabled) {
  box-shadow: 0 2px 0 var(--yellow-deep);
}

.btn-secondary {
  background: var(--lavender);
  box-shadow: 0 4px 0 var(--lavender-deep);
}

.btn-secondary:active:not(:disabled) {
  box-shadow: 0 2px 0 var(--lavender-deep);
}

.btn:disabled,
.btn-disabled {
  background: #F1EAF0;
  color: var(--text-soft);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filters:empty {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 6px 16px;
  border: 2px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-chip.is-active {
  background: var(--text);
  border-color: var(--text);
  color: #FFFFFF;
}

.perks {
  display: grid;
  gap: 12px;
}

.perk-card {
  padding: 16px 18px;
  background: var(--card);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

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

.perk-name {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.15rem;
}

.perk-category {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.85rem;
}

.perk-discount {
  flex: 0 0 auto;
  max-width: 55%;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--yellow);
  font-weight: 800;
  font-size: 0.85rem;
  text-align: center;
}

.perk-address {
  display: inline-flex;
  gap: 6px;
  margin-top: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  text-underline-offset: 3px;
}

.games {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 18px;
  scrollbar-width: thin;
}

.games > .placeholder {
  grid-column: 1 / -1;
  width: 100%;
}

.game-card {
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.game-cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--lavender-light);
}

.game-cover-fallback {
  display: grid;
  place-items: center;
  font-size: 3rem;
}

.game-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
}

.game-title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.2rem;
}

.game-team {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.9rem;
}

.game-body .btn {
  margin-top: auto;
}

.footer {
  max-width: 600px;
  margin: 40px auto 0;
  padding: 0 16px;
  text-align: center;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.9rem;
}

.footer p {
  margin: 0 0 6px;
}

.footer-admin {
  font-size: 0.8rem;
  opacity: 0.75;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  width: min(560px, calc(100% - 24px));
  height: var(--tabbar-height);
  padding: 6px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid var(--card-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.72rem;
  transition: background-color 0.15s ease;
}

.tabbar a span {
  font-size: 1.15rem;
  line-height: 1;
}

.tabbar a.is-active {
  background: var(--yellow);
}

.dialog {
  width: min(480px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  color: var(--text);
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.dialog::backdrop {
  background: rgba(45, 27, 54, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.dialog-form {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--pink-light);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-kicker {
  margin: 0;
  color: var(--text-soft);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dialog-title {
  margin: -8px 48px 0 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.2;
}

.dialog-meta {
  margin: -6px 0 4px;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.9rem;
}

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  font-weight: 800;
  font-size: 0.95rem;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 2px solid #EED3E6;
  border-radius: var(--radius-sm);
  background: #FFF7FC;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
}

.field input:focus {
  border-color: var(--lavender-deep);
  outline: none;
  box-shadow: 0 0 0 4px var(--lavender-light);
}

.field-hint {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.82rem;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
}

.consent input {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--pink-deep);
}

.form-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #FFE1E6;
  color: #8A1033;
  font-weight: 800;
  font-size: 0.9rem;
}

.btn-discord {
  background: #4752C4;
  color: #FFFFFF;
  box-shadow: 0 4px 0 #333C99;
}

.btn-discord:active:not(:disabled) {
  box-shadow: 0 2px 0 #333C99;
}

.login-text {
  margin: 0;
  color: var(--text-soft);
  font-weight: 700;
}

.connected-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--lavender-light);
  font-weight: 700;
  font-size: 0.9rem;
}

.connected-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3BA55D;
}

.link-button {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--pink-light);
}

.segment {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
}

.segment[aria-pressed="true"] {
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.segment:disabled {
  color: var(--text-soft);
  opacity: 0.55;
  cursor: not-allowed;
}

.mode-hint {
  margin: -4px 0 0;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.88rem;
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 1.2rem !important;
  text-align: center;
}

.dialog-success {
  text-align: center;
  justify-items: center;
}

.dialog-success .dialog-title {
  margin: 0;
}

.success-emoji {
  margin: 8px 0 0;
  font-size: 3rem;
  line-height: 1;
}

.success-text {
  margin: 0;
  color: var(--text-soft);
  font-weight: 700;
}

.code-box {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--yellow);
}

.code-value {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: 0.25em;
  padding-left: 0.25em;
}

.registered-box {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #DDF5E7;
  color: #1D5C38;
  font-weight: 800;
}

.registered-box small {
  font-weight: 700;
  font-size: 0.85rem;
}

.registered-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.registered-code strong {
  padding: 2px 10px;
  border-radius: 8px;
  background: #FFFFFF;
  letter-spacing: 0.2em;
}

.registered-code button {
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: #FFFFFF;
  color: #1D5C38;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.team-list {
  margin-top: 14px;
}

.team-list-title {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 0.9rem;
}

.team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lavender-light);
  font-weight: 700;
  font-size: 0.82rem;
}

.team-chip.is-full {
  background: #ECE8EE;
  color: var(--text-soft);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 28px);
  z-index: 30;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--text);
  color: #FFFFFF;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 560px) {
  .dialog {
    width: 100%;
    max-width: 100%;
    margin: auto auto 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

@media (min-width: 900px) {
  .hero h1 {
    font-size: 2.4rem;
  }

  .section {
    max-width: 980px;
  }

  .links,
  .perks {
    grid-template-columns: repeat(2, 1fr);
  }

  .links > .placeholder,
  .perks > .placeholder {
    grid-column: 1 / -1;
  }

  .events {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }

  .events > .placeholder {
    grid-column: 1 / -1;
  }

  .games {
    grid-auto-columns: calc((100% - 28px) / 3);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

.hero {
  position: relative;
}

.theme-toggle {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--card-border);
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.discord-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--lavender-light);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
}

.discord-note svg {
  flex: 0 0 22px;
  color: #5865F2;
}

.btn-primary,
.btn-secondary,
.chip,
.perk-discount,
.code-box,
.announcement,
.tabbar a.is-active,
.link-card:hover,
.link-card:active,
.link-card:hover .link-arrow,
.link-card:active .link-arrow {
  color: var(--ink);
}

.event-card,
.game-card,
.dialog {
  background: var(--surface);
}

.field input {
  background: var(--input-bg);
  border-color: var(--input-border);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --pink-light: #3A2645;
  --pink-deep: #FF8FCF;
  --lavender-light: #2F2A4C;
  --text: #F8EAF3;
  --text-soft: #CDB7D6;
  --card: rgba(50, 33, 60, 0.82);
  --card-border: rgba(255, 182, 225, 0.16);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --surface: #2B1D34;
  --input-bg: #21162A;
  --input-border: #4A3354;
}

html[data-theme="dark"] body {
  background-color: #1C1223;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 240, 139, 0.16) 0, transparent 420px),
    radial-gradient(circle at 0% 55%, rgba(255, 182, 225, 0.14) 0, transparent 340px),
    radial-gradient(circle at 100% 85%, rgba(200, 204, 247, 0.12) 0, transparent 320px);
}

html[data-theme="dark"] .logo {
  border-color: #3A2645;
}

html[data-theme="dark"] .tabbar {
  background: rgba(43, 29, 52, 0.92);
}

html[data-theme="dark"] .chip-live,
html[data-theme="dark"] .form-error {
  background: #4A1F2E;
  color: #FFC2D1;
}

html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .btn-disabled {
  background: #3A2C42;
  color: var(--text-soft);
}

html[data-theme="dark"] .filter-chip.is-active {
  background: #FFB6E1;
  border-color: #FFB6E1;
  color: var(--ink);
}

html[data-theme="dark"] .toast {
  background: #FFF08B;
  color: var(--ink);
}

html[data-theme="dark"] .registered-box {
  background: #1C3527;
  color: #A6EBC2;
}

html[data-theme="dark"] .registered-code strong,
html[data-theme="dark"] .registered-code button {
  background: #132519;
  color: #A6EBC2;
}

html[data-theme="dark"] .team-chip.is-full {
  background: #3A2C42;
}

html[data-theme="dark"] .segment[aria-pressed="true"] {
  background: #4A3354;
}

html[data-theme="dark"] .stream {
  background: #000000;
}

html[data-theme="dark"] .placeholder {
  background: var(--card);
}

html[data-theme="dark"] .discord-note svg {
  color: #8C95FF;
}

html[data-theme="dark"] .logo {
  box-shadow: 0 0 0 10px rgba(255, 182, 225, 0.22), var(--shadow);
}

.unregister-button {
  justify-self: start;
  margin-top: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  opacity: 0.85;
}

.consent a {
  color: inherit;
  font-weight: 800;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.footer-links .footer-admin {
  font-size: inherit;
}

.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 16px 48px;
}

.legal-back {
  display: inline-flex;
  margin-bottom: 18px;
  font-weight: 800;
  text-underline-offset: 3px;
}

.legal-page h1 {
  margin: 0 0 6px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.9rem;
}

.legal-updated {
  margin: 0 0 20px;
  color: var(--text-soft);
  font-weight: 700;
}

.legal-card {
  margin-bottom: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.legal-card h2 {
  margin: 0 0 10px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.25rem;
}

.legal-card p,
.legal-card li {
  margin: 0 0 8px;
}

.legal-card ul {
  margin: 0;
  padding-left: 20px;
}

.legal-missing {
  padding: 0 6px;
  border-radius: 6px;
  background: var(--yellow);
  color: var(--ink);
  font-style: italic;
}

.btn-share {
  background: var(--card);
  border: 2px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.event-card.is-child .btn-share {
  background: var(--surface);
}

.event-card {
  transition: box-shadow 0.3s ease;
}

.event-card.is-highlighted {
  box-shadow: 0 0 0 4px var(--yellow), var(--shadow);
}

.footer-seo {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.8;
}

html {
  scroll-padding-top: 76px;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 25;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.appbar.is-scrolled {
  border-bottom-color: var(--card-border);
  box-shadow: 0 6px 20px rgba(45, 27, 54, 0.08);
}

.appbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 980px;
  height: 60px;
  margin: 0 auto;
  padding: 0 14px;
}

.appbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.appbar.is-scrolled .appbar-brand {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.appbar-brand img {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--card-border);
}

.appbar-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appbar-nav {
  display: none;
}

.theme-toggle {
  position: static;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  margin-left: auto;
  font-size: 1.15rem;
}

.hero {
  padding-top: 8px;
}

.event-card.is-summary {
  display: flex;
  flex-direction: column;
}

.event-card.is-summary .event-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.event-card.is-summary .event-actions {
  margin-top: auto;
  padding-top: 16px;
}

.event-summary-desc {
  margin: 0;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-program {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--lavender-light);
  font-weight: 800;
  font-size: 0.85rem;
  align-self: flex-start;
}

.btn-details {
  background: transparent;
  border: 2px solid var(--input-border);
  color: var(--text);
  box-shadow: none;
}

.btn-details:hover {
  background: var(--lavender-light);
}

.drawer {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 100%;
  height: 92dvh;
  max-height: 92dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: drawer-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.drawer::backdrop {
  background: rgba(45, 27, 54, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.drawer-header {
  position: relative;
  flex: 0 0 auto;
  padding: 20px 64px 14px 20px;
  border-bottom: 1px solid var(--card-border);
}

.drawer-header::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: var(--input-border);
  transform: translateX(-50%);
}

.drawer-kicker {
  margin: 0;
  color: var(--text-soft);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.drawer-title {
  margin: 2px 0 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.2;
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--pink-light);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0 calc(24px + env(safe-area-inset-bottom));
}

.drawer-body > .event-card {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.drawer-body > .event-card > .event-body > .event-title {
  display: none;
}

@keyframes drawer-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes drawer-left {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (min-width: 900px) {
  body {
    padding-bottom: 40px;
  }

  .tabbar {
    display: none;
  }

  .appbar-nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
  }

  .appbar-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
  }

  .appbar-nav a:hover {
    background: var(--lavender-light);
  }

  .appbar-nav a.is-active {
    background: var(--yellow);
    color: var(--ink);
  }

  .theme-toggle {
    margin-left: 8px;
  }

  .toast {
    bottom: 28px;
  }

  .drawer {
    inset: 0 0 0 auto;
    width: min(540px, 100%);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  }

  .drawer[open] {
    animation-name: drawer-left;
  }

  .drawer-header::before {
    display: none;
  }

  .drawer-header {
    padding-top: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer[open] {
    animation: none;
  }
}

.registered-pill {
  background: #DDF5E7;
  color: #1D5C38;
  box-shadow: none;
}

html[data-theme="dark"] .registered-pill {
  background: #1C3527;
  color: #A6EBC2;
}

.hero {
  padding-top: 28px;
}
