:root{--blue:#1a3a8c;--blue2:#2a6fb7;--light:#edf5ff;--ink:#152332;--muted:#506173;--yellow:#ffd34e;--red:#da4050;--green:#27a96b}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Lato,Arial,sans-serif;color:var(--ink);background:#eef5fa}
button,a{font:inherit}
.samuel-nav{height:72px;display:flex;align-items:center;gap:30px;padding:10px max(24px,calc((100% - 1180px)/2));background:var(--blue);box-shadow:0 3px 12px #0f226044}
.samuel-brand{display:flex;align-items:center;margin-right:auto}.samuel-brand img{width:58px;height:52px;object-fit:contain}
.nav-links{display:flex;gap:6px}.nav-links a{padding:9px 12px;color:#ffffffde;text-decoration:none;font-family:Cabin,Arial,sans-serif;font-weight:700}
.account-button{border:1px solid #ffffff66;border-radius:999px;padding:9px 17px;background:#fff;color:var(--blue);font-weight:800;cursor:pointer}
.page-shell{width:min(1180px,calc(100% - 32px));margin:28px auto 60px;display:grid;grid-template-columns:minmax(0,2.5fr) minmax(280px,1fr);gap:18px;align-items:start}
.game-column{min-width:0}
.game-frame{position:relative;overflow:hidden;aspect-ratio:16/9;min-height:460px;border-radius:14px;background:#71b53d url("/spiellab/prototypes/moles/samuel-meadow.png") center/cover no-repeat;box-shadow:0 18px 50px #0f22602d;isolation:isolate}
.game-frame::after{display:none}
.sky-decor{display:none}
.sky-decor span{position:absolute;width:150px;height:35px;border-radius:50%;background:#ffffffb8;filter:blur(1px)}
.sky-decor span:nth-child(1){left:8%;top:16%}.sky-decor span:nth-child(2){right:7%;top:31%;width:110px}.sky-decor span:nth-child(3){left:45%;top:8%;width:90px}
.hill{display:none}
.hole{position:absolute;z-index:3;bottom:13%;width:27%;height:12%;border-radius:50%;background:#305334;box-shadow:inset 0 12px 14px #172d22,0 9px 0 #548e47}
.hole-left{left:19%}.hole-right{right:19%}.hole-shadow{position:absolute;inset:25% 9%;border-radius:50%;background:#101e18}
.mole-target{position:absolute;z-index:5;bottom:13%;width:29%;height:49%;padding:0;border:0;background:transparent;cursor:pointer;transform:translateY(118%) scale(.82);transform-origin:50% 100%;transition:transform .36s cubic-bezier(.55,.05,.75,.45)}
.mole-target[data-side="0"]{left:18%}.mole-target[data-side="1"]{right:18%}
.mole-target.is-up{transform:translateY(4%) scale(1);transition-timing-function:cubic-bezier(.15,.9,.2,1.18)}
.mole-target.is-burrowing{transform:translateY(128%) scale(.7) rotate(-3deg);transition-duration:.4s;transition-timing-function:cubic-bezier(.7,0,1,.4)}
.mole-target.is-hit img{animation:bonk .22s ease}
.mole-target::after{position:absolute;z-index:4;left:50%;top:3%;transform:translateX(-50%) scale(.5);padding:7px 12px;border-radius:999px;color:#fff;font:900 1.1rem Cabin,Arial,sans-serif;opacity:0;transition:.18s}
.mole-target.is-correct::after{content:"¡PLOP!";background:var(--green);opacity:1;transform:translateX(-50%) scale(1)}
.mole-target.is-wrong::after{content:"¡ARG!";background:var(--red);opacity:1;transform:translateX(-50%) scale(1)}
.mole-target img{position:absolute;left:0;right:0;bottom:-2%;width:100%;height:auto;filter:drop-shadow(0 12px 9px #15361f55)}
.mole-target span{position:absolute;z-index:2;left:10%;right:10%;bottom:14%;padding:8px 5px;border:3px solid #fff;border-radius:10px;background:var(--blue);color:#fff;font:800 clamp(.8rem,2vw,1.4rem)/1 Cabin,Arial,sans-serif;box-shadow:0 4px 0 #0f2260;text-align:center}
.hud{position:relative;z-index:8;display:flex;gap:8px;align-items:center;margin:14px}.hud[hidden]{display:none}
.hud div{min-width:100px;padding:7px 12px;border-radius:10px;background:#0f2260dc;color:#fff;backdrop-filter:blur(6px)}
.hud span,.hud strong{display:block}.hud span{font-size:.65rem;text-transform:uppercase;letter-spacing:.08em;opacity:.75}.hud strong{font-size:1.25rem}
.hud button{margin-left:auto;width:44px;height:44px;border:0;border-radius:50%;background:#fff;color:var(--blue);font-size:1.35rem;font-weight:900;cursor:pointer}
.screen{position:absolute;z-index:10;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;color:#fff;background:#071020a8;backdrop-filter:blur(2px)}
.screen[hidden]{display:none}.screen p{margin:0 0 4px;font:700 clamp(1.25rem,3vw,2.2rem)/1 Cabin,Arial,sans-serif}
.screen h1{margin:0;font:800 clamp(3.2rem,8vw,6.6rem)/1 Cabin,Arial,sans-serif;text-shadow:0 4px 0 #0005}
.screen-cover>strong{font-size:clamp(1rem,2.2vw,1.5rem);line-height:1.35}
.play-button{display:grid;place-items:center;gap:2px;width:118px;height:118px;margin:30px 0 25px;border:4px solid #b9dcff;border-radius:12px;background:#4f9be0;color:#fff;font-weight:900;box-shadow:0 7px 0 #1d558d;cursor:pointer}
.play-button span{font-size:3.1rem;line-height:.7}
.start-actions{display:flex;flex-direction:column;align-items:center}.fullscreen-start{margin:-13px 0 24px;padding:9px 14px;border:1px solid #ffffff88;border-radius:999px;background:#ffffff18;color:#fff;font-weight:800;cursor:pointer;backdrop-filter:blur(8px)}
.screen-rules{align-items:stretch;justify-content:flex-end;background:linear-gradient(transparent 45%,#112d1524);text-shadow:none}
.rules-scene{position:relative;display:flex;align-items:center;justify-content:center;gap:0;width:min(720px,92%);height:58%;margin:0 auto}
.rules-character{align-self:center;width:45%;max-height:100%;object-fit:contain;object-position:center;filter:drop-shadow(0 10px 9px #17371f66)}
.speech-bubble{position:relative;align-self:flex-start;max-width:390px;margin-top:7%;padding:22px 26px;border:4px solid var(--blue);border-radius:24px;background:#fff;color:var(--ink);font:800 clamp(1.25rem,3vw,2.15rem)/1.2 Cabin,Arial,sans-serif;box-shadow:0 12px 26px #16353630;text-align:left}
.speech-bubble::after{content:"";position:absolute;left:-25px;bottom:24%;width:40px;height:40px;background:#fff;border-left:4px solid var(--blue);border-bottom:4px solid var(--blue);transform:rotate(45deg)}
.speech-bubble strong{position:relative;z-index:1;color:var(--green)}
.rules-start{margin-top:22px;padding:8px 24px;border:3px solid #fff;border-radius:8px;background:var(--yellow);color:var(--ink);font-weight:900;box-shadow:0 5px 0 #bc8e0d;cursor:pointer}
.screen-result{background:#071020d8}.screen-result h2{margin:4px 0 20px;font:800 clamp(2rem,5vw,4rem)/1 Cabin,Arial,sans-serif}
.big-score strong{display:block;font-size:5rem;line-height:.9}.big-score span{opacity:.75}
.result-stats{display:flex;gap:8px;margin:22px 0;flex-wrap:wrap;justify-content:center}.result-stats span{padding:8px 12px;border-radius:999px;background:#ffffff1c}
.play-again{padding:12px 24px;border:0;border-radius:9px;background:var(--yellow);color:var(--ink);font-weight:900;cursor:pointer}
.activity-meta{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:20px 22px;border-radius:0 0 12px 12px;background:#fff;box-shadow:0 12px 30px #0f226014}
.activity-meta h2{margin:2px 0;font:800 1.75rem Cabin,Arial,sans-serif}.activity-meta p{margin:0;color:var(--muted)}
.activity-type{color:var(--blue2)!important;font-size:.78rem;font-weight:900;text-transform:uppercase;letter-spacing:.08em}
.meta-actions{display:flex;gap:8px}.meta-actions button{padding:10px 13px;border:1px solid #c9d6e2;border-radius:7px;background:#fff;font-weight:800;cursor:pointer}.meta-actions .share-button{border-color:var(--blue2);background:var(--blue2);color:#fff}
.leaderboard{padding:22px;border-radius:12px;background:#fff;box-shadow:0 12px 30px #0f226014}
.leaderboard-heading{display:flex;justify-content:space-between;align-items:start;gap:12px}.leaderboard-heading p{margin:0;color:var(--blue2);font-size:.75rem;font-weight:900;text-transform:uppercase;letter-spacing:.1em}
.leaderboard-heading h2{margin:4px 0 14px;font:800 1.55rem Cabin,Arial,sans-serif}.leaderboard-heading>span{padding:6px 8px;border-radius:7px;background:var(--light);color:var(--blue);font-size:.7rem;font-weight:900}
.leaderboard ol{margin:0;padding:0;list-style:none}.leaderboard li{display:grid;grid-template-columns:32px 1fr auto;gap:8px;align-items:center;padding:11px 6px;border-bottom:1px solid #e4ebf1}.leaderboard li:first-child{background:#fff8d5;border-radius:8px}
.leaderboard li span:first-child{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--light);color:var(--blue);font-weight:900}.leaderboard li strong{font-variant-numeric:tabular-nums}
.account-state{margin-top:20px;padding:16px;border-radius:9px;background:var(--light)}.account-state strong,.account-state p{display:block}.account-state p{margin:5px 0 12px;color:var(--muted);font-size:.88rem}
.account-state button{width:100%;padding:9px;border:0;border-radius:7px;background:var(--blue);color:#fff;font-weight:900;cursor:pointer}.registered{background:#e9f8f0}.registered button{background:#fff;color:var(--blue);border:1px solid #b8d6c7}
.mole-field{position:absolute;z-index:4;left:4%;right:4%;top:31%;bottom:5%;display:block;cursor:none}
.mole-field.holes-10,.mole-field.holes-12{left:3%;right:3%}
.mole-slot{position:absolute;z-index:var(--d);left:var(--x);top:var(--y);width:25%;height:35%;min-height:62px;padding:0;border:0;background:transparent;overflow:visible;clip-path:inset(-120% -30% 0 -30%);cursor:none;transform:scale(var(--s));transform-origin:50% 100%}
.holes-10 .mole-slot{width:22%;height:31%}.holes-12 .mole-slot{width:20%;height:29%}
.mole-slot::before{content:"";position:absolute;z-index:1;left:4%;right:4%;bottom:0;height:34%;border-radius:50%;background:#243b2a;box-shadow:inset 0 8px 10px #102217,0 7px 0 #4c823f}
.dirt-rim{position:absolute;z-index:5;left:1%;right:1%;bottom:-1%;height:20%;border-radius:50%;background:linear-gradient(#6b9c52,#426f37);clip-path:inset(50% 0 0)}
.mole-card{position:absolute;z-index:3;left:21%;right:21%;bottom:5%;height:128%;transform:translateY(88%) scale(.88);transform-origin:50% 100%;transition:transform .32s cubic-bezier(.55,.05,.75,.45);pointer-events:none}
.mole-slot.is-up .mole-card{transform:translateY(6%) scale(1);transition-timing-function:cubic-bezier(.15,.9,.2,1.15)}
.mole-slot.is-burrowing .mole-card{transform:translateY(105%) scale(.65);transition-duration:.4s}
.mole-card img{position:absolute;left:0;right:0;bottom:13%;width:100%;height:auto;filter:drop-shadow(0 7px 5px #17371f55)}
.mole-card b{position:absolute;z-index:4;left:-6%;right:-6%;bottom:4%;padding:5px 3px;border:2px solid #fff;border-radius:7px;background:var(--blue);color:#fff;font:800 clamp(.55rem,1.35vw,.96rem)/1 Cabin,Arial,sans-serif;box-shadow:0 3px 0 #0f2260;white-space:nowrap;text-align:center}
.mole-slot.is-correct .mole-card::after,.mole-slot.is-wrong .mole-card::after{position:absolute;z-index:7;left:50%;top:5%;transform:translateX(-50%);padding:5px 9px;border-radius:999px;color:#fff;font:900 .8rem Cabin,Arial,sans-serif}
.mole-slot.is-correct .mole-card::after{content:"¡PLOP!";background:var(--green)}.mole-slot.is-wrong .mole-card::after{content:"¡JI, JI!";background:#7454c9}
.mole-slot.is-correct .mole-card img{animation:bonk .22s ease}.mole-slot.is-wrong .mole-card{filter:saturate(.8)}
.stars{position:absolute;z-index:8;inset:-12% -30% auto;display:flex;justify-content:space-around;color:#ffd34e;font-style:normal;filter:drop-shadow(0 2px 1px #7f5d00)}.stars em{font-style:normal;animation:star-pop .8s ease-out both}.stars em:nth-child(2){animation-delay:.08s}.stars em:nth-child(3){animation-delay:.15s}.stars em:nth-child(4){animation-delay:.22s}
.game-watermark{position:absolute;z-index:9;right:12px;bottom:10px;display:flex;align-items:center;gap:7px;padding:5px 9px 5px 5px;border-radius:8px;background:#ffffffd9;color:var(--blue);font-size:.65rem;font-weight:900;box-shadow:0 3px 12px #0003}.game-watermark img{width:56px;height:auto;object-fit:contain}
.game-frame:fullscreen,.game-frame.is-fullscreen{width:100vw;height:100vh;min-height:100vh;aspect-ratio:auto;border-radius:0}.game-frame.is-fullscreen{position:fixed;z-index:3000;inset:0}.game-fullscreen{overflow:hidden}.game-frame:fullscreen .mole-field,.game-frame.is-fullscreen .mole-field{top:27%;bottom:5%}.game-frame:fullscreen .game-watermark,.game-frame.is-fullscreen .game-watermark{right:20px;bottom:16px}
.countdown{position:absolute;z-index:12;inset:0;display:grid;place-items:center;background:#0f22608c;color:#fff;font:900 clamp(5rem,15vw,9rem)/1 Cabin,Arial,sans-serif;text-shadow:0 6px 0 #0005}.countdown[hidden]{display:none}.countdown small{display:block;margin-top:.4rem;font-size:1rem;text-align:center;letter-spacing:.08em;text-transform:uppercase}
.hammer-cursor{--x:50%;--y:50%;position:absolute;z-index:20;left:var(--x);top:var(--y);width:92px;height:92px;pointer-events:none;opacity:0;background:url("/spiellab/prototypes/moles/samuel-hammer.png") center/contain no-repeat;transform:translate(-28%,-76%) rotate(-18deg);transform-origin:70% 82%;filter:drop-shadow(0 6px 5px #0005);transition:opacity .12s}.hammer-cursor.is-visible{opacity:1}.hammer-cursor.is-swinging{animation:hammer-swing .18s ease-out}
@keyframes hammer-swing{0%{transform:translate(-28%,-76%) rotate(-18deg)}65%{transform:translate(-28%,-76%) rotate(35deg) scale(.9)}100%{transform:translate(-28%,-76%) rotate(-18deg)}}
@keyframes bonk{50%{transform:translateY(12px) scale(.9,.82)}}
@keyframes star-pop{0%{opacity:0;transform:translateY(18px) scale(.2) rotate(0)}45%{opacity:1}100%{opacity:0;transform:translateY(-26px) scale(1.3) rotate(100deg)}}
@media(max-width:900px){.page-shell{grid-template-columns:1fr}.leaderboard{order:2}.nav-links{display:none}}
@media(max-width:600px){
  .samuel-nav{height:62px;padding:7px 15px}.samuel-brand img{width:49px;height:45px}.account-button{padding:7px 11px;font-size:.82rem}
  .page-shell{width:100%;margin:0;display:block}.game-frame{min-height:0;aspect-ratio:9/13;border-radius:0}.activity-meta{display:block;border-radius:0;padding:16px}.meta-actions{margin-top:13px}.leaderboard{margin:14px;border-radius:10px}
  .hud{margin:8px}.hud div{min-width:0;flex:1;padding:6px 7px}.hud strong{font-size:1rem}.hud button{width:38px;height:38px}
  .hill{bottom:-18%;height:65%}.hole{bottom:14%;width:34%;height:8%}.hole-left{left:10%}.hole-right{right:10%}
  .mole-field{left:2%;right:2%;top:37%;bottom:4%}.mole-field.holes-10,.mole-field.holes-12{left:1%;right:1%}.mole-slot{width:30%;height:26%;min-height:42px}.holes-10 .mole-slot{width:25%;height:23%}.holes-12 .mole-slot{width:23%;height:22%}.mole-card{left:25%;right:25%;height:122%}.mole-card b{font-size:.58rem}.hammer-cursor{display:none}.game-watermark span{display:none}.game-watermark{right:7px;bottom:7px}.game-watermark img{width:42px}.rules-scene{width:100%;height:62%}.rules-character{width:52%}.speech-bubble{max-width:55%;margin-top:8%;padding:14px 15px;border-width:3px;border-radius:16px;font-size:1.05rem}.speech-bubble::after{left:-17px;width:27px;height:27px;border-width:3px}.rules-start{margin-top:12px}
  .mole-target{bottom:14%;width:39%;height:38%}.mole-target[data-side="0"]{left:7.5%}.mole-target[data-side="1"]{right:7.5%}.mole-target span{bottom:10%;font-size:.82rem}
  .screen-cover h1{font-size:3.9rem}.screen-cover>strong{font-size:1rem}.play-button{width:100px;height:100px;margin:24px 0}.screen-rules>strong{font-size:3.2rem}
}
@media(prefers-reduced-motion:reduce){.mole-target{transition-duration:.01ms!important}.mole-target img{animation:none!important}}
/* Published games must not expose prototype-only account/task controls. */
.account-button[hidden],.leaderboard[hidden],.meta-actions[hidden]{display:none}

/* Keyboard focus and readable start control, including the game terrain. */
.play-button{background:#2467a5}
:where(a,button):focus-visible{outline:3px solid #071a36;outline-offset:3px;box-shadow:0 0 0 6px #fff}

.leaderboard label{display:block;margin:12px 0}.leaderboard input{display:block;width:100%;padding:8px;border:1px solid #60708a;border-radius:6px}.leaderboard input,.leaderboard button{min-height:44px;max-width:100%}.leaderboard button{padding:8px 12px;color:#fff;background:#1a3a8c;border:0;border-radius:6px}.leaderboard button:disabled{opacity:.5}.account-button{text-decoration:none}
.mole-slot.is-wrong .mole-card::after{content:none}.mole-slot.is-wrong .mole-card{filter:none}.mole-slot.is-wrong:not(.is-burrowing) .mole-card{animation:none;transition:none;transform:translateY(0) scale(1)}.stars-dizzy{inset:4% -16% auto;align-items:center;justify-content:center;height:24%;pointer-events:none}.stars-dizzy em{position:absolute;left:42%;top:10%;animation:dizzy-orbit .85s linear infinite;animation-delay:0s!important}.stars-dizzy em:nth-child(2){animation-delay:-.21s!important}.stars-dizzy em:nth-child(3){animation-delay:-.42s!important}.stars-dizzy em:nth-child(4){animation-delay:-.63s!important}@keyframes dizzy-orbit{0%{opacity:1;transform:translate(-22px,0) scale(.75) rotate(0)}25%{transform:translate(0,-8px) scale(.65) rotate(25deg)}50%{transform:translate(22px,0) scale(.95) rotate(50deg)}75%{transform:translate(0,8px) scale(1.15) rotate(75deg)}100%{opacity:1;transform:translate(-22px,0) scale(.75) rotate(100deg)}}@media(prefers-reduced-motion:reduce){.stars-dizzy em{animation:none;position:static;margin:0 2px}}

/* Keep the whole moving field visible, including short landscape viewports. */
.game-frame:not(.is-fullscreen):not(:fullscreen) {
  width: 100%;
  min-height: min(460px, calc(100dvh - var(--spiel-header-height, 100px) - 56px));
  max-height: calc(100dvh - var(--spiel-header-height, 100px) - 56px);
}
@media (max-width: 600px) {
  .game-frame:not(.is-fullscreen):not(:fullscreen) {
    min-height: 0;
    max-height: calc(100dvh - var(--spiel-header-height, 100px));
  }
}
.game-frame:fullscreen, .game-frame.is-fullscreen {
  height: 100dvh;
  min-height: 100dvh;
}
.activity-ad-space { display: none; }
@media (min-width: 1500px) {
  body > .activity-ad-space {
    display: flex;
    justify-content: center;
    position: absolute;
    left: calc(50% + 610px);
    top: calc(var(--spiel-header-height, 64px) + 28px);
    width: 120px;
    height: 300px;
    padding-top: 10px;
    border: 1px dashed #dce2e8;
    border-radius: 8px;
    background: #fafbfd;
    color: #66717f;
    font-size: .65rem;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
}

@media (max-width: 900px) {
  .hud { margin: 8px; gap: 4px; }
  .hud div { min-width: 0; flex: 1; padding: 6px 4px; }
  .hud strong { font-size: 1rem; white-space: nowrap; }
  .hud #livesValue { font-size: .875rem; }
  .hud button { width: 38px; height: 38px; flex: 0 0 38px; }
}
