/* 收纳物语 — 游戏样式 */
:root {
  --primary: #D4A373;
  --primary-dark: #B8864E;
  --green: #2D6A4F;
  --red: #DC143C;
  --bg: #FAF8F5;
  --card: #FFFFFF;
  --text: #2D2D2D;
  --text-light: #8C8C8C;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.game-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

/* ===== Header ===== */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 8px;
}

.game-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.game-stars {
  font-size: 0.95rem;
  background: #FFF8E1;
  padding: 4px 12px;
  border-radius: 20px;
}

.back-btn {
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  user-select: none;
}

.game-errors {
  font-size: 0.9rem;
  color: var(--red);
}

.game-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* ===== 关卡选择 ===== */
.level-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.level-btn {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.level-btn.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.level-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.level-btn.completed {
  border: 2px solid var(--primary);
}

.lv-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.lv-title {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.lv-stars { font-size: 0.75rem; }
.lv-lock { font-size: 1.2rem; }
.lv-new {
  font-size: 0.65rem;
  background: var(--green);
  color: white;
  padding: 1px 8px;
  border-radius: 10px;
  display: inline-block;
}

.menu-footer {
  text-align: center;
  color: var(--text-light);
  font-size: 0.8rem;
  margin-top: 24px;
}

/* ===== 游戏区域 ===== */
.game-area {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  min-height: 320px;
}

.items-area {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  min-height: 120px;
  margin-bottom: 20px;
  padding: 12px;
  background: #F9F6F0;
  border-radius: 10px;
  border: 2px dashed #E8E0D5;
}

.game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  padding: 8px 4px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
  border: 2px solid transparent;
}

.game-item:hover {
  transform: scale(1.05);
}

.game-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.3);
  transform: scale(1.08);
}

.game-item.placed {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
  transition: all 0.3s;
}

.game-item.wrong {
  animation: shake 0.4s;
  border-color: var(--red);
}

.game-item.dragging {
  opacity: 0.5;
  transform: scale(0.9);
}

.item-emoji {
  font-size: 1.8rem;
  line-height: 1.2;
}

.item-name {
  font-size: 0.6rem;
  color: var(--text-light);
  margin-top: 2px;
  text-align: center;
  line-height: 1.2;
}

/* ===== 放置区域 ===== */
.zones-area {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  border-radius: 10px;
  border: 2px dashed #D0C8BC;
  background: #FAF8F5;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 80px;
  position: relative;
}

.zone:hover, .zone-active {
  border-color: var(--primary);
  background: #FFF9F0;
}

.zone-hover {
  border-color: var(--green);
  background: #F0F7F0;
  transform: scale(1.02);
}

.zone-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.zone-label {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
}

.zone-return { border-color: #2D6A4F; }
.zone-discard { border-color: #DC143C; }
.zone-donate { border-color: #D4A373; }

.zone-placed {
  position: absolute;
  font-size: 0.9rem;
  opacity: 0.7;
  right: 4px;
  bottom: 4px;
}

/* ===== 金句 ===== */
.quote-area {
  text-align: center;
  margin-top: 16px;
  padding: 12px;
  background: #FFF9F0;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
}

/* ===== 过关结果 ===== */
.result-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.3s;
}

.result-card {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  animation: slideUp 0.3s;
}

.result-stars {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.result-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-info {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.result-quote {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 20px;
  padding: 8px;
  background: #FFF9F0;
  border-radius: 8px;
}

.result-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: #F0ECE6;
  color: var(--text);
}

.btn-secondary:hover { background: #E5E0D8; }

.btn-text {
  background: transparent;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake { animation: shake 0.4s; }

/* ===== 响应式 ===== */
@media (max-width: 400px) {
  .game-item { width: 60px; padding: 6px 2px; }
  .item-emoji { font-size: 1.5rem; }
  .item-name { font-size: 0.55rem; }
  .zone { padding: 10px 4px; min-height: 64px; }
}
