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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 20px;
  background: #14161f;
  color: #f4f0e6;
  font-family: "Courier New", "SimSun", monospace;
  user-select: none;
}

.header {
  text-align: center;
  margin-bottom: 26px;
}

h1 {
  font-size: 44px;
  letter-spacing: 6px;
  text-shadow:
    3px 3px 0 #e63946,
    -2px -2px 0 #457b9d;
}

.subtitle {
  margin-top: 10px;
  color: #a8b2c1;
  font-size: 18px;
  letter-spacing: 2px;
}

.game-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.card {
  position: relative;
  width: min(560px, 94vw);
  height: min(470px, 60vh);
  min-height: 320px;
  border: 6px solid #2b3040;
  border-radius: 10px;
  background:
    linear-gradient(45deg, #22263a 25%, transparent 25%) 0 0 / 26px 26px,
    linear-gradient(-45deg, #22263a 25%, transparent 25%) 0 0 / 26px 26px,
    linear-gradient(45deg, transparent 75%, #22263a 75%) 0 0 / 26px 26px,
    linear-gradient(-45deg, transparent 75%, #22263a 75%) 0 0 / 26px 26px,
    #1a1f31;
  box-shadow:
    0 0 0 2px #0b0d14,
    0 14px 0 rgba(0, 0, 0, 0.35);
  overflow: hidden;
  touch-action: none;
}

.food-layer {
  position: absolute;
  inset: 0;
}

.food {
  position: absolute;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
  cursor: pointer;
  transition: transform 0.15s ease;
}

.food.caught {
  transform: translate(-50%, -50%) scale(1.45);
  filter: drop-shadow(0 0 10px #ffd166);
  z-index: 10;
}

.food.rare {
  animation: rareGlow 1.2s ease-in-out infinite;
}

@keyframes rareGlow {
  0%,
  100% {
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 4px #ffd166);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    filter: drop-shadow(0 0 14px #ffd166) drop-shadow(0 0 24px #fff3c4);
  }
}

.cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(560px, 94vw);
}

.bag-card {
  align-self: flex-end;
  width: min(280px, 100%);
  border: 6px solid #2b3040;
  border-radius: 10px;
  background: #1a1f31;
  padding: 10px 12px 12px;
  box-shadow:
    0 0 0 2px #0b0d14,
    0 8px 0 rgba(0, 0, 0, 0.35);
}

.bag-title {
  font-size: 18px;
  letter-spacing: 4px;
  color: #e9c46a;
  margin-bottom: 8px;
}

.bag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}

.bag-item {
  background: #2b3040;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 14px;
  line-height: 1.5;
}

.bag-total {
  margin-top: 8px;
  color: #9aa3b5;
  font-size: 13px;
}

.bag-round {
  margin-top: 4px;
  color: #e9c46a;
  font-size: 13px;
}

.bag-rare {
  margin-top: 4px;
  color: #ffd166;
  font-size: 13px;
}

.end-btn {
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 3px;
  padding: 10px 24px;
  color: #f4f0e6;
  background: #2b3040;
  border: 2px solid #0b0d14;
  border-radius: 6px;
  cursor: pointer;
  box-shadow:
    0 5px 0 #0b0d14,
    0 8px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.end-btn:active {
  transform: translateY(4px);
  box-shadow:
    0 1px 0 #0b0d14,
    0 4px 8px rgba(0, 0, 0, 0.3);
}

.end-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow:
    0 5px 0 #0b0d14,
    0 8px 12px rgba(0, 0, 0, 0.3);
}

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

.catch-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.floating-catch {
  position: absolute;
  z-index: 20;
  font-size: 26px;
  pointer-events: none;
  transform: translate(-50%, -100%);
  animation: floatUp 0.7s ease-out forwards;
}

.floating-catch.rare-float {
  font-size: 34px;
  color: #ffd166;
  text-shadow: 0 0 12px #ffd166;
}

@keyframes floatUp {
  from {
    opacity: 1;
    transform: translate(-50%, -100%);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -220%);
  }
}

.achievement-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: #2b3040;
  border: 4px solid #ffd166;
  border-radius: 8px;
  color: #ffd166;
  font-size: 16px;
  letter-spacing: 2px;
  padding: 10px 18px;
  box-shadow:
    0 0 0 2px #0b0d14,
    0 8px 16px rgba(0, 0, 0, 0.4);
  animation: toastInOut 2.4s ease forwards;
  pointer-events: none;
}

@keyframes toastInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
  }
  12% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }
}

.bag-item.rare-item {
  border: 2px solid #ffd166;
  color: #ffd166;
}

.chopsticks {
  position: absolute;
  z-index: 5;
  font-size: 48px;
  transform: translate(-50%, -50%) rotate(-18deg);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.4));
  pointer-events: none;
}

.hint {
  color: #9aa3b5;
  font-size: 14px;
  text-align: center;
  line-height: 1.8;
}

kbd {
  background: #2b3040;
  border: 2px solid #0b0d14;
  border-radius: 4px;
  padding: 2px 7px;
  font-family: inherit;
  color: #f4f0e6;
}

.status {
  min-height: 26px;
  color: #e9c46a;
  font-size: 16px;
  letter-spacing: 1px;
}

.footer {
  margin-top: 22px;
  color: #555d6e;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px;
  background: rgba(8, 10, 16, 0.84);
}

.modal.hidden {
  display: none;
}

.modal-box {
  width: min(340px, 88vw);
  margin: auto;
  padding: 34px 26px 28px;
  text-align: center;
  background: #1b2030;
  border: 6px solid #2b3040;
  border-radius: 12px;
  box-shadow:
    0 0 0 2px #0b0d14,
    0 16px 0 rgba(0, 0, 0, 0.4);
  animation: pop 0.35s ease-out;
}

.catch-emoji {
  font-size: 84px;
  margin-bottom: 8px;
  animation: bounce 0.5s ease-out;
}

.modal-box h2 {
  font-size: 22px;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.modal-box p {
  color: #e9c46a;
  font-size: 18px;
  margin-bottom: 22px;
}

#again-btn {
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 3px;
  padding: 12px 28px;
  color: #14161f;
  background: #e9c46a;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow:
    0 5px 0 #a8863e,
    0 8px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

#again-btn:active {
  transform: translateY(4px);
  box-shadow:
    0 1px 0 #a8863e,
    0 4px 8px rgba(0, 0, 0, 0.35);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 2px;
  padding: 12px 20px;
  color: #f4f0e6;
  background: #457b9d;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow:
    0 5px 0 #2b4a63,
    0 8px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.share-btn:active {
  transform: translateY(4px);
  box-shadow:
    0 1px 0 #2b4a63,
    0 4px 8px rgba(0, 0, 0, 0.35);
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bounce {
  0% {
    transform: scale(0);
  }
  60% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}
