/* Petal's Memory Meadow — styles (layers on top of shared/gamekit.css) */

:root {
    --mm-sky-top: #C8E8FA;
    --mm-sky-mid: #E4F4FE;
    --mm-horizon: #FFF8EC;
    --mm-leaf-a: #C7E893;
    --mm-leaf-b: #8CC63F;
    --mm-card-max: 168px;
    --mm-gap: 14px;
}

html, body { overflow: hidden; }

#stage {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: linear-gradient(var(--mm-sky-top) 0%, var(--mm-sky-mid) 52%, var(--mm-horizon) 74%);
}

/* ══ Meadow background ══════════════════════════════════════════════════ */

#meadow { position: absolute; inset: 0; pointer-events: none; }

#sun {
    position: absolute;
    top: 2%;
    left: 2.5%;
    width: clamp(110px, 15vw, 185px);
    z-index: 1;
    transition: transform 0.9s ease;
}

/* during play the sun tucks into the corner so the level chip
   and paw meters get clean sky to sit on */
#stage[data-screen="play"] #sun { transform: translate(-32%, -36%); }

#sun-rays {
    transform-box: fill-box;
    transform-origin: center;
    animation: mm-sun-spin 42s linear infinite;
}

@keyframes mm-sun-spin { to { transform: rotate(1turn); } }

.cloud {
    position: absolute;
    z-index: 1;
    opacity: 0.92;
    filter: drop-shadow(0 6px 8px rgba(120, 160, 200, 0.18));
}

.cloud-a { top: 6%;  left: -260px; width: clamp(150px, 19vw, 240px); animation: mm-drift 85s linear infinite; }
.cloud-b { top: 17%; left: -260px; width: clamp(110px, 14vw, 180px); animation: mm-drift 62s linear infinite; animation-delay: -30s; opacity: 0.8; }

@keyframes mm-drift {
    from { transform: translateX(0); }
    to   { transform: translateX(calc(100vw + 300px)); }
}

#bee-flyer {
    position: absolute;
    top: 12%;
    left: 0;
    width: 44px;
    z-index: 1;
    animation: mm-bee-fly 26s ease-in-out infinite;
}

.bee-wing  { transform-box: fill-box; transform-origin: 80% 90%; animation: mm-buzz 0.22s ease-in-out infinite alternate; }
.bee-wing2 { transform-origin: 20% 90%; animation-delay: 0.11s; }

@keyframes mm-buzz { from { transform: rotate(-14deg); } to { transform: rotate(10deg); } }

@keyframes mm-bee-fly {
    0%   { transform: translate(18vw, 6vh)  scaleX(1); }
    24%  { transform: translate(64vw, 1vh)  scaleX(1); }
    50%  { transform: translate(86vw, 9vh)  scaleX(1); }
    51%  { transform: translate(86vw, 9vh)  scaleX(-1); }
    75%  { transform: translate(45vw, 2vh)  scaleX(-1); }
    99%  { transform: translate(18vw, 6vh)  scaleX(-1); }
    100% { transform: translate(18vw, 6vh)  scaleX(1); }
}

#hills {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: min(46vh, 430px);
    z-index: 1;
}

#hills svg { width: 100%; height: 100%; display: block; }

#tulips {
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: clamp(58px, 9vh, 92px);
    z-index: 2;
}

#tulips svg { width: 100%; height: 100%; display: block; }

/* ══ Screens ═════════════════════════════════════════════════════════════ */

.screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    animation: gk-fade-in 0.4s ease-out;
}

#screen-play { overflow: hidden; }

/* ── Title ── */

#screen-title { justify-content: center; gap: 8px; }

#game-title {
    font-size: clamp(2.1rem, 6.5vw, 3.6rem);
    text-align: center;
    line-height: 1.05;
    color: #FFFFFF;
    text-shadow:
        0 3px 0 var(--gk-pink),
        0 7px 18px rgba(181, 101, 216, 0.55);
    letter-spacing: 1px;
    margin-top: 2vh;
}

