/* /usr/local/var/www/play/style.css */
:root {
  --bg: #212121;
  --panel: #2a2a2a;
  --panel-2: #303030;
  --panel-3: #181818;

  --pink: #ff4fb8;
  --pink-hot: #ff2fa6;
  --cyan: #00f2ea;
  --green: #75ff9d;

  --text: #fff3fb;
  --soft: #d7ccd4;
  --muted: #9d929b;

  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --shadow: rgba(0, 0, 0, 0.36);

  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--pink);
  color: white;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 28px 0;
  font-family: "Nunito", ui-rounded, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 79, 184, 0.18) 0 10rem, transparent 25rem),
    radial-gradient(circle at 86% 18%, rgba(0, 242, 234, 0.12) 0 9rem, transparent 24rem),
    radial-gradient(circle at 45% 92%, rgba(255, 79, 184, 0.10) 0 12rem, transparent 28rem),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
}

.shell {
  width: min(92vw, 1120px);
  margin: 0 auto;
}

.hero {
  padding: clamp(24px, 5vw, 54px);
  min-height: 300px;
  display: grid;
  align-content: end;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255,79,184,0.12), transparent 48%),
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    var(--panel);
  box-shadow:
    0 24px 70px var(--shadow),
    inset 0 0 0 1px rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "遺物";
  position: absolute;
  right: clamp(18px, 5vw, 54px);
  top: 24px;
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Sans", sans-serif;
  font-weight: 900;
  font-size: clamp(4rem, 13vw, 10rem);
  letter-spacing: -0.08em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 79, 184, 0.28);
  opacity: 0.7;
  pointer-events: none;
}

.kicker,
.eyebrow,
.game-kind,
.server-box span {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: lowercase;
}

.kicker,
.eyebrow {
  color: var(--pink);
}

h1 {
  max-width: 11ch;
  margin: 12px 0 14px;
  font-family: "Cherry Bomb One", "Nunito", ui-rounded, system-ui, sans-serif;
  font-size: clamp(3.4rem, 9vw, 7.6rem);
  line-height: 0.82;
  letter-spacing: -0.045em;
  color: var(--text);
  text-shadow:
    3px 3px 0 var(--pink),
    -2px -2px 0 rgba(0, 242, 234, 0.38),
    0 18px 48px rgba(0,0,0,0.32);
}

.hero-text {
  margin: 0;
  max-width: 48rem;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.35;
  font-weight: 1000;
  color: var(--soft);
}

.playground {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.cat-card,
.mini-card,
.note {
  border: 2px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02)),
    var(--panel);
  box-shadow:
    0 18px 44px rgba(0,0,0,0.26),
    inset 0 0 0 1px rgba(255,255,255,0.035);
}

