:root {
  --ink: #07111d;
  --panel: #0c1b2a;
  --panel-2: #102438;
  --paper: #f5f1e8;
  --muted: #9fb0bf;
  --red: #e12d39;
  --blue: #168eea;
  --yellow: #ffd45c;
  --line: #294157;
  --green: #39c98b;
  --display: "Barlow Condensed", sans-serif;
  --body: "Space Grotesk", sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  color: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--body);
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(41, 65, 87, 0.16) 50%, transparent 50.2%) 0 0 / 72px 72px,
    linear-gradient(transparent 49.8%, rgba(41, 65, 87, 0.13) 50%, transparent 50.2%) 0 0 / 72px 72px,
    radial-gradient(circle at 88% 3%, #123c61 0, transparent 31rem),
    linear-gradient(145deg, rgba(225, 45, 57, 0.07), transparent 30rem),
    var(--ink);
}

body::before {
  position: fixed;
  z-index: -1;
  top: 76px;
  right: -70px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 212, 92, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(22, 142, 234, 0.035), 0 0 0 64px rgba(22, 142, 234, 0.025);
  content: "";
}

button,
a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

a { color: inherit; }

.command-bar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 28px;
  padding: 0 max(18px, calc((100vw - 1440px) / 2));
  border-bottom: 4px solid var(--red);
  background: rgba(7, 17, 29, 0.97);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 0.9;
  text-decoration: none;
}

.brand small {
  display: block;
  color: var(--yellow);
  font-size: 12px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--red) 0 48%, #fff 48% 53%, var(--blue) 53%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

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

