/* Keep game cards bounded independently of board or image intrinsic size. */
.board .tile {
  width: var(--tile-size, 60px) !important;
  height: var(--tile-size, 60px) !important;
  min-width: 0;
  max-width: 80px;
  max-height: 80px;
  aspect-ratio: 1;
  border: 1px solid #ccc !important;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 4px #00000012 !important;
}
.board .tile .fruit-art { width: 76% !important; height: 76% !important; overflow: hidden; }
.board .tile .fruit-svg, .board .tile img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; overflow: hidden; }
.board .tile.is-blocked { opacity: .55; pointer-events: none; }
.slot-zone { background: #fff; border: 0; box-shadow: none; }
.progress span { background: #FF2442; }

/* Shared, explicit artwork dimensions prevent SVG intrinsic sizing from enlarging cards. */
.game { max-width: 480px; padding-left: 12px; padding-right: 12px; }
.board-area { flex: 1 0 auto; align-items: flex-start; padding-top: 12px; min-height: 270px; }
.board { margin: 0 auto; }
.tile { will-change: auto; }
.tile .fruit-art, .flight .fruit-art { display: flex; width: 76% !important; height: 76% !important; align-items: center; justify-content: center; overflow: hidden; }
.fruit-art svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.slot-cell .fruit-art, .reserve-card .fruit-art { width: 82%; height: 82%; }
.slot-cell { min-width: 0; cursor: pointer; overflow: hidden; color: #777; }
.slot-cell.locked { background: #f5f5f5; border: 1px solid #ddd; }
.slot-cell .mp-icon { width: 22px; height: 22px; }
.slots { gap: 4px; }
.slot-zone { margin-top: 8px; }
.atlas-link { min-height: 44px; font-size: 12px; }
.atlas-link b { font-size: 12px; }
.play-hint { margin: 8px 0; text-align: center; color: #888; font-size: 12px; line-height: 1.5; }
.flight { display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; border: 1px solid #ccc; border-radius: 12px; background: white; box-shadow: 0 3px 8px #0002; overflow: hidden; will-change: transform; }
.reserve { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 8px; }
.reserve:empty { display: none; }
.reserve-card { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid #ccc; border-radius: 10px; background: white; }
.mask[hidden] { display: none !important; }
#dialogActions { display: grid; gap: 10px; }
#dialogActions .action-btn { width: 100%; min-height: 48px; margin: 0; background: #FF2442; color: white; border: 0; border-radius: 12px; justify-content: center; }
#dialogActions .action-btn + .action-btn { background: #f4f4f4; color: #333; }
.fruit-sheet { width: min(94vw,420px); max-height: 88dvh; overflow-y: auto; padding: 20px 16px; }
.fruit-sheet h2 { margin: 0 40px 14px 0; font-size: 20px; text-align: left; }
.fruit-reference { width: 100%; height: 90px; overflow: hidden; border-radius: 12px; margin-bottom: 12px; }
.fruit-reference img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fruit-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.fruit-entry { min-width: 0; display: flex; align-items: center; flex-direction: column; padding: 5px 2px; border: 1px solid #eee; border-radius: 10px; }
.fruit-entry .fruit-art { width: 48px; height: 48px; }
.fruit-entry span:last-child { max-width: 100%; font-size: 10px; line-height: 1.4; color: #666; overflow-wrap: anywhere; }
.red-particle { position: fixed; z-index: 10000; width: 5px; height: 5px; border-radius: 50%; background: #FF2442; pointer-events: none; }
.match-pop { animation: matchFade .18s ease-out both !important; }
@keyframes matchFade { to { transform: scale(.5); opacity: 0; } }
@media (max-width: 350px) { .game { padding-left: 8px; padding-right: 8px; } .slot-meta { padding-left: 0; padding-right: 0; } }

/* Failure prompts must not capture input outside their visible panel. */
#dialog.mask {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(88vw, 340px);
  height: auto;
  padding: 0;
  background: transparent;
  z-index: 100;
}
#dialog .sheet {
  width: 100%;
  max-height: 45dvh;
  overflow-y: auto;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #ffe8ec;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(255,36,66,.15);
}
.tools, .home-entries { position: relative; z-index: 101; }
.menu-btn { position: relative; z-index: 101; }