.cat-card {
  min-height: 560px;
  padding: clamp(22px, 3vw, 34px);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto auto;
  gap: 18px;
  align-content: start;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.cat-card::before {
  content: "";
  position: absolute;
  inset: auto -14% -24% -14%;
  height: 52%;
  background:
    radial-gradient(circle at 20% 25%, rgba(255,79,184,0.34), transparent 13rem),
    linear-gradient(135deg, rgba(255,79,184,0.18), rgba(0,242,234,0.08));
  transform: rotate(-3deg);
}

.cat-card::after {
  content: "☾";
  position: absolute;
  right: 26px;
  bottom: 12px;
  font-size: 9rem;
  line-height: 1;
  color: rgba(255,79,184,0.14);
}

.cat-card > * {
  position: relative;
  z-index: 1;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lamp {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #7d747b;
  box-shadow: 0 0 10px rgba(125,116,123,0.25);
}

.lamp.online {
  background: var(--green);
  box-shadow:
    0 0 0 6px rgba(117,255,157,0.10),
    0 0 22px rgba(117,255,157,0.72);
}

.lamp.sleep {
  background: #777177;
  box-shadow: 0 0 12px rgba(0,0,0,0.26);
}

.game-kind {
  color: var(--cyan);
}

h2,
h3 {
  margin: 0;
  color: var(--text);
}

h2 {
  max-width: 9ch;
  font-size: clamp(3.2rem, 5.8vw, 5.8rem);
  line-height: 0.82;
  letter-spacing: -0.065em;
  text-shadow:
    3px 3px 0 var(--pink),
    0 16px 42px rgba(0,0,0,0.34);
}

h3 {
  font-size: 1.5rem;
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.description,
.mini-card p {
  margin: 0;
  color: var(--soft);
  font-weight: 1000;
  line-height: 1.38;
}

.description {
  max-width: 38rem;
  font-size: 1.1rem;
}

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

.chips span,
.pill {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 79, 184, 0.28);
  background: rgba(255, 79, 184, 0.10);
  color: var(--soft);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

.server-box {
  margin-top: auto;
  padding: 14px 15px;
  display: grid;
  gap: 5px;
  border-radius: var(--radius-md);
  background: var(--panel-3);
  color: var(--text);
  text-align: left;
  border: 1px solid rgba(255, 79, 184, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035);
}

.server-box span {
  color: var(--pink);
}

.server-box code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  overflow-wrap: anywhere;
}

.copy-button {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--pink);
  color: white;
  font: inherit;
  font-weight: 1000;
  cursor: pointer;
  box-shadow:
    0 8px 0 #9e216b,
    0 18px 34px rgba(255,79,184,0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.copy-button:hover {
  filter: brightness(1.08);
}

.copy-button:active {
  transform: translateY(6px);
  box-shadow:
    0 2px 0 #9e216b,
    0 9px 18px rgba(255,79,184,0.2);
}

.queue {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mini-card {
  min-height: 220px;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.mini-card::after {
  content: "";
  position: absolute;
  inset: auto -18% -28%;
  height: 46%;
  background: linear-gradient(135deg, rgba(255,79,184,0.13), rgba(0,242,234,0.05));
  transform: rotate(-6deg);
}

.mini-card > * {
  position: relative;
  z-index: 1;
}

.mini-card .lamp {
  position: absolute;
  top: 18px;
  right: 18px;
}

.mini-card .eyebrow {
  color: var(--muted);
}

.pill {
  margin-top: 2px;
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.055);
  color: var(--muted);
}

.note {
  margin: 18px auto 0;
  max-width: 780px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255,79,184,0.12), rgba(0,242,234,0.055)),
    var(--panel-3);
  color: var(--soft);
}

.note p {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.55;
}

.cat-card.offline {
  filter: saturate(0.78);
}

.cat-card.offline .server-box {
  opacity: 0.72;
}

/* shared ghostpacket footer — content/behavior stays consistent */
.site-footer {
  margin-top: 18px;
  display: grid;
  gap: 2px;
  text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  opacity: 0.58;
  color: var(--soft);
}

.site-footer a,
.site-footer-link {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer-link:hover {
  text-decoration: underline;
}

.site-footer-link {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: inline;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.site-footer-link:active {
  transform: none;
  box-shadow: none;
}

@media (max-width: 1000px) {
  .playground {
    grid-template-columns: 1fr;
  }

  .cat-card {
    min-height: 480px;
  }

  h2 {
    font-size: clamp(3.2rem, 7.2vw, 6.4rem);
  }

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

@media (max-width: 560px) {
  body {
    padding: 18px 0;
  }

  .shell {
    width: min(92vw, 520px);
  }

  .hero,
  .cat-card,
  .mini-card {
    border-radius: 24px;
  }

  .hero {
    min-height: 260px;
  }

  .cat-card {
    min-height: 430px;
  }

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

  h1 {
    font-size: clamp(3.1rem, 17vw, 4.8rem);
  }

  h2 {
    font-size: clamp(3rem, 16vw, 4.8rem);
  }
}

.lamp.checking {
  background: var(--cyan);
  box-shadow:
    0 0 0 6px rgba(0,242,234,0.08),
    0 0 22px rgba(0,242,234,0.52);
}

.cat-card.checking {
  filter: saturate(0.9);
}

/* refined game status states */
.lamp.checking {
  background: #ffd166;
  box-shadow:
    0 0 0 6px rgba(255,209,102,0.10),
    0 0 22px rgba(255,209,102,0.62);
}

.lamp.offline {
  background: #ff4f64;
  box-shadow:
    0 0 0 6px rgba(255,79,100,0.10),
    0 0 22px rgba(255,79,100,0.62);
}

.cat-card.offline,
.cat-card.checking {
  filter: saturate(0.82);
}

.cat-card.offline .server-box,
.cat-card.checking .server-box {
  display: none;
}

.cat-card.offline .copy-button,
.cat-card.checking .copy-button,
.copy-button:disabled {
  background: #777177;
  color: rgba(255,255,255,0.62);
  cursor: not-allowed;
  box-shadow:
    0 8px 0 #4f4a4f,
    0 18px 34px rgba(0,0,0,0.18);
  filter: saturate(0.65);
}

.cat-card.offline .copy-button:active,
.cat-card.checking .copy-button:active,
.copy-button:disabled:active {
  transform: none;
  box-shadow:
    0 8px 0 #4f4a4f,
    0 18px 34px rgba(0,0,0,0.18);
}

/* reserved/eeping cards now use the same top-left status language */
.mini-card .status-row {
  align-self: start;
}

.mini-card .lamp {
  position: static;
}

.mini-card > .lamp {
  position: static;
}



/* final ghostpacket state authority */
:root {
  --online: var(--cyan);
  --checking: #ffd166;
  --offline: #ff4f64;
  --sleep: #777177;
}

/* online is cyan */
.lamp.online {
  background: var(--online) !important;
  box-shadow:
    0 0 0 6px rgba(0, 242, 234, 0.12),
    0 0 22px rgba(0, 242, 234, 0.72) !important;
}

.lamp.checking {
  background: var(--checking) !important;
  box-shadow:
    0 0 0 6px rgba(255, 209, 102, 0.12),
    0 0 22px rgba(255, 209, 102, 0.72) !important;
}

.lamp.offline {
  background: var(--offline) !important;
  box-shadow:
    0 0 0 6px rgba(255, 79, 100, 0.12),
    0 0 22px rgba(255, 79, 100, 0.72) !important;
}

.lamp.sleep {
  background: var(--sleep) !important;
  box-shadow: 0 0 12px rgba(0,0,0,0.26) !important;
}

/* reserved/uninitialized cards: lamp stays top-left */
.queue .mini-card .status-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: fit-content !important;
}

.queue .mini-card .status-row .lamp,
.queue .mini-card .lamp,
.queue .mini-card > .lamp {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 13px !important;
  height: 13px !important;
  flex: 0 0 auto !important;
}

/* initialized checking/offline cards keep server box visible */
.cat-card.offline,
.cat-card.checking {
  filter: saturate(0.82);
}

.cat-card.offline .server-box,
.cat-card.checking .server-box,
.cat-card .server-box[hidden] {
  display: grid !important;
  opacity: 0.76;
}

.cat-card.offline .server-box span,
.cat-card.checking .server-box span {
  color: var(--muted);
}

.cat-card.offline .server-box code,
.cat-card.checking .server-box code {
  color: rgba(255,255,255,0.72);
}

/* keep chips sane even when cards are checking/offline */
.cat-card .chips {
  align-self: start !important;
}

.cat-card .chips span {
  min-height: 0 !important;
  height: auto !important;
  line-height: 1 !important;
}

/* disabled copy */
.cat-card.offline .copy-button,
.cat-card.checking .copy-button,
.copy-button:disabled {
  background: #777177 !important;
  color: rgba(255,255,255,0.62) !important;
  cursor: not-allowed !important;
  box-shadow:
    0 8px 0 #4f4a4f,
    0 18px 34px rgba(0,0,0,0.18) !important;
  filter: saturate(0.65) !important;
}

.cat-card.offline .copy-button:active,
.cat-card.checking .copy-button:active,
.copy-button:disabled:active {
  transform: none !important;
  box-shadow:
    0 8px 0 #4f4a4f,
    0 18px 34px rgba(0,0,0,0.18) !important;
}


/* final ghostpacket age counter */
.cat-card .status-row {
  display: grid !important;
  grid-template-columns: auto auto 1fr auto !important;
  align-items: center !important;
  gap: 10px !important;
}

.status-age {
  grid-column: 4;
  justify-self: end;
  min-width: max-content;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--offline);
  opacity: 0.92;
}

.status-age[hidden] {
  display: none !important;
}

.cat-card.checking .status-age,
.cat-card.online .status-age {
  display: none !important;
}

.cat-card.offline .eyebrow {
  color: var(--offline);
}


/* final artifact arrival fade */
#handoff-arrival {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  background: #fff;
  opacity: 0;
}

html.handoff-arriving #handoff-arrival {
  opacity: 1;
}

html.handoff-arrived #handoff-arrival {
  opacity: 0;
  transition: opacity 0.72s cubic-bezier(.18, .86, .22, 1);
}