.command-bar nav a {
  padding: 13px 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.command-bar nav a:hover,
.command-bar nav a:focus-visible,
.command-bar nav a.active {
  color: var(--ink);
  background: var(--paper);
  outline: 0;
}

.server-badge {
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.server-badge i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.server-badge.ready { color: var(--green); }
.server-badge.error { color: #ff8590; }

.shell {
  width: min(1440px, 100%);
  margin: auto;
  padding: 56px 26px 100px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: end;
  gap: 42px;
  margin-bottom: 42px;
  animation: reveal-up 0.55s ease-out both;
}

.kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  text-transform: uppercase;
}

h1 {
  font-size: clamp(58px, 7.1vw, 102px);
  letter-spacing: -0.025em;
  line-height: 0.77;
}

h1 em {
  color: var(--yellow);
  font-style: italic;
}

.hero-copy > p:last-child {
  max-width: 750px;
  margin: 24px 0 0;
  color: #b3c1cc;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.65;
}

.hero-register {
  position: relative;
  padding: 21px 22px 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 6px solid var(--yellow);
  background: rgba(12, 27, 42, 0.88);
}

.hero-register::after {
  position: absolute;
  right: -28px;
  bottom: -47px;
  width: 110px;
  height: 110px;
  border: 12px solid rgba(22, 142, 234, 0.11);
  border-radius: 50%;
  content: "";
}

.hero-register span,
.hero-register small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.hero-register strong {
  display: block;
  margin: 5px 0;
  font-family: var(--display);
  font-size: 31px;
  letter-spacing: 0.06em;
}

.notice {
  margin: -12px 0 24px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  background: #10293e;
  font-size: 13px;
  line-height: 1.5;
}

.notice.error {
  border-left-color: var(--red);
  background: #351923;
}

.account-layout {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.account-rail {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.identity-card,
.stats-panel,
.ledger {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(16, 36, 56, 0.97), rgba(8, 23, 36, 0.99));
  box-shadow: 10px 12px 0 rgba(0, 0, 0, 0.18);
}

.identity-card {
  min-height: 407px;
  padding: 22px;
  animation: reveal-up 0.5s 0.08s ease-out both;
}

.identity-stripe,
.section-label {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: -22px -22px 24px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  color: #c8d4dd;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.identity-stripe span,
.section-label span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--ink);
  background: var(--red);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 900;
}

.identity-person {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.avatar-shell {
  position: relative;
  width: 82px;
  height: 82px;
}

.avatar-shell img,
.avatar-fallback {
  width: 82px;
  height: 82px;
  border: 3px solid var(--paper);
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--ink);
  background: linear-gradient(135deg, var(--yellow), #fff0aa);
  font-family: var(--display);
  font-size: 31px;
  font-weight: 900;
}

.avatar-shell i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: var(--green);
}

.identity-kicker {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.identity-person h2,
.signed-out-state h2 {
  font-size: 27px;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.profile-email {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.wallet {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-top: 24px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid rgba(255, 212, 92, 0.55);
  background: linear-gradient(110deg, rgba(255, 212, 92, 0.12), rgba(22, 142, 234, 0.08));
}

.wallet::after {
  position: absolute;
  top: -13px;
  right: 79px;
  width: 1px;
  height: 95px;
  background: rgba(255, 255, 255, 0.1);
  content: "";
  transform: rotate(22deg);
}

.wallet span,
.wallet small {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.wallet span { color: var(--yellow); }
.wallet small { grid-column: 1 / -1; margin-top: 4px; color: var(--muted); }

.wallet strong {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--paper);
  font-family: var(--display);
  font-size: 47px;
  line-height: 0.8;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 17px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 16px;
  border: 0;
  border-radius: 0;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.button.primary {
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--red);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: #ffe487;
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

.button.quiet {
  border: 1px solid var(--line);
  color: var(--paper);
  background: transparent;
}

.button.quiet:hover,
.button.quiet:focus-visible {
  border-color: var(--paper);
  outline: 0;
}

.signed-out-state {
  display: grid;
  justify-items: start;
}

.signed-out-state > p:not(.identity-kicker) {
  margin: 13px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.signed-out-state .avatar-fallback { margin-bottom: 19px; }

.google-signin {
  min-height: 44px;
  width: 100%;
  overflow: hidden;
}

.auth-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #ffb0b7;
  font-size: 10px;
}

.identity-loading {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding-top: 18px;
}

.skeleton,
.listing-skeleton > * {
  display: block;
  background: linear-gradient(90deg, #10263a 20%, #18344d 48%, #10263a 75%) 0 0 / 220% 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-avatar { width: 82px; height: 82px; }
.skeleton-line { width: 58%; height: 15px; }
.skeleton-line.wide { width: 88%; height: 27px; }

.stats-panel {
  padding: 22px;
  animation: reveal-up 0.5s 0.14s ease-out both;
}

.section-label { margin-bottom: 15px; }
.section-label span { background: var(--blue); }

.stats-grid {
  display: grid;
  gap: 0;
  margin: 0;
}

.stats-grid > div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid rgba(41, 65, 87, 0.72);
}

.stats-grid > div:last-child { border-bottom: 0; }

.stats-grid dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-grid dd {
  margin: 0;
  color: var(--yellow);
  font-family: var(--display);
  font-size: 27px;
  font-weight: 800;
}

.stats-grid small {
  grid-column: 1 / -1;
  color: #70869a;
  font-size: 9px;
}

.ledger {
  min-width: 0;
  padding: 25px;
  animation: reveal-up 0.5s 0.12s ease-out both;
}

.ledger-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.ledger-heading h2 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 0.9;
}

.ledger-key {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  white-space: nowrap;
}

.ledger-key i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
}

.listing-list {
  display: grid;
  gap: 13px;
  counter-reset: listing;
}

.listing-ticket {
  --delay: 0ms;
  position: relative;
  display: grid;
  grid-template-columns: 68px 132px minmax(0, 1fr) 154px;
  min-height: 166px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #091725;
  animation: ticket-in 0.45s calc(0.15s + var(--delay)) ease-out both;
}

.ticket-number {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  color: #587087;
  background:
    linear-gradient(180deg, rgba(22, 142, 234, 0.08), transparent),
    #07131f;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 900;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.ticket-number::before {
  margin-bottom: 9px;
  color: var(--red);
  font-size: 14px;
  content: "LOT";
}

.listing-photo {
  min-width: 0;
  margin: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(145deg, #173650, #07111d);
}

.listing-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(245, 241, 232, 0.2);
  font-family: var(--display);
  font-size: 38px;
  font-weight: 900;
}

.ticket-copy {
  min-width: 0;
  padding: 18px 20px;
}

.ticket-kicker {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ticket-copy h3 {
  max-width: 760px;
  margin-bottom: 17px;
  font-size: clamp(22px, 2.25vw, 31px);
  line-height: 0.98;
  text-transform: none;
  overflow-wrap: anywhere;
}

.ticket-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
}

.ticket-meta > div { min-width: 0; }

.ticket-meta dt {
  margin-bottom: 3px;
  color: #6f8598;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ticket-meta dd {
  margin: 0;
  overflow: hidden;
  color: #c7d2db;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-action {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 18px 15px;
  color: var(--ink);
  background: var(--yellow);
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.ticket-action::before,
.ticket-action::after {
  position: absolute;
  left: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #091725;
  content: "";
}

.ticket-action::before { top: 21px; }
.ticket-action::after { bottom: 21px; }

.ticket-action:hover,
.ticket-action:focus-visible {
  color: #fff;
  background: var(--red);
  outline: 0;
}

.ticket-action small {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.ticket-action strong {
  max-width: 120px;
  font-family: var(--display);
  font-size: 25px;
  line-height: 0.9;
  text-transform: uppercase;
}

.ticket-action span { font-size: 24px; }

.ticket-action.unavailable {
  color: #7e91a1;
  background: #132638;
}

.state-panel {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  min-height: 280px;
  align-items: center;
  border: 1px dashed #3c566d;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.015) 0 10px, transparent 10px 20px),
    rgba(7, 21, 33, 0.78);
}

.state-number {
  display: grid;
  height: 100%;
  place-items: center;
  border-right: 1px dashed #3c566d;
  color: #30495f;
  font-family: var(--display);
  font-size: 65px;
  font-weight: 900;
}

.state-panel > div { max-width: 540px; padding: 30px; }
.state-panel h3 { font-size: 34px; line-height: 0.95; }

.state-panel p:not(.kicker) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.inline-button { width: max-content; margin-top: 20px; }
.error-panel { border-color: rgba(225, 45, 57, 0.7); }
.error-panel .state-number { color: var(--red); border-right-color: rgba(225, 45, 57, 0.5); }

.listing-loading {
  display: grid;
  gap: 13px;
}

.listing-skeleton {
  display: grid;
  grid-template-columns: 68px 132px 1fr;
  height: 166px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #091725;
}

.listing-skeleton > * { border-right: 1px solid #233d53; }
.listing-skeleton > div:last-child { margin: 24px; height: 55%; border: 0; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 25px max(24px, calc((100vw - 1390px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

footer a { margin-left: 18px; }
footer a:hover { color: var(--yellow); }

[hidden] { display: none !important; }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ticket-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
  to { background-position: -220% 0; }
}

@media (max-width: 1060px) {
  .account-layout { grid-template-columns: 310px minmax(0, 1fr); }
  .listing-ticket { grid-template-columns: 54px 105px minmax(0, 1fr); }
  .ticket-action {
    grid-column: 2 / -1;
    grid-row: 2;
    min-height: 54px;
    grid-auto-flow: column;
  }
  .ticket-action::before,
  .ticket-action::after { display: none; }
  .ticket-action strong { max-width: none; }
  .ticket-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .command-bar {
    min-height: 72px;
    flex-wrap: wrap;
    gap: 8px 15px;
    padding: 10px 16px;
  }

  .command-bar nav {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .command-bar nav a { padding: 10px 4px; text-align: center; }
  .server-badge { margin-left: auto; }
  .shell { padding: 38px 16px 80px; }
  .hero { grid-template-columns: 1fr; margin-bottom: 30px; }
  .hero-register { display: none; }
  .account-layout { grid-template-columns: 1fr; }
  .account-rail { position: static; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr); }
  .identity-card { min-height: 0; }
  .ledger { padding: 20px; }
}

@media (max-width: 620px) {
  body::before { display: none; }
  .brand { font-size: 13px; }
  .brand-mark { width: 28px; height: 28px; }
  .server-badge span { display: none; }
  .command-bar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: clamp(54px, 16.5vw, 72px); }
  .hero-copy > p:last-child { margin-top: 19px; font-size: 14px; }
  .account-rail { grid-template-columns: 1fr; }
  .identity-card,
  .stats-panel,
  .ledger { box-shadow: 5px 7px 0 rgba(0, 0, 0, 0.18); }
  .ledger { margin-top: 4px; padding: 15px; }
  .ledger-heading { align-items: start; margin-bottom: 14px; padding-bottom: 15px; }
  .ledger-key { display: none; }
  .listing-ticket {
    grid-template-columns: 48px 88px minmax(0, 1fr);
    min-height: 0;
  }
  .ticket-number { grid-row: 1; font-size: 27px; }
  .listing-photo { grid-row: 1; min-height: 150px; }
  .ticket-copy { padding: 15px 13px; }
  .ticket-copy h3 { margin-bottom: 13px; font-size: 22px; }
  .ticket-meta { grid-template-columns: 1fr 1fr; gap: 9px; }
  .ticket-meta > div:nth-child(n + 5) { display: none; }
  .ticket-action { grid-column: 1 / -1; min-height: 58px; }
  .ticket-action small { display: none; }
  .state-panel { grid-template-columns: 68px minmax(0, 1fr); min-height: 280px; }
  .state-number { font-size: 44px; }
  .state-panel > div { padding: 23px 18px; }
  .state-panel h3 { font-size: 29px; }
  .listing-skeleton { grid-template-columns: 48px 88px 1fr; height: 160px; }
  footer { display: grid; padding-bottom: calc(28px + env(safe-area-inset-bottom)); line-height: 1.5; }
  footer a:first-child { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
