:root {
  color-scheme: light;
  --ink: #17304a;
  --muted: #5b7086;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(23, 48, 74, 0.16);
  --blue: #48b8ff;
  --deep: #1c74c9;
  --sand: #ffe58f;
  --coral: #ff8f8f;
  --mint: #91f1cc;
  --shadow: rgba(20, 73, 112, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 229, 143, 0.9), transparent 22%),
    radial-gradient(circle at 86% 16%, rgba(145, 241, 204, 0.78), transparent 24%),
    linear-gradient(180deg, #bff0ff 0%, #66cdfb 48%, #1684d6 100%);
}

button,
select {
  font: inherit;
}

.app {
  width: min(1060px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 38px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 20px;
  align-items: center;
  min-height: 220px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #235f86;
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 64px);
  letter-spacing: 0;
}

.intro {
  max-width: 680px;
  margin: 12px 0 0;
  color: #284b67;
  font-size: 18px;
  line-height: 1.7;
}

.mascot {
  position: relative;
  min-height: 190px;
}

.dolphin,
.chest {
  position: absolute;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 0 var(--ink);
}

.dolphin {
  left: 20px;
  top: 18px;
  width: 126px;
  height: 110px;
  font-size: 68px;
  transform: rotate(-8deg);
}

.chest {
  right: 10px;
  bottom: 16px;
  width: 102px;
  height: 88px;
  font-size: 52px;
  transform: rotate(7deg);
}

.bubble {
  position: absolute;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
}

.b1 {
  width: 42px;
  height: 42px;
  right: 68px;
  top: 22px;
}

.b2 {
  width: 24px;
  height: 24px;
  left: 5px;
  bottom: 36px;
}

.control-panel,
.game-board {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 46px var(--shadow);
}

.control-panel {
  display: flex;
  gap: 14px;
  align-items: end;
  justify-content: space-between;
  padding: 16px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
  min-width: min(520px, 100%);
  color: var(--muted);
  font-weight: 900;
}

select {
  width: 100%;
  min-height: 46px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

button {
  min-height: 46px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--sand);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
}

button:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: 0 5px 0 var(--ink);
}

.game-board {
  padding: 18px;
}

.status-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.status-card > div {
  min-height: 78px;
  border: 2px dashed rgba(28, 116, 201, 0.32);
  border-radius: 8px;
  padding: 12px;
  background: #f5fcff;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.status-card strong {
  display: block;
  margin-top: 3px;
  font-size: 28px;
}

.message {
  margin: 16px 0;
  border-radius: 8px;
  padding: 14px;
  background: #fff7cf;
  color: #60460a;
  font-weight: 800;
  line-height: 1.6;
}

.secret-row,
.slots,
.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.secret-row {
  margin: 8px auto 18px;
}

.secret-cell,
.slot,
.token {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: white;
  font-size: 32px;
}

.secret-cell {
  background: linear-gradient(145deg, #164f8a, #39bdf8);
  color: white;
  font-weight: 900;
}

.slot {
  background: #eaf9ff;
}

.slot.selected {
  outline: 4px solid var(--coral);
}

.token {
  background: #ffffff;
}

.token.used {
  background: #d8f8ed;
}

.guess-area {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: #eefbff;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

#guessBtn {
  background: var(--mint);
}

.history-wrap {
  margin-top: 18px;
}

h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.history {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history li {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
}

.mini-row {
  display: flex;
  gap: 6px;
  font-size: 26px;
}

.hint {
  color: var(--muted);
  font-weight: 900;
  line-height: 1.5;
}

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

  .mascot {
    min-height: 145px;
  }

  .control-panel {
    display: grid;
    align-items: stretch;
  }

  .status-card {
    grid-template-columns: 1fr;
  }

  .history li {
    grid-template-columns: 1fr;
  }
}
