:root {
  --bg: #020505;
  --panel: rgba(4, 13, 12, 0.58);
  --panel-strong: rgba(6, 21, 17, 0.82);
  --text: #f5fbf6;
  --muted: rgba(232, 248, 240, 0.68);
  --soft: rgba(232, 248, 240, 0.42);
  --line: rgba(207, 255, 231, 0.18);
  --line-strong: rgba(163, 255, 211, 0.54);
  --jade: #64ffbd;
  --jade-deep: #155b42;
  --amber: #f0b356;
  --danger: #ff7a57;
  color-scheme: dark;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 52% 42%, rgba(100, 255, 189, 0.13), transparent 34rem),
    radial-gradient(circle at 78% 18%, rgba(240, 179, 86, 0.08), transparent 22rem),
    linear-gradient(180deg, #010303 0%, #07100f 52%, #020404 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 100% 8rem, 8rem 100%;
  mask-image: radial-gradient(circle at 50% 46%, #000 0 52%, transparent 76%);
}

a,
button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 28px 36px;
  pointer-events: none;
}

.brand,
.site-header nav,
.auction-panel,
.stage-control,
.bid-dock,
.system-bar {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 1px solid var(--jade);
  transform: rotate(45deg);
  box-shadow: 0 0 24px rgba(100, 255, 189, 0.5);
}

.site-header nav {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid rgba(207, 255, 231, 0.14);
  background: rgba(3, 8, 8, 0.52);
  backdrop-filter: blur(20px);
}

.site-header nav a,
.nav-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.site-header nav a:hover,
.nav-button:hover,
.nav-button[aria-pressed="true"] {
  color: var(--text);
  text-shadow: 0 0 16px rgba(100, 255, 189, 0.56);
}

.auction-shell {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(280px, 25vw) minmax(300px, 1fr) minmax(280px, 24vw);
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 18px;
  width: 100vw;
  min-height: 100vh;
  padding: 104px 40px 32px;
}

.auction-panel,
.stage-control,
.bid-dock,
.system-bar {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(24px);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.26);
}

.auction-panel {
  min-width: 0;
}

