* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #f6efdf; color: #443b2c; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif; }
button { font: inherit; cursor: pointer; min-height: 44px; border: 0; border-radius: 12px; background: #ffe4c9; color: #874513; font-weight: 600; padding: 10px 14px; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible { outline: 3px solid #ff8a3d; outline-offset: 3px; }
.page { max-width: 480px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom)); }
.card { position: relative; }
.score-bar { display: flex; align-items: center; gap: 14px; padding: 14px; background: #fff9ec; border: 1px solid #e9d8b7; border-radius: 16px; }
.score-bar > div { flex: 1; }
.score-bar span { display: block; color: #8b7b61; font-size: 12px; }
.score-bar strong { display: block; color: #b65c24; font-size: 25px; margin-top: 4px; font-variant-numeric: tabular-nums; }
#undoBtn { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.instruction { margin: 18px 0 12px; text-align: center; font-size: 14px; font-weight: 600; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 9px; border: 3px solid #b2ba80; border-radius: 18px; background: #c8d29b; touch-action: none; user-select: none; -webkit-user-select: none; }
.cell { aspect-ratio: 1; position: relative; min-width: 0; border-radius: 12px; background: #e4eac7; border: 2px solid transparent; display: flex; align-items: center; justify-content: center; }
.cell:nth-child(even) { background: #dce5b7; }
.cell.occupied { background: #fff8df; cursor: grab; box-shadow: 0 3px 0 #a9b779; }
.cell > .mp-icon { color: var(--plant-color, #6ca83e); font-size: clamp(28px, 9vw, 43px); margin-bottom: 12px; }
.level { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 700; color: #635a37; }
.drag-source { opacity: .35; }
.drop-ok { border-color: #ff8a3d; background: #fff0c7 !important; }
.drop-no { border-color: #c86051; }
.drag-ghost { position: fixed; pointer-events: none; z-index: 50; transform: translate(-50%, -65%); opacity: .95; box-shadow: 0 8px 15px #4d562a44; background: #fff8df; }
.game-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: #887b61; margin: 12px 2px; line-height: 1.6; }
#poolLabel { flex-shrink: 0; color: #aa5e26; }
.tip { margin: 18px 0 0; text-align: center; font-size: 12px; color: #92846e; line-height: 1.9; }
.toast { position: fixed; z-index: 60; top: 18%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 90vw; background: #55452e; color: #fff5dc; border-radius: 12px; padding: 14px 18px; font-size: 14px; box-shadow: 0 5px 20px #443b2c33; }
.overlay { position: fixed; z-index: 40; inset: 0; background: #302d226b; padding: 24px; display: flex; align-items: center; justify-content: center; overflow-y: auto; }
[hidden] { display: none !important; }
.result-card { width: 100%; max-width: 340px; padding: 28px 24px; border-radius: 22px; background: #fff8e9; text-align: center; box-shadow: 0 12px 36px #302d2244; }
.result-card h2 { font-size: 28px; margin: 6px 0 26px; }
.result-card p { font-size: 14px; color: #88785b; }
.result-caption { color: #b65c24 !important; margin: 0; }
.final-score { font-size: 48px; color: #d7702d; }
.result-card button { display: block; width: 100%; margin-top: 12px; }
.primary { background: #ff8a3d; color: #fff; }
@media (max-width: 350px) { .page { padding-left: 8px; padding-right: 8px; } .score-bar { gap: 8px; padding: 10px; } .board { gap: 4px; padding: 6px; } }