html.handoff-arriving .shell {
  filter: blur(1.5px) brightness(1.25);
  transform: scale(0.992);
}

html.handoff-arrived .shell {
  filter: none;
  transform: scale(1);
  transition:
    filter 0.72s cubic-bezier(.18, .86, .22, 1),
    transform 0.72s cubic-bezier(.18, .86, .22, 1);
}

@media (prefers-reduced-motion: reduce) {
  html.handoff-arrived #handoff-arrival,
  html.handoff-arrived .shell {
    transition: none;
  }
}


/* final play frontend recovery */
.lamp.online {
  background: var(--cyan) !important;
  box-shadow:
    0 0 0 6px rgba(0, 242, 234, 0.12),
    0 0 22px rgba(0, 242, 234, 0.72) !important;
}

.lamp.checking {
  background: #ffd166 !important;
  box-shadow:
    0 0 0 6px rgba(255, 209, 102, 0.12),
    0 0 22px rgba(255, 209, 102, 0.72) !important;
}

.lamp.offline {
  background: #ff4f64 !important;
  box-shadow:
    0 0 0 6px rgba(255, 79, 100, 0.12),
    0 0 22px rgba(255, 79, 100, 0.72) !important;
}

.queue .mini-card .status-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: fit-content !important;
}

.queue .mini-card .status-row .lamp,
.queue .mini-card .lamp,
.queue .mini-card > .lamp {
  position: static !important;
  inset: auto !important;
  width: 13px !important;
  height: 13px !important;
  flex: 0 0 auto !important;
}