.status-panel {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.panel-heading span,
.timer-block span,
dt,
.bid-price span,
.bid-meta span,
.stage-readout span,
.system-bar span,
.egg-card small,
.egg-card em {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel-heading strong,
#lotState,
#connectionStatus {
  flex: 0 0 auto;
  border: 1px solid rgba(100, 255, 189, 0.35);
  padding: 6px 9px;
  color: var(--jade);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 340px;
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(34px, 3.5vw, 56px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: 0;
}

p {
  margin: 20px 0 0;
  max-width: 410px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.timer-block {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 15px;
  align-items: center;
  margin-top: 26px;
}

.timer-ring {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(100, 255, 189, 0.35);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(100, 255, 189, 0.09), transparent 62%),
    conic-gradient(from -90deg, rgba(100, 255, 189, 0.82), rgba(100, 255, 189, 0.22), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 32px rgba(100, 255, 189, 0.14);
}

.timer-ring span {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.timer-block strong {
  display: block;
  margin-top: 9px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 27px;
  font-weight: 400;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 26px 0 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.status-grid div {
  min-width: 0;
  padding: 16px;
  background: rgba(4, 12, 11, 0.86);
}

dt {
  margin-bottom: 8px;
}

dd {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 23px;
}

.stage-control {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  align-self: end;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(200px, 0.65fr);
  gap: 16px;
  align-items: center;
  width: min(720px, 100%);
  padding: 14px;
  background: rgba(4, 12, 11, 0.68);
}

.stage-readout strong {
  display: block;
  margin-top: 6px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 21px;
  font-weight: 400;
}

.stage-chip-row,
.increment-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-chip-row {
  min-width: 0;
  max-width: 340px;
  overflow-x: auto;
  scrollbar-width: none;
}

.stage-chip-row::-webkit-scrollbar {
  display: none;
}

.stage-chip,
.increment-button {
  min-width: 46px;
  min-height: 38px;
  border: 1px solid rgba(207, 255, 231, 0.18);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  cursor: pointer;
}

.stage-chip {
  flex: 0 0 42px;
}

.stage-chip:hover,
.stage-chip.active,
.increment-button:hover,
.increment-button.active {
  border-color: rgba(100, 255, 189, 0.64);
  color: var(--jade);
  box-shadow: 0 0 24px rgba(100, 255, 189, 0.16);
}

.smash-button,
.bid-button {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border: 1px solid rgba(240, 179, 86, 0.72);
  background:
    linear-gradient(180deg, rgba(240, 179, 86, 0.24), rgba(80, 30, 8, 0.3)),
    rgba(12, 7, 4, 0.72);
  color: #ffe0ac;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.smash-button:hover,
.bid-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 216, 144, 0.92);
  box-shadow: 0 0 30px rgba(240, 179, 86, 0.18);
}

.hammer-icon {
  width: 19px;
  height: 19px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(-45deg);
}

.egg-panel {
  grid-column: 3;
  grid-row: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  max-height: min(660px, calc(100vh - 146px));
  padding: 18px;
}

.egg-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 255, 189, 0.45) transparent;
}

.egg-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid rgba(207, 255, 231, 0.13);
  background: rgba(3, 10, 9, 0.45);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 220ms ease,
    background 220ms ease,
    transform 220ms ease,
    box-shadow 220ms ease;
}

.egg-card:hover,
.egg-card.active {
  border-color: rgba(100, 255, 189, 0.64);
  background: rgba(15, 45, 35, 0.64);
  transform: translateX(-5px);
  box-shadow: 0 0 34px rgba(100, 255, 189, 0.12);
}

.egg-card.revealed {
  border-color: rgba(240, 179, 86, 0.48);
}

.egg-number {
  display: grid;
  grid-row: 1 / span 2;
  align-self: center;
  place-items: center;
  width: 36px;
  height: 44px;
  border: 1px solid rgba(100, 255, 189, 0.28);
  border-radius: 50% 50% 45% 45%;
  background:
    radial-gradient(circle at 42% 26%, rgba(255, 255, 255, 0.34), transparent 18%),
    linear-gradient(150deg, rgba(100, 255, 189, 0.24), rgba(3, 24, 18, 0.86));
  color: var(--jade);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.egg-copy {
  min-width: 0;
  overflow: hidden;
}

.egg-card strong {
  display: -webkit-box;
  max-height: 2.36em;
  overflow: hidden;
  color: var(--text);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.egg-card small,
.egg-card em {
  display: block;
  margin-top: 5px;
  font-style: normal;
  line-height: 1.1;
  white-space: nowrap;
}

.egg-card em {
  grid-column: 2;
  min-width: 42px;
  color: var(--soft);
  text-align: left;
}

.egg-card.revealed em {
  color: var(--amber);
}

.egg-card[data-category="天赋"].revealed {
  border-color: rgba(240, 179, 86, 0.58);
}

.egg-card[data-category="能力"].revealed {
  border-color: rgba(100, 255, 189, 0.68);
}

.egg-card[data-category="技能"].revealed {
  border-color: rgba(143, 199, 255, 0.62);
}

.egg-card[data-category="人生"].revealed {
  border-color: rgba(255, 122, 167, 0.66);
}

.egg-card[data-category="高光"].revealed {
  border-color: rgba(255, 225, 109, 0.66);
}

.egg-card[data-category="神技"].revealed {
  border-color: rgba(155, 255, 209, 0.72);
}

.egg-card[data-category="身体"].revealed {
  border-color: rgba(255, 122, 167, 0.66);
}

.bid-dock {
  grid-column: 1 / 4;
  grid-row: 3;
  justify-self: center;
  align-self: end;
  display: grid;
  grid-template-columns: 160px auto 180px 130px;
  gap: 16px;
  align-items: center;
  min-width: min(890px, calc(100vw - 72px));
  min-height: 70px;
  padding: 12px 16px;
}

.bid-price strong,
.bid-meta strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 400;
}

.increment-button {
  min-width: 76px;
}

.bid-button {
  min-height: 48px;
  border-color: rgba(100, 255, 189, 0.58);
  background:
    linear-gradient(180deg, rgba(100, 255, 189, 0.22), rgba(16, 70, 50, 0.38)),
    rgba(4, 18, 14, 0.72);
  color: var(--jade);
}

.bid-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
}

.ledger-panel {
  grid-column: 3;
  grid-row: 2;
  align-self: start;
  justify-self: stretch;
  width: auto;
  padding: 16px;
  transform: translateY(-6px);
}

.record-list {
  display: grid;
  gap: 9px;
  max-height: 132px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-width: none;
}

.record-list::-webkit-scrollbar {
  display: none;
}

.record-list li {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(207, 255, 231, 0.1);
  color: var(--muted);
  font-size: 12px;
}

.record-list strong {
  color: var(--text);
  font-weight: 800;
}

.system-bar {
  display: none;
  position: fixed;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 0 16px;
  background: rgba(4, 12, 11, 0.54);
}

#systemMessage {
  color: var(--text);
}