#tagline {
    font-size: clamp(1rem, 2.6vw, 1.3rem);
    color: var(--gk-text);
    background: rgba(255, 255, 255, 0.65);
    border-radius: 30px;
    padding: 4px 18px;
}

.petal { pointer-events: none; }
.petal svg { width: 100%; height: 100%; display: block; overflow: visible; }

#petal-title { width: clamp(140px, 24vh, 210px); height: clamp(165px, 28vh, 250px); }

#btn-play { font-size: clamp(1.4rem, 4.5vw, 1.9rem); padding: 16px 58px; margin-top: 4px; }

#star-shelf {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    z-index: 51;
}

.shelf-chip {
    background: rgba(255, 255, 255, 0.82);
    border-radius: 18px;
    padding: 8px 14px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    box-shadow: 0 4px 12px rgba(90, 60, 130, 0.15);
    min-width: 84px;
}

.shelf-chip .shelf-flower { width: 34px; height: 34px; }
.shelf-chip .shelf-stars { font-size: 0.85rem; letter-spacing: 1px; }
.shelf-chip .shelf-stars .off { filter: grayscale(1) opacity(0.3); }

/* ── Mode select ── */

#screen-mode { justify-content: center; gap: clamp(12px, 2.5vh, 26px); }

#mode-heading {
    font-size: clamp(1.7rem, 5vw, 2.6rem);
    color: #FFFFFF;
    text-shadow: 0 3px 0 var(--gk-purple), 0 6px 16px rgba(181, 101, 216, 0.5);
}

#mode-cards {
    display: flex;
    gap: clamp(14px, 3vw, 34px);
    justify-content: center;
    width: 100%;
}

.mode-card {
    width: min(41vw, 350px);
    min-height: clamp(180px, 26vh, 240px);
    border: 5px solid rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    background: linear-gradient(170deg, #FFFFFF 0%, #FFF3E4 100%);
    box-shadow: var(--gk-shadow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.18s, box-shadow 0.18s;
}

.mode-card:hover  { transform: translateY(-5px) scale(1.03); box-shadow: 0 16px 36px rgba(90, 60, 130, 0.28); }
.mode-card:active { transform: scale(0.96); }

.mode-label {
    font-size: clamp(1.3rem, 3.4vw, 1.7rem);
    font-weight: bold;
    color: var(--gk-text);
}

.mode-art { display: flex; align-items: flex-end; gap: 6px; }
.mode-art svg { display: block; }

#level-row { display: flex; gap: clamp(12px, 2.5vw, 24px); }

.level-badge {
    width: clamp(96px, 12vw, 118px);
    height: clamp(108px, 14vw, 130px);
    border: none;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 6px 16px rgba(90, 60, 130, 0.18);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: relative;
    transition: transform 0.18s, box-shadow 0.18s;
}

.level-badge:hover { transform: translateY(-4px); }

.level-badge .badge-art { width: 62px; height: 62px; position: relative; }
.level-badge .badge-art svg { width: 100%; height: 100%; display: block; }

.level-badge .badge-lock {
    position: absolute;
    right: -8px;
    bottom: -4px;
    font-size: 1.15rem;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25));
}

.level-badge .badge-stars { font-size: 0.72rem; letter-spacing: 1px; }
.level-badge .badge-stars .off { filter: grayscale(1) opacity(0.3); }

.level-badge.selected {
    outline: 5px solid var(--gk-pink);
    outline-offset: -2px;
    transform: translateY(-4px) scale(1.05);
}

.level-badge.locked { background: rgba(240, 240, 235, 0.75); }

.level-badge.rainbow::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 32px;
    background: conic-gradient(#E63946, #F77F00, #FCBF49, #7CB518, #00B4D8, #B565D8, #E63946);
    z-index: -1;
    animation: mm-sun-spin 7s linear infinite;
}

.level-badge.bloom { animation: mm-bloom 0.7s cubic-bezier(0.2, 1.7, 0.4, 1); }

