* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  background: linear-gradient(180deg, #e8f5e9 0%, #c8e6c9 100%);
  font-family: -apple-system, system-ui, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: env(safe-area-inset-top);
}

h1 {
  margin: 10px 0 8px;
  font-size: 22px;
  color: #2e7d32;
  letter-spacing: 1px;
}

.hud {
  width: 92%;
  max-width: 420px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.9);
  padding: 8px 12px;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 8px;
  z-index: 10;
  backdrop-filter: blur(6px);
}

.hud-item {
  font-size: 15px;
  font-weight: 700;
  color: #2e7d32;
}

.hud-item.level { color: #1565c0; }

.game-area {
  width: 92%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  background: rgba(255,255,255,0.5);
  border-radius: 20px;
  border: 3px solid rgba(46,125,50,0.2);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.container-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 80px;
  overflow: hidden;
}

.item {
  position: absolute;
  font-size: 36px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s;
  border-radius: 10px;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.06);
}

.item:active {
  transform: scale(0.9);
}

.item.blocked {
  filter: brightness(0.7);
  cursor: default;
}

.item.blocked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
}

.item.removing {
  animation: itemPop 0.3s ease forwards;
}

@keyframes itemPop {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(0); opacity: 0; }
}

/* Bottom slot bar */
.slot-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.95);
  padding: 6px 8px;
  border-radius: 14px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  border: 2px solid rgba(46,125,50,0.15);
  z-index: 20;
}

.slot {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f1f8e9;
  border: 1.5px dashed rgba(46,125,50,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  transition: all 0.2s ease;
}

.slot.filled {
  border-style: solid;
  border-color: rgba(46,125,50,0.3);
  background: white;
  animation: slotPop 0.25s ease;
}

.slot.matched {
  animation: slotMatch 0.35s ease forwards;
}

@keyframes slotPop {
  0% { transform: scale(0.5); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes slotMatch {
  0% { transform: scale(1); opacity: 1; background: #c8e6c9; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(0); opacity: 0; }
}

/* Tools bar */
.tools-bar {
  width: 92%;
  max-width: 420px;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.tool-btn {
  background: white;
  border: 2px solid #a5d6a7;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #2e7d32;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.2s;
}

.tool-btn:active {
  transform: scale(0.95);
  background: #e8f5e9;
}

.tool-btn .count {
  background: #2e7d32;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn.disabled {
  opacity: 0.4;
  cursor: default;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal {
  background: white;
  padding: 28px;
  border-radius: 24px;
  text-align: center;
  width: 300px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.modal h2 {
  color: #2e7d32;
  margin-bottom: 10px;
  font-size: 22px;
}

.modal p {
  font-size: 15px;
  margin-bottom: 6px;
  color: #555;
}

.modal .btn {
  margin-top: 14px;
  background: #2e7d32;
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
}

.modal .btn.secondary {
  background: #e8f5e9;
  color: #2e7d32;
  margin-top: 8px;
}

/* Goose reward */
.goose-reward {
  font-size: 80px;
  margin: 10px 0;
  animation: gooseBounce 1s ease infinite;
}

@keyframes gooseBounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

/* Level select */
.level-select {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.level-btn {
  flex: 1;
  padding: 14px;
  border: 2px solid #a5d6a7;
  border-radius: 14px;
  background: white;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.level-btn:active {
  transform: scale(0.96);
}

.level-btn .num {
  font-size: 28px;
  font-weight: 800;
  color: #2e7d32;
}

.level-btn .label {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.level-btn.hard {
  border-color: #ef5350;
}

.level-btn.hard .num {
  color: #c62828;
}

/* Info panel */
.info-panel {
  width: 92%;
  max-width: 420px;
  margin: 16px auto 40px;
  padding: 18px;
  background: rgba(46,125,50,0.08);
  border: 1px solid rgba(46,125,50,0.15);
  border-radius: 14px;
  color: #33691e;
  font-size: 13px;
  line-height: 1.6;
}

.info-panel h2 {
  color: #2e7d32;
  font-size: 16px;
  margin-bottom: 8px;
}

.info-panel h3 {
  font-size: 14px;
  margin-top: 12px;
  margin-bottom: 4px;
}

.info-panel ul {
  list-style: none;
  padding-left: 0;
}

.info-panel li {
  padding: 2px 0;
}

.info-panel li::before {
  content: '• ';
  color: #66bb6a;
}