/* Final visual system. This file intentionally owns the presentation layer. */
:root {
  --shell-max: 1480px;
  --shell-gutter: clamp(16px, 2.4vw, 38px);
  --shell-gap: clamp(12px, 1.2vw, 18px);
  --left-rail-width: clamp(286px, 22vw, 352px);
  --right-tools-width: clamp(190px, 15vw, 240px);
  --panel-pad: clamp(20px, 2vw, 30px);
  --panel-radius: 24px;
  --card-radius: 16px;
  --control-radius: 14px;
  --surface-shell-blur: 32px;
  --surface-panel-blur: 30px;
  --surface-card-blur: 18px;
  --surface-control-blur: 14px;
  --surface-shell-bg: rgba(30, 25, 23, 0.47);
  --surface-panel-bg: rgba(28, 23, 21, 0.52);
  --surface-card-bg: rgba(255, 255, 255, 0.065);
  --surface-control-bg: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.17);
  --line-strong: rgba(255, 255, 255, 0.3);
  --shadow-shell: 0 18px 48px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --shadow-panel: 0 24px 62px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --ease-smooth: 170ms cubic-bezier(0.2, 0.75, 0.25, 1);
  --ease-liquid: 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  background: #080706;
}

.backdrop {
  background:
    linear-gradient(115deg, rgba(5, 4, 4, 0.67), rgba(14, 10, 8, 0.18) 48%, rgba(6, 5, 5, 0.56)),
    linear-gradient(180deg, rgba(255, 223, 182, 0.04), rgba(0, 0, 0, 0.5)),
    url("./assets/minecraft-upscaled-4k.webp") center / cover no-repeat;
}

.backdrop::before {
  opacity: 0.42;
  filter: blur(24px);
  animation-duration: 34s;
}

.app-frame {
  padding-top: clamp(16px, 2vw, 28px);
}

/* Header */
.hud {
  margin-bottom: clamp(18px, 2vw, 28px);
}

.identity,
.nav-tabs,
.hud-tools {
  min-height: 62px;
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  background: var(--surface-shell-bg);
  box-shadow: var(--shadow-shell);
  backdrop-filter: blur(var(--surface-shell-blur)) saturate(1.16);
  -webkit-backdrop-filter: blur(var(--surface-shell-blur)) saturate(1.16);
}

.identity {
  padding: 8px 10px;
}

.identity .avatar {
  width: 44px;
  height: 44px;
}

.brand-stack {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
}

.brand-stack > strong,
.brand-stack > span:not(.identity-status) {
  grid-column: 1;
}

.identity-status {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-tabs {
  padding: 6px;
  gap: 4px;
}

.nav-tab {
  min-height: 48px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.64);
  background: transparent;
}

.nav-tab:hover {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.07);
  transform: none;
}

.nav-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 20px rgba(0, 0, 0, 0.13);
}

.hud-tools {
  padding: 6px;
}

.view-as-trigger {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: none;
}

/* Page motion */
.view.view-enter {
  animation: polishedPageIn 280ms var(--ease-liquid) both;
}

@keyframes polishedPageIn {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.996);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

/* One strong outer surface; inner content stays quiet. */
.queue-panel,
.glass-panel,
.status-board,
.login-panel,
.profile-sheet,
.event-hero,
.event-feature-section,
.event-planets-section,
.event-footer-card,
.admin-section-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface-panel-bg);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(var(--surface-panel-blur)) saturate(1.12);
  -webkit-backdrop-filter: blur(var(--surface-panel-blur)) saturate(1.12);
}

.queue-panel::before,
.status-board::before,
.event-feature-section::before,
.event-planets-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
}

.queue-panel,
.status-board,
.admin-section-panel {
  padding: var(--panel-pad);
}

.view-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.32fr);
}

.side-summary {
  top: 16px;
  display: grid;
  gap: 14px;
}

.side-summary .panel-copy {
  margin: 0;
}