@keyframes mm-bloom {
    0%   { transform: scale(0.3) rotate(-20deg); }
    60%  { transform: scale(1.18) rotate(6deg); }
    100% { transform: scale(1) rotate(0); }
}

.level-badge.wobble { animation: mm-shy 0.45s ease 1; }

/* ── Play screen chrome ── */

#play-top {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
}

#level-chip {
    background: rgba(255, 255, 255, 0.88);
    border-radius: 30px;
    padding: 6px 14px 6px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    font-size: 1.15rem;
    color: var(--gk-text);
    box-shadow: 0 4px 12px rgba(90, 60, 130, 0.2);
}

#level-chip svg { width: 34px; height: 34px; }

#progress-pips {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    padding: 6px 12px;
    display: flex;
    gap: 4px;
    font-size: 1.05rem;
}

#progress-pips .pip { filter: grayscale(1) opacity(0.35); transition: filter 0.3s; }
#progress-pips .pip.filled { filter: none; animation: gk-star-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }

/* paw meters (2-player) */

.paw-meter {
    position: absolute;
    top: 78px;
    z-index: 60;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 40px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 4px 14px rgba(90, 60, 130, 0.2);
    transition: box-shadow 0.3s, transform 0.3s;
}

#meter-kid   { left: 12px;  transform-origin: left center; }
#meter-grown { right: 12px; transform-origin: right center; }

.paw-meter .meter-face { width: 38px; height: 38px; }
.paw-meter .meter-face svg { width: 100%; height: 100%; display: block; }
.paw-meter .stamp { width: 26px; height: 26px; animation: gk-star-pop 0.5s cubic-bezier(0.2, 1.7, 0.4, 1); }
.paw-meter .stamp svg { width: 100%; height: 100%; display: block; }

.paw-meter.active { transform: scale(1.06); }
#meter-kid.active   { animation: mm-halo-pink 1.4s ease-in-out infinite; }
#meter-grown.active { animation: mm-halo-blue 1.4s ease-in-out infinite; }

@keyframes mm-halo-pink {
    0%, 100% { box-shadow: 0 0 0 4px rgba(255, 123, 172, 0.85), 0 4px 14px rgba(90, 60, 130, 0.2); }
    50%      { box-shadow: 0 0 0 9px rgba(255, 123, 172, 0.35), 0 4px 14px rgba(90, 60, 130, 0.2); }
}

@keyframes mm-halo-blue {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.85), 0 4px 14px rgba(90, 60, 130, 0.2); }
    50%      { box-shadow: 0 0 0 9px rgba(0, 180, 216, 0.35), 0 4px 14px rgba(90, 60, 130, 0.2); }
}

/* ══ Board & cards ═══════════════════════════════════════════════════════ */

#board-wrap {
    position: absolute;
    top: 108px;
    bottom: 102px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#board {
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), var(--card));
    grid-auto-rows: var(--card);
    gap: var(--mm-gap);
    --card: min(
        calc((100vw - 40px - (var(--cols, 3) - 1) * var(--mm-gap)) / var(--cols, 3)),
        calc((100dvh - 252px - (var(--rows, 2) - 1) * var(--mm-gap)) / var(--rows, 2)),
        var(--mm-card-max)
    );
}

.card {
    position: relative;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    perspective: 750px;
    opacity: 0;
    transform: scale(0);
}

.card.dealt {
    opacity: 1;
    transform: scale(1);
    transition: transform 0.45s cubic-bezier(0.2, 1.7, 0.4, 1), opacity 0.2s;
}

.card-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.35s cubic-bezier(0.45, 0.05, 0.35, 1.15);
}

.card.flipped .card-inner { transform: rotateY(180deg); }

.face {
    position: absolute;
    inset: 0;
    border-radius: 20%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 7px 16px rgba(58, 92, 16, 0.28);
}

.face svg { display: block; }

.face.back {
    background: linear-gradient(160deg, var(--mm-leaf-a) 0%, var(--mm-leaf-b) 100%);
    border: 3px solid rgba(255, 255, 255, 0.75);
}

.face.back svg { width: 96%; height: 96%; }

