:root {
  --bg: #f7f1e8;
  --card: rgba(255, 253, 249, 0.9);
  --line: #d9cab8;
  --text: #32261b;
  --muted: #7a6755;
  --accent: #d96b2b;
  --red: #d7263d;
  --green: #1f9d55;
  --shadow: 0 10px 28px rgba(88, 52, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 214, 165, 0.6), transparent 28%),
    linear-gradient(180deg, #fbf7f0 0%, var(--bg) 100%);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: calc(100vw - 32px);
  margin: 0 auto;
  padding: 28px 0 48px;
}

.admin-shell {
  width: calc(100vw - 32px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar h1,
.section-head h2 {
  margin: 4px 0 0;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.topbar-actions,
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.summary-card,
.form-card,
.list-card {
  background: var(--card);
  border: 1px solid rgba(121, 90, 62, 0.08);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.summary-card {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.summary-card p {
  margin: 0;
}

.ghost-button,
.primary-button,
.danger-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ghost-button {
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(121, 90, 62, 0.14);
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(217, 107, 43, 0.26);
}

.danger-button {
  background: #d7263d;
  color: #fff;
  box-shadow: 0 8px 18px rgba(215, 38, 61, 0.2);
}

.ghost-button:hover,
.primary-button:hover,
.image-card:hover,
.text-card:hover {
  transform: translateY(-1px);
}

.game-board {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  width: 100%;
  gap: clamp(72px, 16vw, 250px);
  min-height: 720px;
  justify-items: center;
}

.board-column {
  position: relative;
  z-index: 1;
  padding: 0;
  width: 100%;
  align-self: start;
}

.item-list {
  --item-count: 1;
  display: grid;
  grid-template-columns: repeat(var(--item-count), minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  justify-items: stretch;
  align-items: stretch;
}

.image-card,
.text-card {
  position: relative;
  border: 0;
  background: #fff;
  border-radius: 12px;
  padding: clamp(6px, 1vw, 12px);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(88, 52, 24, 0.06);
  min-width: 0;
}

.image-card {
  display: grid;
  width: 100%;
  text-align: center;
}

.image-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #f8f2eb;
}

.admin-item img {
  width: 100%;
  height: 138px;
  object-fit: cover;
  border-radius: 12px;
  background: #f8f2eb;
}

.image-card.active {
  box-shadow: inset 0 0 0 2px rgba(217, 107, 43, 0.45);
}

.text-list {
  padding-top: 16px;
}

.text-card {
  width: 100%;
  min-height: clamp(44px, 8vw, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(12px, 2.2vw, 20px);
  font-weight: 600;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.line-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input[type="text"],
input[type="file"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(121, 90, 62, 0.2);
  border-radius: 16px;
  background: #fff;
}

.list-card {
  margin-top: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.admin-item {
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: inset 0 0 0 1px rgba(121, 90, 62, 0.08);
}

.delete-item-button {
  margin-top: 12px;
  width: 100%;
}

.admin-item h3,
.admin-item p {
  margin: 10px 0 0;
}

.admin-item p,
.form-message,
.empty-state {
  color: var(--muted);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
}

.form-message.success {
  color: var(--green);
}

.form-message.error {
  color: var(--red);
}

.red-text {
  color: var(--red);
}

.green-text {
  color: var(--green);
}

@media (max-width: 860px) {
  .topbar,
  .section-head,
  .topbar-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-board {
    gap: 120px;
    min-height: 0;
  }
}