.side-summary-divider {
  height: 1px;
  margin: 4px 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent);
}

.side-status-copy {
  color: rgba(255, 255, 255, 0.68);
}

/* Forms: sections, not cards inside a card. */
.form-grid {
  gap: 22px 18px;
}

.form-section,
.application-mode-panel,
.staff-note-panel {
  padding: 22px 0 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.application-mode-panel .choice-grid {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.choice-card,
.inline-choice-row label,
input,
textarea,
select {
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: var(--control-radius);
  background: var(--surface-control-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(var(--surface-control-blur)) saturate(1.08);
  -webkit-backdrop-filter: blur(var(--surface-control-blur)) saturate(1.08);
}

.application-mode-panel .choice-card {
  min-height: 88px;
  padding: 16px;
  border-color: rgba(255, 255, 255, 0.13);
  background: var(--surface-control-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.choice-card:hover,
.application-mode-panel .choice-card:hover,
.inline-choice-row label:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.105);
  box-shadow: var(--shadow-card);
}

.choice-card:has(input:checked),
.application-mode-panel .choice-card:has(input:checked),
.inline-choice-row label:has(input:checked) {
  border-color: rgba(255, 225, 183, 0.38);
  background: rgba(255, 244, 225, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 26px rgba(0, 0, 0, 0.13);
}

input:hover,
textarea:hover,
select:hover,
input:focus,
textarea:focus,
select:focus {
  transform: none;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 0 0 3px rgba(255, 228, 190, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Buttons share one shape and one motion language. */
.command,
.segmented button,
.metric-button,
.priority-review-toggle,
.priority-review-item,
.archive-event-toggle,
.status-chip-action,
.view-as-menu button {
  border-radius: var(--control-radius);
  transition: transform var(--ease-smooth), border-color var(--ease-smooth), background-color var(--ease-smooth), box-shadow var(--ease-smooth), color var(--ease-smooth);
}

.command {
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 8px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(var(--surface-control-blur)) saturate(1.08);
  -webkit-backdrop-filter: blur(var(--surface-control-blur)) saturate(1.08);
}

.command:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.125);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  filter: none;
}

.command:active,
.nav-tab:active,
.choice-card:active {
  transform: translateY(0) scale(0.985);
}

.command.primary,
.command.success {
  background: rgba(255, 247, 232, 0.11);
}

.command.danger {
  color: rgba(255, 234, 234, 0.94);
  border-color: rgba(179, 64, 72, 0.24);
  background: rgba(98, 24, 30, 0.12);
}

.command.danger:hover {
  border-color: rgba(225, 106, 112, 0.44);
  background: rgba(130, 35, 42, 0.2);
}

.logout-button,
.icon-command {
  flex-basis: 46px;
  min-width: 46px;
  max-width: 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

/* Home composition: varied rhythm without extra decoration. */
.home-experience {
  gap: var(--shell-gap);
}

.home-stage {
  min-height: clamp(430px, 58vh, 620px);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.52fr);
  padding: clamp(28px, 4vw, 58px);
  border-radius: 28px;
  box-shadow: 0 30px 78px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.home-stage::before {
  background:
    linear-gradient(112deg, rgba(8, 5, 4, 0.68), rgba(8, 5, 4, 0.08) 58%, rgba(5, 4, 4, 0.48)),
    linear-gradient(180deg, rgba(255, 241, 220, 0.02), rgba(0, 0, 0, 0.34)),
    url("./assets/tatooine-minimal-hero.webp") center / cover no-repeat;
}

.home-stage h1 {
  max-width: 10ch;
  font-size: clamp(4rem, 9vw, 7.6rem);
  line-height: 0.9;
}

.home-stage p {
  max-width: 58ch;
  margin-top: 20px;
}

.home-stage-actions {
  gap: 10px;
}

.home-action-primary,
.home-action-secondary {
  min-height: 76px;
  border-radius: 18px;
}

.home-info-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.home-status-panel {
  min-height: 184px;
  padding: var(--panel-pad);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface-panel-bg);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(var(--surface-panel-blur)) saturate(1.12);
  -webkit-backdrop-filter: blur(var(--surface-panel-blur)) saturate(1.12);
}

.home-status-panel:nth-child(1),
.home-status-panel:nth-child(4) {
  grid-column: span 7;
}

.home-status-panel:nth-child(2),
.home-status-panel:nth-child(3) {
  grid-column: span 5;
}

.home-status-panel:nth-child(n) {
  background: var(--surface-panel-bg);
}

.home-status-panel:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.24);
  filter: none;
}

/* Planet cards carry the color; surrounding controls do not. */
.planet-card {
  min-height: 164px;
  border-radius: 18px;
}

.planet-card.tatooine,
.event-planet-card.tatooine,
.event-planet-banner.tatooine {
  --planet-art: url("./assets/planet-tatooine-card.webp");
}

.planet-card.hoth,
.event-planet-card.hoth,
.event-planet-banner.hoth {
  --planet-art: url("./assets/planet-hoth-card.webp");
}

.planet-card.mustafar,
.event-planet-card.mustafar,
.event-planet-banner.mustafar {
  --planet-art: url("./assets/planet-mustafar-card.webp");
}

.roster-group.tatooine .roster-group-art { background-image: url("./assets/planet-tatooine-card.webp"); }
.roster-group.hoth .roster-group-art { background-image: url("./assets/planet-hoth-card.webp"); }
.roster-group.mustafar .roster-group-art { background-image: url("./assets/planet-mustafar-card.webp"); }

/* Quiet data rows instead of card stacks. */
.detail-grid,
.personal-detail-grid {
  gap: 0 22px;
}

.detail-block {
  padding: 16px 2px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.planet-capacity-row,
.queue-row,
.audit-preview-item,
.audit-modal-entry,
.priority-review-item,
.roster-group {
  border-radius: var(--card-radius);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.queue-row:hover,
.priority-review-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.09);
}

/* Profile is one sheet with divided accordion rows. */
.profile-sheet {
  gap: 0;
  padding: 14px;
  border-radius: 24px;
}

.profile-sheet-head {
  margin-bottom: 8px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: none;
}

.profile-box {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.profile-box + .profile-box {
  margin-top: 0;
}

.profile-box:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.025);
}

.profile-box-toggle {
  min-height: 62px;
  padding-inline: 12px;
}

.profile-rank-hero,
.profile-fact,
.profile-history-item,
.profile-alert-note {
  border-radius: var(--card-radius);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

/* Event page */
.event-page-body {
  background:
    linear-gradient(180deg, rgba(8, 6, 5, 0.44), rgba(7, 6, 6, 0.72)),
    url("./assets/tatooine-minimal-hero.webp") center / cover fixed no-repeat;
}

.event-page {
  gap: var(--shell-gap);
}

.event-hero {
  border-radius: 28px;
}

.event-grid {
  gap: var(--shell-gap);
}

.event-card,
.event-feature-card {
  border-radius: var(--card-radius);
}

.event-feature-card {
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.event-planet-card {
  border-radius: 18px;
}

/* Responsive */
@media (max-width: 1180px) {
  .home-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-status-panel:nth-child(n) {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  .identity,
  .nav-tabs,
  .hud-tools {
    border-radius: 18px;
  }

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

  .identity-status {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .home-info-grid,
  .home-stage,
  .view-grid {
    grid-template-columns: 1fr;
  }

  .home-stage {
    min-height: 560px;
    padding: 24px;
  }

  .home-stage h1 {
    font-size: clamp(3.7rem, 18vw, 5.6rem);
  }

  .side-summary {
    position: static;
  }

  .form-section,
  .application-mode-panel {
    padding-top: 18px;
  }

  .profile-sheet {
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view.view-enter {
    animation: none;
  }
}