.face.front {
    transform: rotateY(180deg);
    background: radial-gradient(circle at 35% 28%, #FFFFFF 0%, var(--fc, #FFF3E4) 78%);
    border: 3px solid #FFFFFF;
}

.face.front .med-wrap { width: 88%; height: 88%; }
.face.front .med-wrap svg { width: 100%; height: 100%; }

.med-wrap.wiggle { animation: mm-wiggle 0.42s ease 2; }

@keyframes mm-wiggle {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(-6deg) scale(1.05); }
    75%      { transform: rotate(6deg) scale(1.05); }
}

.card.bounce { animation: mm-bounce 0.55s ease; }

@keyframes mm-bounce {
    0%, 100% { transform: scale(1); }
    35%      { transform: scale(1.16); }
    70%      { transform: scale(0.95); }
}

.card.shy { animation: mm-shy 0.55s ease 2; }

@keyframes mm-shy {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(3deg); }
    75%      { transform: rotate(-3deg); }
}

.card.gone {
    transform: scale(0) rotate(24deg);
    opacity: 0;
    filter: sepia(1) saturate(2.4) brightness(1.2) hue-rotate(-12deg);
    transition: transform 0.55s ease-in 0.18s, opacity 0.5s ease-in 0.25s, filter 0.3s;
}

/* sparkle burst particles */

.spark {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 800;
    animation: mm-spark 0.75s ease-out forwards;
}

@keyframes mm-spark {
    from { transform: translate(0, 0) scale(1);    opacity: 1; }
    to   { transform: translate(var(--dx), var(--dy)) scale(0.15); opacity: 0; }
}

/* flying friends + friend row */

.fly-friend {
    position: fixed;
    z-index: 810;
    pointer-events: none;
    transition: transform 0.65s cubic-bezier(0.35, -0.15, 0.4, 1.1);
}

.fly-friend svg { width: 100%; height: 100%; display: block; }

#friend-row {
    position: absolute;
    bottom: clamp(26px, 5vh, 46px);
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.friend {
    width: clamp(44px, 6vw, 58px);
    height: clamp(44px, 6vw, 58px);
    filter: drop-shadow(0 4px 4px rgba(58, 92, 16, 0.35));
}

.friend svg { width: 100%; height: 100%; display: block; }

.friend.pop { animation: gk-star-pop 0.45s cubic-bezier(0.2, 1.7, 0.4, 1); }

.friend.parade { animation: mm-hop 0.55s ease-in-out 3; }

@keyframes mm-hop {
    0%, 100% { transform: translateY(0); }
    45%      { transform: translateY(-26px) rotate(-4deg); }
}

/* ══ Petal the bunny ═════════════════════════════════════════════════════ */

#petal-play {
    position: absolute;
    bottom: clamp(78px, 12vh, 110px);
    left: 10px;
    width: clamp(82px, 10.5vw, 138px);
    height: clamp(100px, 13vw, 170px);
    z-index: 30;
    transition: left 0.85s cubic-bezier(0.5, -0.2, 0.4, 1.25);
    display: none;
}

#petal-play.on { display: block; animation: mm-petal-in 0.6s cubic-bezier(0.2, 1.5, 0.4, 1); }

