:root {
  --bg: #f4efe6;
  --paper: #efe6d7;
  --text: #2d2a26;
  --muted: #6d655c;
  --line: #d8cdbb;
  --accent: #8b6e4e;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #faf5ec 0%, transparent 40%),
    linear-gradient(180deg, #f7f2e9 0%, var(--bg) 100%);
  min-height: 100vh;
  line-height: 1.6;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 8vw;
  background: rgba(244, 239, 230, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.65rem;
  font-weight: 600;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

nav a:hover {
  color: var(--accent);
}

main {
  width: min(980px, 92vw);
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero {
  padding: 3.5rem 0 2rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 0.8rem;
}

h1,
h2 {
  font-family: "Cormorant Garamond", serif;
  line-height: 1.1;
  margin: 0.4rem 0 1rem;
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  max-width: 18ch;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
}

.lead {
  max-width: 48ch;
  color: var(--muted);
}

.panel {
  background: color-mix(in srgb, var(--paper) 88%, white 12%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.25rem;
  margin: 1rem 0;
}

.panel p,
.panel li {
  color: #3d3832;
}

ul {
  margin: 0;
  padding-left: 1.2rem;
}

.project-list li {
  margin: 0.35rem 0;
}

.project-link {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  text-decoration: none;
  background: #f7f0e4;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.data-url-input {
  flex: 1 1 320px;
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  background: #faf6ef;
  color: var(--text);
}

.load-btn {
  border: 1px solid #8f6b3f;
  background: linear-gradient(180deg, #a67c4e 0%, #7c5b3a 100%);
  color: #f7eee2;
  border-radius: 10px;
  font-weight: 700;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

.load-btn:hover {
  filter: brightness(1.05);
}

.status-line {
  margin: 0.35rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.45rem 0 0.8rem;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f0e4;
  color: #4a3d30;
  padding: 0.22rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.filter-chip.active {
  border-color: #8f6b3f;
  color: #2d2116;
  background: #ead9c1;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.news-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  background: #f9f2e6;
}

.news-meta {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-title {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  line-height: 1.35;
}

.news-title a {
  color: #3f2f1f;
  text-decoration: none;
}

.news-title a:hover {
  color: #7f603f;
  text-decoration: underline;
}

.news-summary {
  margin: 0 0 0.5rem;
  color: #3d3832;
  font-size: 0.92rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.tag {
  font-size: 0.73rem;
  border: 1px solid #d4c3ab;
  background: #f3e5d1;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  color: #55422d;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.subpanel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f1e6;
  padding: 0.8rem;
}

.subpanel h3 {
  margin: 0 0 0.55rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.28rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.inline-form input,
.inline-form select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  background: #fbf7f0;
  color: var(--text);
  min-width: 170px;
}

.inline-form button {
  border: 1px solid #8f6b3f;
  border-radius: 8px;
  background: #ead8be;
  color: #46351f;
  font-weight: 600;
  padding: 0.4rem 0.62rem;
  cursor: pointer;
}

.inline-form button:hover {
  filter: brightness(1.04);
}

.cfg-list {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
}

.cfg-list li {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: #3d3832;
}

.muted-tip {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.hidden {
  display: none !important;
}

.edit-entry {
  margin: 0.6rem 0 0.9rem;
}

.game-frame-wrap {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #111;
}

.game-frame {
  display: block;
  width: 100%;
  height: min(72vh, 820px);
  border: 0;
}

.game-enter-wrap {
  margin-top: 1rem;
}

.game-enter-btn {
  display: inline-block;
  padding: 0.72rem 1.15rem;
  border-radius: 12px;
  border: 1px solid #8f6b3f;
  background: linear-gradient(180deg, #a67c4e 0%, #7c5b3a 100%);
  color: #f7eee2;
  text-decoration: none;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.game-enter-btn:hover {
  filter: brightness(1.06);
}

a {
  color: #5d4a35;
}

@media (max-width: 740px) {
  .topbar {
    padding: 0.9rem 1rem;
  }

  nav a {
    font-size: 0.78rem;
  }

  main {
    width: min(620px, 94vw);
  }

  .game-frame {
    height: 68vh;
  }

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

.display-entry {
  background: color-mix(in srgb, var(--paper) 88%, white 12%);
  border-color: var(--line);
}

.display-entry-eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.display-enter-btn {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #4a3d30;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
  background: #f7f0e4;
}

.display-enter-btn:hover {
  color: var(--accent);
}

.display-page {
  --display-bg:
    radial-gradient(circle at top left, #ffeef5 0%, transparent 42%),
    radial-gradient(circle at top right, #ffe7f1 0%, transparent 35%),
    linear-gradient(180deg, #fff8fb 0%, #fff2f7 60%, #ffeaf2 100%);
  --display-topbar-bg: rgba(255, 243, 248, 0.9);
  --display-topbar-line: #f2c8d6;
  --display-nav: #7f2f4d;
  --display-brand: #872f53;
  background: var(--display-bg);
}

.display-page .topbar {
  background: var(--display-topbar-bg);
  border-bottom-color: var(--display-topbar-line);
}

.display-page .brand {
  color: var(--display-brand);
}

.display-page nav a {
  color: var(--display-nav);
}

.display-page nav a:hover {
  color: #cc4a7f;
}

.display-page.mode-womens {
  background:
    radial-gradient(circle at top left, #ffeef5 0%, transparent 42%),
    radial-gradient(circle at top right, #ffe7f1 0%, transparent 35%),
    linear-gradient(180deg, #fff8fb 0%, #fff2f7 60%, #ffeaf2 100%);
}

.display-page.mode-cool {
  --display-bg:
    radial-gradient(circle at 10% 20%, rgba(45, 193, 255, 0.24) 0%, transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(255, 65, 170, 0.22) 0%, transparent 33%),
    linear-gradient(145deg, #050714 0%, #090d1f 44%, #070915 100%);
  --display-topbar-bg: rgba(4, 9, 28, 0.82);
  --display-topbar-line: rgba(90, 129, 255, 0.35);
  --display-nav: #9ad7ff;
  --display-brand: #8de7ff;
}

.display-main {
  width: min(1100px, 94vw);
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.display-scene {
  position: relative;
  min-height: 68vh;
  border: 1px solid #f2c8d6;
  border-radius: 22px;
  padding: clamp(1.1rem, 3.8vw, 2.1rem);
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 230, 241, 0.95) 0%, transparent 36%),
    radial-gradient(circle at 82% 22%, rgba(255, 240, 247, 0.9) 0%, transparent 34%),
    linear-gradient(135deg, #fff9fc 0%, #fff1f6 48%, #ffe8f1 100%);
  display: grid;
  grid-template-columns: 1.5fr minmax(140px, 0.9fr);
  gap: 1rem;
  align-items: center;
  overflow: hidden;
}

.display-scene-copy {
  position: relative;
  min-height: 220px;
  z-index: 2;
}

.display-scene-eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #b06a84;
  font-size: 0.78rem;
}

.display-art-text {
  margin: 0;
  min-height: 1.4em;
  font-family: "Ma Shan Zheng", "STKaiti", cursive;
  font-size: clamp(2.1rem, 8.6vw, 5rem);
  line-height: 1.2;
  color: #9f355f;
  text-shadow: 0 2px 0 #fff, 0 12px 26px rgba(183, 90, 128, 0.22);
}

.display-caret {
  display: inline-block;
  width: 0.11em;
  height: 1.1em;
  margin-left: 0.14rem;
  vertical-align: -0.1em;
  background: #bd6b8b;
  opacity: 0;
}

.display-scene.is-active .display-caret {
  opacity: 1;
  animation: caret-blink 1s steps(1, end) infinite;
}

.display-scene.is-finished .display-caret {
  opacity: 0;
  animation: none;
}

.display-bursts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.firework-burst {
  --burst-hue: 338;
  position: absolute;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
}

.firework-burst .ray {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 22px;
  border-radius: 999px;
  transform-origin: center bottom;
  transform: translate(-50%, -100%) rotate(var(--angle)) scaleY(0.25);
  background: linear-gradient(
    180deg,
    hsl(var(--burst-hue), 92%, 76%) 0%,
    hsl(var(--burst-hue), 88%, 62%) 100%
  );
  box-shadow: 0 0 6px hsla(var(--burst-hue), 90%, 70%, 0.45);
  opacity: 0;
  animation: burst-ray 900ms ease-out forwards;
}

.firework-burst .core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.35);
  background: hsl(var(--burst-hue), 88%, 72%);
  box-shadow:
    0 0 0 7px hsla(var(--burst-hue), 90%, 76%, 0.24),
    0 0 14px hsla(var(--burst-hue), 85%, 64%, 0.34);
  opacity: 0;
  animation: burst-core 780ms ease-out forwards;
}

.display-carnation {
  margin: 0;
  width: clamp(130px, 21vw, 195px);
  justify-self: center;
  filter: drop-shadow(0 14px 16px rgba(113, 61, 81, 0.14));
  z-index: 2;
}

.display-carnation svg {
  display: block;
  width: 100%;
  height: auto;
}

.display-scene.is-active .display-carnation {
  animation: carnation-rise 1.25s ease-out both;
}

.cool-scene {
  position: relative;
  min-height: 70vh;
  border: 1px solid rgba(95, 145, 255, 0.42);
  border-radius: 24px;
  padding: clamp(1.1rem, 4vw, 2.4rem);
  background:
    radial-gradient(circle at 22% 18%, rgba(0, 188, 255, 0.2) 0%, transparent 38%),
    radial-gradient(circle at 76% 70%, rgba(255, 64, 171, 0.16) 0%, transparent 34%),
    linear-gradient(165deg, rgba(13, 21, 48, 0.94) 0%, rgba(9, 12, 29, 0.95) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(116, 177, 255, 0.14),
    0 24px 50px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}

.cool-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(81, 155, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(81, 155, 255, 0.14) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.26;
  pointer-events: none;
}

.cool-copy {
  position: relative;
  z-index: 2;
}

.cool-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: #7fd8ff;
}

.cool-title {
  margin: 0.5rem 0 0.7rem;
  font-family: "Orbitron", "Manrope", sans-serif;
  font-size: clamp(2rem, 6vw, 4.2rem);
  letter-spacing: 0.02em;
  line-height: 1.02;
  color: #e5f4ff;
  text-shadow:
    0 0 10px rgba(131, 223, 255, 0.36),
    0 0 28px rgba(82, 97, 255, 0.28);
}

.cool-lead {
  margin: 0;
  max-width: 34ch;
  color: #adcaf6;
}

.cool-tags {
  margin-top: 1.05rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cool-tags span {
  border: 1px solid rgba(141, 185, 255, 0.44);
  background: rgba(50, 83, 150, 0.3);
  color: #cce9ff;
  border-radius: 999px;
  padding: 0.18rem 0.66rem;
  font-family: "Orbitron", "Manrope", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.cool-orbital {
  position: relative;
  width: min(390px, 82vw);
  aspect-ratio: 1;
  justify-self: center;
  z-index: 2;
}

.cool-core {
  position: absolute;
  inset: 42% 42%;
  border-radius: 50%;
  background: radial-gradient(circle, #7ce8ff 0%, #3c8dff 60%, #1f3470 100%);
  box-shadow: 0 0 22px rgba(109, 218, 255, 0.54);
}

.cool-ring {
  position: absolute;
  border: 1px solid rgba(138, 189, 255, 0.42);
  border-radius: 50%;
  transform-origin: center;
}

.ring-a {
  inset: 12%;
  animation: spin 12s linear infinite;
}

.ring-b {
  inset: 23%;
  border-color: rgba(255, 131, 202, 0.45);
  animation: spin-reverse 8.5s linear infinite;
}

.ring-c {
  inset: 34%;
  border-color: rgba(95, 228, 255, 0.52);
  animation: spin 5.8s linear infinite;
}

.cool-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cool-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #6ee5ff 58%, transparent 65%);
  box-shadow: 0 0 14px rgba(129, 219, 255, 0.68);
  opacity: 0;
  animation: particle-pop var(--duration, 2600ms) ease-out var(--delay, 0ms) forwards;
}

@keyframes burst-ray {
  0% {
    opacity: 0;
    transform: translate(-50%, -100%) rotate(var(--angle)) scaleY(0.15);
  }
  22% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -130%) rotate(var(--angle)) scaleY(1.28);
  }
}

@keyframes burst-core {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.75);
  }
}

@keyframes caret-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes carnation-rise {
  0% {
    transform: translateY(16px) rotate(-3deg);
    opacity: 0;
  }
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-reverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@keyframes particle-pop {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.2);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-26px) scale(1.15);
  }
}

@media (max-width: 760px) {
  .display-scene {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 56vh;
  }

  .display-scene-copy {
    min-height: 170px;
    width: 100%;
    text-align: center;
  }

  .cool-scene {
    grid-template-columns: 1fr;
    min-height: 62vh;
  }

  .cool-copy {
    text-align: center;
  }

  .cool-tags {
    justify-content: center;
  }
}
