:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #63726b;
  --line: #dce7e1;
  --paper: rgba(255, 255, 252, 0.92);
  --soft: #f5faf7;
  --mint: #dff3e9;
  --accent: #117c62;
  --accent-dark: #075944;
  --sun: #f2b84b;
  --rose: #d75d57;
  --warn: #a14d0b;
  --good: #12713b;
  --shadow: 0 24px 70px rgba(23, 47, 36, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(242, 184, 75, .22), transparent 26%),
    radial-gradient(circle at 86% 18%, rgba(17, 124, 98, .18), transparent 28%),
    linear-gradient(180deg, #f4fbf7 0%, #fff8ed 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 32, 27, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 27, .035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent 72%);
}

button, input { font: inherit; }

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  position: relative;
}

.play, .side {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.play { min-height: calc(100vh - 60px); display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 16px;
  background: linear-gradient(90deg, rgba(223, 243, 233, .8), rgba(255, 253, 248, .6));
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 34px; line-height: 1.08; }
h2 { font-size: 18px; margin-bottom: 10px; }

button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 7px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

button:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(17, 124, 98, .18); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:disabled:hover { transform: none; box-shadow: none; }

.ghost {
  background: #ffffff;
  color: var(--accent-dark);
}

.board {
  margin: 20px 24px 0;
  border: 1px solid #cae6d8;
  background:
    linear-gradient(135deg, rgba(223, 243, 233, .95), rgba(255, 248, 235, .82));
  border-radius: 8px;
  overflow: hidden;
}

.round {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  border-bottom: 1px solid #cfe7db;
}

.pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(17, 124, 98, .18);
  background: rgba(255, 255, 255, .72);
  border-radius: 999px;
  padding: 4px 10px;
}

.pill.active {
  color: var(--accent-dark);
  font-weight: 700;
}

.mystery {
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.seal {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #0d604b);
  color: white;
  font-size: 34px;
  font-weight: 800;
  flex: none;
  box-shadow: inset 0 -8px 16px rgba(0,0,0,.12), 0 12px 24px rgba(17, 124, 98, .22);
}

.mystery p { color: var(--muted); margin-bottom: 0; line-height: 1.7; }

.log {
  padding: 20px 24px;
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.msg {
  max-width: 82%;
  border: 1px solid #e1e9e5;
  border-radius: 8px;
  padding: 12px 15px;
  line-height: 1.65;
  background: white;
  box-shadow: 0 8px 24px rgba(32, 52, 43, .06);
}

.msg.ai { align-self: flex-start; border-left: 4px solid var(--accent); }
.msg.you { align-self: flex-end; background: #fff6e5; border-color: #f0d5a2; }
.msg.system { align-self: center; color: var(--muted); background: #f7faf8; box-shadow: none; }
.msg.win { border-color: #9ed5b1; color: var(--good); background: #f2fbf5; }
.msg.lose { border-color: #efbf8e; color: var(--warn); background: #fff7ef; }

.label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.inputbar {
  padding: 16px 24px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .58);
}

input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px 14px;
  outline: none;
  background: #fff;
}

input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 138, 106, .14); }

.side {
  padding: 22px;
  align-self: start;
  position: sticky;
  top: 20px;
}

.side p { color: var(--muted); line-height: 1.75; }

.chips { display: grid; gap: 10px; margin: 16px 0 22px; }
.chips button {
  background: white;
  color: var(--accent-dark);
  text-align: left;
  border-color: #cfe4da;
}
.chips button:hover { background: var(--soft); }
.tech { border-top: 1px solid var(--line); padding-top: 18px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; width: min(100% - 20px, 720px); padding: 10px 0; }
  .play { min-height: 70vh; }
  .side { position: static; }
  .topbar { align-items: flex-start; }
  h1 { font-size: 26px; }
  .msg { max-width: 94%; }
  .inputbar { grid-template-columns: 1fr; }
  .mystery { align-items: flex-start; }
}
