:root {
  --card-max: 900px;
  --text: #f7f8ff;
  --shadow: rgba(15, 18, 38, 0.45);
  --panel: rgba(26, 30, 58, 0.82);
  --accent: #fcd34d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #34365f, #17182d 68%);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0.8rem;
}

.game-card {
  width: min(100%, var(--card-max));
  background: rgba(11, 14, 29, 0.62);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 14px 30px var(--shadow);
  padding: 0.9rem;
  overflow-x: clip;
}

h1 { margin: 0; text-align: center; }
.subtitle { margin: 0.3rem 0 0.8rem; text-align: center; opacity: 0.9; }

.status-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.status-pill,
.small-btn {
  min-width: 0;
  text-align: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  color: var(--text);
  font-size: 0.95rem;
}

.small-btn { cursor: pointer; }
.small-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.game-area {
  position: relative;
  width: 100%;
  max-width: 820px;
  aspect-ratio: 16 / 10;
  min-height: 340px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.22);
  background: center/cover no-repeat url("catcher-background.png");
  touch-action: none;
}

.player {
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: clamp(58px, 10vw, 92px);
  aspect-ratio: 1/1;
  background: center/contain no-repeat url("tato-catch.png");
  transform: translateX(-50%);
}

.falling-item {
  position: absolute;
  width: 48px;
  aspect-ratio: 1/1;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 8, 20, 0.5);
}
.overlay.hidden { display: none; }

.panel {
  width: min(92%, 540px);
  text-align: center;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 14px;
  padding: 1rem 1.25rem;
}

.big-btn {
  margin-top: 0.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #171725;
}

.result-panel {
  background: linear-gradient(rgba(16, 13, 30, 0.82), rgba(16, 13, 30, 0.82)), center/cover no-repeat url("judgment-background.png");
}
.judge { width: min(120px, 30%); height: auto; }
.verdict { font-weight: 700; font-size: 1.1rem; }
.flavor { opacity: 0.9; font-style: italic; }

.floating-text {
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  font-weight: 700;
  text-shadow: 0 2px 8px #000;
  pointer-events: none;
  opacity: 0;
}
.floating-text.show { animation: pop 650ms ease-out; }
@keyframes pop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.7); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(1.03); }
}

.help-row { text-align: center; font-size: 0.92rem; opacity: 0.85; }

@media (max-width: 900px) {
  .status-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .app-shell { padding: 0.45rem; }
  .game-card {
    width: 100%;
    padding: 0.65rem;
    border-radius: 14px;
  }

  .status-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-pill,
  .small-btn {
    font-size: 0.9rem;
    padding: 0.45rem 0.55rem;
  }

  .game-area {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 9 / 14;
    min-height: 480px;
  }

  .panel { width: min(94%, 420px); padding: 0.9rem 0.9rem; }
}
