/* Pear Presser — styles for the thinking arcade games: Orchard Match, Pear Expedition.
   Loaded after style.css: the base .m-* and .ex-* rules live there, this file extends and overrides them. */

/* =====================================================================
   Orchard Match
   ===================================================================== */
.m-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 7px; padding: 8px; place-items: normal; }

/* goal bar: stage name on the left, one chip per goal */
.m-goal { flex: none; display: flex; align-items: stretch; gap: 9px; min-height: 50px; padding: 5px 10px; background: var(--cream); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 0 3px 0 var(--ink); }
.m-goal-stage { flex: none; display: flex; flex-direction: column; justify-content: center; padding-right: 9px; border-right: 2.5px dashed rgba(35,52,26,.22); }
.m-goal-stage small { font-size: 10.5px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.m-goal-stage b { font-family: var(--display); font-weight: 600; font-size: 15.5px; line-height: 1.1; white-space: nowrap; }
.m-goal-list { flex: 1; display: flex; gap: 9px; min-width: 0; }
.m-g { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.m-g-ico, .m-g-fruit { flex: none; width: 32px; height: 32px; border-radius: 10px; border: 2px solid var(--ink); display: grid; place-items: center; font-style: normal; font-size: 17px; line-height: 1; background: #fff3a8; }
.m-g-ico.ice { background: #cdeeff; }
.m-g-ico.honey { background: #ffd76a; }
.m-g-fruit { background-color: #eaffc0; background-size: 84% 84%; background-position: center; background-repeat: no-repeat; }
.m-g-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-g-body b { font-family: var(--display); font-weight: 600; font-size: 15px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-g-body b span { font-size: 11.5px; color: var(--ink-soft); }
.m-g-body b .ico { font-size: .9em; vertical-align: -1px; }
.m-g-bar { height: 9px; border: 2px solid var(--ink); border-radius: 999px; background: #d9cc98; overflow: hidden; }
.m-g-bar u { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #d6f96a, #7cc91f); transition: width .25s ease-out; text-decoration: none; }
.m-g.done b { color: #2f8a12; }
.m-g.done .m-g-ico, .m-g.done .m-g-fruit { animation: spin-pop .45s; }
.m-g.done .m-g-bar u { background: linear-gradient(180deg, #fff59a, #ffc928); }

/* board */
.m-field { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; }
.m-board { --s: 48px; box-shadow: 0 4px 0 var(--ink); outline-offset: 3px;
  background-color: rgba(35,20,60,.42);
  background-image: repeating-conic-gradient(rgba(255,255,255,.07) 0 25%, transparent 0 50%);
  background-size: calc(var(--s) * 2) calc(var(--s) * 2); background-origin: padding-box; }
.m-wrap[data-stage="2"] .m-board { background-color: rgba(20,60,110,.5); }
.m-wrap[data-stage="3"] .m-board { background-color: rgba(90,45,10,.5); }
.m-under, .m-layer { position: absolute; inset: 0; }
.m-layer { border-radius: 13px; }
.m-cursor { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; border: 3px dashed #fff; border-radius: 26%; transition: transform .08s; }

/* honey: a layer under the cell */
.m-honey { position: absolute; left: 0; top: 0; padding: 1px; animation: pop .3s backwards; }
.m-honey::before { content: ""; display: block; width: 100%; height: 100%; border-radius: 24%; background: radial-gradient(circle at 30% 24%, #fff6b8, #ffc21f 48%, #f09a00); box-shadow: inset 0 0 0 2px #a85c00, inset 0 -5px 0 rgba(150,70,0,.3); }
.m-honey.thick::before { background: radial-gradient(circle at 30% 24%, #ffd45a, #ef8a00 52%, #b55400); box-shadow: inset 0 0 0 2px #6b3300, inset 0 0 0 5px #ffd76a, inset 0 -7px 0 rgba(90,40,0,.35); }
.m-honey.out { animation: m-out .3s ease-in forwards; }
@keyframes m-out { to { transform-origin: center; opacity: 0; filter: brightness(1.6); } }

/* frozen fruit and crates */
.m-tile.ice i { background-color: rgba(190,232,255,.6); }
.m-tile.ice i::before { content: ""; position: absolute; inset: -1px; border-radius: 26%; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.9) 0 13%, rgba(150,215,255,.5) 13% 40%, rgba(255,255,255,.6) 40% 47%, rgba(120,195,255,.45) 47% 80%, rgba(255,255,255,.7) 80%);
  box-shadow: inset 0 0 0 2.5px #e6f8ff, 0 0 0 1.5px rgba(30,80,150,.7); }
.m-tile.ice2 i::before { background: linear-gradient(135deg, rgba(255,255,255,.95) 0 16%, rgba(130,200,255,.72) 16% 40%, rgba(255,255,255,.8) 40% 50%, rgba(100,175,250,.7) 50% 78%, rgba(255,255,255,.85) 78%);
  box-shadow: inset 0 0 0 2.5px #fff, inset 0 0 0 5.5px rgba(70,140,220,.75), 0 0 0 1.5px rgba(20,60,130,.85); }
.m-tile.crate i { border-radius: 16%; background: linear-gradient(45deg, transparent 43%, #8a5418 43% 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, #8a5418 43% 57%, transparent 57%), repeating-linear-gradient(90deg, #d59a48 0 22%, #b97a2c 22% 25%);
  box-shadow: inset 0 0 0 2.5px var(--ink), inset 0 0 0 6px #e8b662, inset 0 0 0 7.5px rgba(90,50,10,.55); }

/* feedback */
.m-tile.born i { animation: m-born .4s cubic-bezier(.3,1.8,.5,1); }
.m-tile.hint i { animation: m-hint .62s ease-in-out infinite; box-shadow: inset 0 0 0 3px #fff, 0 0 10px 2px #fff; }
.m-tile.deny i { animation: m-deny .28s; }
.m-tile.shuf i { transform: scale(.25) rotate(120deg); opacity: .2; transition: transform .22s, opacity .22s; }
@keyframes m-born { from { transform: scale(1.5); filter: brightness(2); } }
@keyframes m-hint { 0%, 100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-9deg) scale(1.08); } 75% { transform: rotate(9deg) scale(1.08); } }
@keyframes m-deny { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.m-zap.box { border-radius: 18px; background: rgba(255,255,255,.8); }
.m-puff { position: absolute; z-index: 3; pointer-events: none; border-radius: 50%; animation: m-puff .4s ease-out forwards; }
.m-puff.frost { background: radial-gradient(circle, #fff 0 22%, rgba(170,225,255,.85) 23% 44%, transparent 45%), conic-gradient(from 20deg, transparent 0 8%, #e6f8ff 8% 12%, transparent 12% 33%, #e6f8ff 33% 37%, transparent 37% 58%, #e6f8ff 58% 62%, transparent 62% 83%, #e6f8ff 83% 87%, transparent 87%); }
.m-puff.wood { background: radial-gradient(circle, #f2c57a 0 26%, rgba(170,105,40,.85) 27% 46%, transparent 47%); }
.m-puff.drip { background: radial-gradient(circle, #fff3a8 0 24%, rgba(255,180,20,.8) 25% 44%, transparent 45%); }
.m-puff.ray { background: conic-gradient(#ff5e5e, #ffd23d, #6fdc3a, #4fb8ff, #c77dff, #ff5e5e); animation-duration: .5s; }
@keyframes m-puff { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }

/* stage cards */
.m-card { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 16px; background: rgba(16,30,10,.38); animation: fade .18s; transition: opacity .2s; }
.m-card.intro { pointer-events: none; background: none; }
.m-card.out { opacity: 0; }
.m-card-in { width: min(100%, 290px); display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 16px 14px; text-align: center; background: var(--cream); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); animation: dlg-in .3s cubic-bezier(.2,1.4,.4,1); }
.m-card-in small { font-size: 12px; font-weight: 800; color: var(--ink-soft); letter-spacing: .3px; text-transform: uppercase; }
.m-card-in h3 { font-family: var(--display); font-weight: 700; font-size: 25px; line-height: 1.05; }
.m-card-in p { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.m-card-in p b { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--ink); }
.m-card-goal { align-self: stretch; display: flex; align-items: center; gap: 9px; padding: 5px 9px; border-radius: 12px; border: 2px solid var(--ink); background: #fffdf2; font-family: var(--display); font-weight: 600; font-size: 15px; text-align: left; line-height: 1.15; }
.m-card.good h3 { color: #2f8a12; }
.m-card.bad h3 { color: #c2330a; }
.m-tally { align-self: stretch; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 10px; border-radius: 10px; background: #fffdf2; border: 2px solid var(--ink); font-size: 13.5px; font-weight: 800; color: var(--ink-soft); }
.m-tally b { font-family: var(--display); font-weight: 600; font-size: 17px; color: #2f8a12; }

@media (max-width: 350px) {
  .m-goal { gap: 6px; padding: 5px 7px; }
  .m-goal-stage { padding-right: 6px; }
  .m-goal-stage b { font-size: 13.5px; }
  .m-goal-list { gap: 6px; }
  .m-g { gap: 4px; }
  .m-g-ico, .m-g-fruit { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
  .m-g-body b { font-size: 13.5px; }
  .m-g-body b span { font-size: 10.5px; }
}
/* mouse: show what can be picked up */
@media (hover: hover) and (pointer: fine) {
  .m-board { cursor: pointer; }
  .m-tile:not(.ice):not(.crate):hover i { box-shadow: inset 0 0 0 2px rgba(255,255,255,.75); }
}