.is-pulsing {
  animation: pulseBorder 460ms ease;
}

@keyframes pulseBorder {
  0% {
    box-shadow: 0 0 0 rgba(240, 179, 86, 0);
  }

  42% {
    box-shadow: 0 0 42px rgba(240, 179, 86, 0.44);
  }

  100% {
    box-shadow: 0 0 0 rgba(240, 179, 86, 0);
  }
}

@media (max-width: 1180px) {
  .auction-shell {
    grid-template-columns: minmax(260px, 32vw) 1fr;
    grid-template-rows: minmax(0, 1fr) auto auto;
    padding-right: 28px;
    padding-left: 28px;
  }

  .egg-panel {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin-top: 0;
  }

  .stage-control {
    grid-column: 1 / 3;
    grid-template-columns: 1fr auto minmax(190px, 0.5fr);
  }

  .bid-dock {
    grid-column: 1 / 3;
    grid-row: 3;
    transform: none;
  }

  .ledger-panel {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    transform: none;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  #scene {
    height: 62vh;
  }

  .site-header {
    align-items: start;
    padding: 18px 20px;
  }

  .brand {
    max-width: 210px;
    font-size: 11px;
  }

  .site-header nav {
    position: absolute;
    top: 58px;
    left: 20px;
    gap: 0;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .site-header nav a {
    display: none;
  }

  .nav-button {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(207, 255, 231, 0.2);
    background: rgba(3, 8, 8, 0.62);
    backdrop-filter: blur(18px);
    font-size: 10px;
    white-space: nowrap;
  }

  .auction-shell {
    display: flex;
    flex-direction: column;
    width: auto;
    height: auto;
    min-height: 100vh;
    padding: 48vh 20px 132px;
  }

  .auction-panel,
  .stage-control,
  .bid-dock {
    width: 100%;
  }

  .status-panel {
    order: 1;
    padding: 18px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .panel-heading strong,
  #lotState,
  #connectionStatus {
    max-width: 96px;
    text-align: center;
  }

  h1 {
    max-width: min(310px, 100%);
    font-size: clamp(32px, 8.8vw, 38px);
    line-height: 1.02;
  }

  p {
    max-width: none;
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.6;
  }

  .timer-block {
    grid-template-columns: 66px 1fr;
    gap: 12px;
    margin-top: 20px;
  }

  .timer-ring {
    width: 66px;
    height: 66px;
  }

  .timer-ring span {
    font-size: 15px;
  }

  .timer-block strong {
    font-size: 24px;
  }

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

  .egg-panel {
    order: 2;
    margin: 0;
  }

  .egg-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
  }

  .egg-list::-webkit-scrollbar {
    width: 4px;
  }

  .egg-card {
    grid-template-columns: 46px minmax(0, 1fr);
    min-width: 0;
  }

  .egg-card em {
    grid-column: 2;
    text-align: left;
  }

  .stage-control {
    order: 3;
    display: grid;
    grid-template-columns: 1fr;
  }

  .stage-chip-row {
    justify-content: flex-start;
  }

  .bid-dock {
    order: 4;
    position: relative;
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
  }

  .increment-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .increment-button {
    min-width: 0;
  }

  .ledger-panel {
    position: static;
    order: 5;
    display: block;
    width: 100%;
  }

  .system-bar {
    display: none;
  }
}

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