@keyframes mm-petal-in {
    from { transform: translateY(60px) scale(0.6); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.petal .p-ear {
    transform-box: fill-box;
    transform-origin: 50% 92%;
    animation: mm-ear-sway 3.2s ease-in-out infinite;
}

.petal .p-ear-r { animation-delay: -1.6s; }

@keyframes mm-ear-sway {
    0%, 100% { transform: rotate(-3deg); }
    50%      { transform: rotate(4deg); }
}

.petal .p-arm { transform-box: fill-box; transform-origin: 50% 15%; transition: transform 0.25s; }
.petal .p-eyes-cheer, .petal .p-mouth-cheer { display: none; }

/* idle fidget: Petal blinks her eyes every few seconds while she waits */
.petal .p-eyes-idle {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: mm-blink 4.6s ease-in-out infinite;
}

@keyframes mm-blink {
    0%, 90%, 100% { transform: scaleY(1); }
    93%, 96%      { transform: scaleY(0.12); }
}

/* happy bounce + squinty smile-eyes + arms up on a correct match */
.petal.cheer .p-eyes-idle, .petal.cheer .p-mouth-idle { display: none; }
.petal.cheer .p-eyes-cheer, .petal.cheer .p-mouth-cheer { display: block; }
.petal.cheer .p-arm-l { transform: rotate(148deg); }
.petal.cheer .p-arm-r { transform: rotate(-148deg); }
.petal.cheer .p-ear-l { animation: none; transform: rotate(-16deg); }
.petal.cheer .p-ear-r { animation: none; transform: rotate(16deg); }
.petal.cheer svg { animation: mm-hop 0.5s ease-in-out 2; }

/* gentle "hmm, let's try again" — a curious head tilt with one perked ear,
   never a sad face */
.petal.tilt svg { animation: mm-petal-think 0.95s ease-in-out both; }
.petal.tilt .p-ear-l { animation: none; transform: rotate(-15deg); }

@keyframes mm-petal-think {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(-8deg); }
    60%      { transform: rotate(5deg); }
    82%      { transform: rotate(-2deg); }
}

.petal svg { transition: transform 0.3s; }

/* ── Petal's animated hello: hops in from the meadow edge and waves ── */
#petal-title.hello { animation: mm-hello-in 0.75s cubic-bezier(0.18, 1.5, 0.35, 1) both; }

@keyframes mm-hello-in {
    0%   { transform: translateX(-58vw) translateY(8px)  scale(0.72) rotate(-7deg); opacity: 0; }
    55%  { transform: translateX(3vw)   translateY(-10px) scale(1.06) rotate(4deg);  opacity: 1; }
    78%  { transform: translateX(-1vw)  translateY(0)     scale(0.99) rotate(-2deg); }
    100% { transform: translateX(0)     translateY(0)     scale(1)    rotate(0);     opacity: 1; }
}

#petal-title.hello .p-arm-r { animation: mm-wave 0.42s ease-in-out 5 0.7s both; }
#petal-title.hello .p-ear-l { animation: none; transform: rotate(-12deg); }

@keyframes mm-wave {
    0%, 100% { transform: rotate(-116deg); }
    50%      { transform: rotate(-158deg); }
}

/* ══ How-to demo ═════════════════════════════════════════════════════════ */

#demo-layer {
    position: fixed;
    inset: 0;
    z-index: 640;
    background: radial-gradient(ellipse at center, rgba(255, 248, 236, 0.1) 30%, rgba(74, 59, 92, 0.42) 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s;
}

#demo-layer.demo-out { opacity: 0; }

#demo-row {
    display: flex;
    gap: 16px;
    pointer-events: none;
}

.demo-card {
    position: relative;
    width: clamp(104px, 14vw, 140px);
    height: clamp(104px, 14vw, 140px);
    perspective: 750px;
    opacity: 0;
    transform: scale(0);
}

.demo-card.dealt {
    opacity: 1;
    transform: scale(1);
    transition: transform 0.45s cubic-bezier(0.2, 1.7, 0.4, 1), opacity 0.2s;
}

.demo-card .card-inner { position: absolute; inset: 0; }
.demo-card.flipped .card-inner { transform: rotateY(180deg); }
.demo-card.bounce { animation: mm-bounce 0.55s ease; }

#demo-paw {
    position: fixed;
    width: 74px;
    height: 74px;
    z-index: 650;
    pointer-events: none;
    opacity: 0;
    transition: left 0.55s ease-in-out, top 0.55s ease-in-out, opacity 0.3s;
    filter: drop-shadow(0 4px 8px rgba(74, 59, 92, 0.45));
}

#demo-paw svg { width: 100%; height: 100%; display: block; }
#demo-paw.tap { animation: mm-paw-tap 0.35s ease; }

@keyframes mm-paw-tap {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(0.72); }
}

