:root {
  --bg-1: #f2e9cf;
  --bg-2: #ebe1c4;
  --panel: rgba(255, 253, 245, 0.92);
  --panel-border: rgba(80, 65, 40, 0.2);
  --text: #3d3325;
  --muted: rgba(61, 51, 37, 0.72);
  --shadow: 0 14px 30px rgba(80, 60, 30, 0.15);
  --grid-line: #ffffff;
  --cat-stroke: #2b2218;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.55), transparent 32%),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.35), transparent 28%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

.app {
  min-height: 100%;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.header {
  text-align: center;
}

.title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #5a4a32;
}

.sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.main {
  display: grid;
  grid-template-columns: 240px auto 240px;
  gap: 16px;
  justify-content: center;
  align-items: start;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  padding: 14px;
  border-radius: 18px;
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.card-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 900;
  color: #5a4a32;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 251, 238, 0.9);
  border: 1.5px solid rgba(80, 65, 40, 0.15);
}

.stat-k {
  font-size: 12px;
  color: var(--muted);
}

.stat-v {
  margin-top: 6px;
  font-size: 19px;
  font-weight: 900;
  color: #5a4a32;
}

.stage {
  display: flex;
  justify-content: center;
}

.stage-wrap {
  position: relative;
}

#game,
.mini {
  display: block;
  background: #e8dcb8;
  border: 2.5px solid #c8b892;
  box-shadow: var(--shadow);
}

#game {
  width: min(360px, 92vw);
  height: auto;
  border-radius: 18px;
}

.mini {
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(60, 45, 25, 0.28);
  border-radius: 18px;
}

.overlay.show {
  display: flex;
}

.overlay-card {
  width: min(300px, 100%);
  padding: 18px 16px;
  border-radius: 16px;
  background: rgba(255, 252, 242, 0.96);
  border: 1.5px solid rgba(80, 65, 40, 0.2);
  text-align: center;
  box-shadow: var(--shadow);
}

.overlay-title {
  font-size: 20px;
  font-weight: 900;
  color: #5a4a32;
}

.overlay-desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.overlay-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn {
  appearance: none;
  border: 1.5px solid rgba(80, 65, 40, 0.25);
  background: rgba(255, 251, 238, 0.95);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(80, 60, 30, 0.12);
}

.btn-ghost {
  background: rgba(255, 251, 238, 0.6);
}

.keys,
.tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.key-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  align-items: center;
}

.k {
  padding: 6px 8px;
  text-align: center;
  border-radius: 10px;
  background: rgba(255, 251, 238, 0.9);
  border: 1.5px solid rgba(80, 65, 40, 0.15);
  font-size: 12px;
  font-weight: 900;
  color: #5a4a32;
}

.d,
.tips {
  font-size: 13px;
  color: rgba(61, 51, 37, 0.88);
}

.footer {
  display: flex;
  justify-content: center;
  gap: 10px;
}

@media (max-width: 980px) {
  .main {
    grid-template-columns: 1fr;
  }

  .panel {
    width: min(520px, 96vw);
    margin: 0 auto;
  }
}