.cat-card .status-row {
  display: grid !important;
  grid-template-columns: auto auto 1fr auto !important;
  align-items: center !important;
  gap: 10px !important;
}

.status-age {
  grid-column: 4;
  justify-self: end;
  min-width: max-content;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: #ff4f64;
  opacity: 0.92;
}

.status-age[hidden],
.cat-card.checking .status-age,
.cat-card.online .status-age {
  display: none !important;
}

.cat-card.offline,
.cat-card.checking {
  filter: saturate(0.82);
}

.cat-card.offline .server-box,
.cat-card.checking .server-box,
.cat-card .server-box[hidden] {
  display: grid !important;
  opacity: 0.76;
}

.cat-card.offline .server-box span,
.cat-card.checking .server-box span {
  color: var(--muted);
}

.cat-card.offline .server-box code,
.cat-card.checking .server-box code {
  color: rgba(255,255,255,0.72);
}

.cat-card.offline .copy-button,
.cat-card.checking .copy-button,
.copy-button:disabled {
  background: #777177 !important;
  color: rgba(255,255,255,0.62) !important;
  cursor: not-allowed !important;
  box-shadow:
    0 8px 0 #4f4a4f,
    0 18px 34px rgba(0,0,0,0.18) !important;
  filter: saturate(0.65) !important;
}

#handoff-arrival {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  background: #fff;
  opacity: 0;
}

html.handoff-arriving #handoff-arrival {
  opacity: 1;
}

html.handoff-arrived #handoff-arrival {
  opacity: 0;
  transition: opacity 0.72s cubic-bezier(.18, .86, .22, 1);
}

html.handoff-arriving .shell {
  filter: blur(1.5px) brightness(1.25);
  transform: scale(0.992);
}

html.handoff-arrived .shell {
  filter: none;
  transform: scale(1);
  transition:
    filter 0.72s cubic-bezier(.18, .86, .22, 1),
    transform 0.72s cubic-bezier(.18, .86, .22, 1);
}

/* final lamp pulse */
@keyframes lamp-online-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 5px rgba(0, 242, 234, 0.10),
      0 0 16px rgba(0, 242, 234, 0.58);
  }
  50% {
    transform: scale(1.12);
    box-shadow:
      0 0 0 8px rgba(0, 242, 234, 0.16),
      0 0 28px rgba(0, 242, 234, 0.92);
  }
}

@keyframes lamp-checking-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 5px rgba(255, 209, 102, 0.10),
      0 0 14px rgba(255, 209, 102, 0.55);
  }
  50% {
    transform: scale(1.16);
    box-shadow:
      0 0 0 9px rgba(255, 209, 102, 0.18),
      0 0 30px rgba(255, 209, 102, 0.95);
  }
}

@keyframes lamp-offline-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 4px rgba(255, 79, 100, 0.08),
      0 0 12px rgba(255, 79, 100, 0.42);
  }
  50% {
    transform: scale(1.08);
    box-shadow:
      0 0 0 6px rgba(255, 79, 100, 0.12),
      0 0 20px rgba(255, 79, 100, 0.62);
  }
}

@keyframes lamp-sleep-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.78;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

.lamp.online {
  animation: lamp-online-pulse 2.4s ease-in-out infinite !important;
}

.lamp.checking {
  animation: lamp-checking-pulse 1.05s ease-in-out infinite !important;
}

.lamp.offline {
  animation: lamp-offline-pulse 2.9s ease-in-out infinite !important;
}

.lamp.sleep {
  animation: lamp-sleep-pulse 3.4s ease-in-out infinite !important;
}

@media (prefers-reduced-motion: reduce) {
  .lamp {
    animation: none !important;
  }
}
