:root {
  --bg: #f3efe6;
  --bg-accent: #e7dcc6;
  --ink: #1f2a2e;
  --muted: #56606a;
  --card: #fefcf7;
  --stroke: #e0d5c3;
  --accent: #5fb374;
  --accent-strong: #2f8d52;
  --shadow: 0 24px 60px -40px rgba(31, 42, 46, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.6), transparent 60%),
    linear-gradient(140deg, var(--bg), var(--bg-accent));
  color: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  min-height: 100%;
}

body {
  line-height: 1.6;
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(254, 246, 231, 0.95));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  animation: rise 0.6s ease-out;
}

.hero-text h1 {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 36px;
  margin: 6px 0 12px;
  letter-spacing: 1px;
}

.hero-eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.meta-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(95, 179, 116, 0.12);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 28px;
}

.canvas-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.canvas-shell {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(245, 237, 223, 0.95));
  border: 1px solid var(--stroke);
  padding: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.8s ease-out;
}

#game-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  text-align: center;
}

#game-container > canvas {
  border-radius: 16px;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.35);
  outline: 1px solid rgba(255, 255, 255, 0.6);
  background: #0f1416;
}

.canvas-overlay {
  position: absolute;
  right: 20px;
  bottom: 20px;
}

.overlay-card {
  background: rgba(31, 42, 46, 0.8);
  color: #f5f1e9;
  padding: 12px 16px;
  border-radius: 14px;
  max-width: 220px;
  box-shadow: 0 16px 40px -30px rgba(0, 0, 0, 0.4);
}

.overlay-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.overlay-text {
  font-size: 13px;
  margin: 0;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--stroke);
  padding: 18px;
  box-shadow: var(--shadow);
  animation: rise 0.9s ease-out;
}

.card-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted);
  margin-bottom: 14px;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 12px;
}

.agent-chip {
  border-radius: 16px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.agent-chip:hover {
  border-color: rgba(95, 179, 116, 0.4);
  transform: translateY(-2px);
}

.agent-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(95, 179, 116, 0.15);
  border: 1px solid rgba(95, 179, 116, 0.3);
}

.agent-name {
  font-size: 12px;
}

.detail-placeholder {
  color: var(--muted);
  font-style: italic;
}

.detail-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.detail-avatar img {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(31, 42, 46, 0.15);
  background: #fff;
}

.detail-desc {
  margin: 0 0 6px;
  font-weight: 600;
}

.detail-action,
.detail-location {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .canvas-shell {
    padding: 14px;
  }

  .hero {
    padding: 24px;
  }
}

@media (max-width: 720px) {
  .hero-text h1 {
    font-size: 28px;
  }

  .meta-pill {
    font-size: 12px;
  }

  #game-container {
    min-height: 360px;
  }
}