/* ══ Turn banner ═════════════════════════════════════════════════════════ */

#turn-banner {
    position: fixed;
    top: 34%;
    left: 0;
    right: 0;
    z-index: 700;
    display: flex;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
    padding: 12px 0;
}

.banner-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 60px;
    padding: 14px 34px;
    box-shadow: 0 12px 34px rgba(74, 59, 92, 0.35);
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: bold;
    color: var(--gk-text);
    border: 5px solid var(--bc, var(--gk-pink));
    animation: mm-banner 1.6s cubic-bezier(0.3, 0.9, 0.6, 1) forwards;
}

.banner-card .banner-paw { width: 52px; height: 52px; }
.banner-card .banner-paw svg { width: 100%; height: 100%; display: block; }

@keyframes mm-banner {
    0%   { transform: translateX(-115vw); }
    28%  { transform: translateX(0); }
    72%  { transform: translateX(0); }
    100% { transform: translateX(115vw); }
}

/* ══ Grown-ups note ══════════════════════════════════════════════════════ */

#info-btn {
    position: fixed;
    left: 14px;
    bottom: 14px;
    width: 56px;
    height: 56px;
    z-index: 880;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 12px rgba(90, 60, 130, 0.25);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s;
}

#info-btn:hover  { transform: scale(1.1); }
#info-btn:active { transform: scale(0.92); }

#info-overlay {
    position: fixed;
    inset: 0;
    z-index: 930;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: gk-fade-in 0.25s ease-out;
}

#info-scrim {
    position: absolute;
    inset: 0;
    background: rgba(74, 59, 92, 0.5);
}

#info-card {
    position: relative;
    max-width: min(92vw, 540px);
    max-height: 82vh;
    overflow-y: auto;
    padding: 26px 30px;
    animation: gk-pop-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

#info-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--gk-purple);
    padding-right: 64px;
    /* keep body text clear of the 72px close button pinned top-right */
    min-height: 58px;
    display: flex;
    align-items: center;
}
#info-card p  { font-size: 1.05rem; line-height: 1.5; margin-bottom: 10px; }
#info-card .info-small { font-size: 0.9rem; opacity: 0.75; margin-bottom: 0; }

#info-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 50%;
    background: #FFEDF4;
    color: var(--gk-pink);
    font-size: 1.7rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.15s;
}

#info-close:hover  { transform: scale(1.1); }
#info-close:active { transform: scale(0.9); }

/* ══ Celebration extras ══════════════════════════════════════════════════ */

.duo-summary {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin: 4px 0 14px;
}

.duo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #FFF8EC;
    border-radius: 18px;
    padding: 10px 16px;
    min-width: 110px;
}

.duo-col .duo-paw { width: 44px; height: 44px; position: relative; }
.duo-col .duo-paw svg { width: 100%; height: 100%; display: block; }

.duo-col .duo-crown {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 22px;
}

.duo-col .duo-crown svg { width: 100%; height: 100%; display: block; }
.duo-col .duo-count { font-weight: bold; font-size: 1.15rem; color: var(--gk-text); }
.duo-col .duo-title { font-size: 0.82rem; color: var(--gk-purple); font-weight: bold; }

/* ══ Portrait tweaks ═════════════════════════════════════════════════════ */

@media (max-aspect-ratio: 1/1) {
    #mode-cards { flex-direction: row; }
    .mode-card { width: min(44vw, 330px); }
}

@media (max-width: 860px) {
    #petal-play { width: clamp(70px, 9vw, 90px); height: clamp(86px, 11vw, 112px); }
}

/* ══ Reduced motion ══════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    #sun-rays, .cloud, #bee-flyer, .bee-wing,
    .petal .p-ear, .petal .p-eyes-idle, .petal.cheer svg, .petal.tilt svg,
    #petal-title.hello, #petal-title.hello .p-arm-r,
    .paw-meter.active, .friend.parade { animation: none !important; }
    .card-inner { transition-duration: 0.12s; }
    .card.dealt { transition-duration: 0.12s; }
    .spark { display: none; }
}
