:root{--accent:#d5f36b;--ink:#25352e;--paper:#f3f1e9;--muted:#757c72;--accent-ink:#25352e;font-family:Arial,Helvetica,sans-serif;color:var(--ink);background:var(--paper)}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,label.upload{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default;opacity:.4}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #416bba;outline-offset:4px}button{color:inherit}img{max-width:100%}[hidden]{display:none!important}.app{max-width:1600px;margin:auto;padding:0 4.5vw}header{height:100px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #25352e20}.brand{display:flex;gap:12px;align-items:center;text-decoration:none;color:inherit;font-weight:800;font-size:19px;letter-spacing:1.5px}.brand-icon{font-size:42px;line-height:1}#brand-logo{width:48px;height:48px;object-fit:contain}.header-right{display:flex;gap:16px;align-items:center}.live-label{font-size:10px;letter-spacing:1.8px;margin-right:18px}.live-label i{display:inline-block;width:6px;height:6px;background:#537550;border-radius:50%;margin-right:8px}.icon-button{border:1px solid #25352e30;background:transparent;border-radius:50%;width:40px;height:40px;font-size:23px;display:grid;place-items:center}.icon-button:hover{background:#25352e0b}.intro{display:flex;justify-content:space-between;gap:30px;align-items:center;padding:40px 0 30px}.eyebrow{font-size:10px;letter-spacing:2.2px;font-weight:700;margin:0 0 14px}h1{font-size:clamp(32px,3.6vw,58px);letter-spacing:-2.5px;line-height:1.05;margin:0 0 14px;font-weight:500}h1 em{font-family:Georgia,serif;font-weight:400}#game-subtitle{font-size:14px;color:var(--muted);margin:0;line-height:1.5}.stats{display:flex;gap:34px;padding-left:25px}.stats>div{min-width:80px}.stat-label{display:block;font-size:9px;letter-spacing:1.5px;margin-bottom:12px;color:var(--muted)}.stats strong{font-size:32px;font-weight:400;font-variant-numeric:tabular-nums}.stats small{font-size:20px;color:#969d91}.play-area{position:relative;background:#e9e8df;border:1px solid #25352e0d;border-radius:18px;padding:18px;overflow:hidden}.board{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;max-width:1050px;margin:0 auto}.card{position:relative;aspect-ratio:1.62;border:0;border-radius:11px;background:transparent;padding:0;perspective:900px;touch-action:manipulation}.card-inner{display:block;position:absolute;inset:0;transform-style:preserve-3d;transition:transform .42s cubic-bezier(.2,.7,.2,1)}.card.flipped .card-inner{transform:rotateY(180deg)}.card-face{position:absolute;inset:0;backface-visibility:hidden;border-radius:11px;overflow:hidden;display:flex;align-items:center;justify-content:center}.card-back{background:var(--ink);color:#eff1dc;border:1px solid #ffffff18;flex-direction:column;gap:7px}.card-back::before,.card-back::after{content:'';position:absolute;width:78%;aspect-ratio:1;border:1px solid #ffffff0d;border-radius:50%;top:-65%;left:-20%}.card-back::after{left:auto;right:-20%;top:auto;bottom:-65%}.card-mark{font-size:42px;color:var(--accent);line-height:1}.card-logo{width:44px;height:44px;object-fit:contain}.card-back small{font-size:9px;font-weight:600;letter-spacing:3px}.card-front{transform:rotateY(180deg);background:#fff}.card-front img{height:100%;width:100%;object-fit:cover}.card.matched .card-front:after{content:'✓';position:absolute;bottom:9px;right:9px;width:25px;height:25px;display:grid;place-items:center;background:var(--accent);color:var(--accent-ink);border-radius:50%;font-weight:700}.card.matched{outline:2px solid #6d8954;outline-offset:-2px}.card:not(.flipped):hover .card-back{filter:brightness(1.15)}.welcome{position:absolute;inset:0;display:grid;place-items:center;background:#e9e8dfac;backdrop-filter:blur(5px)}.welcome-card{text-align:center;background:var(--paper);border:1px solid #fff9;border-radius:16px;padding:25px 50px;box-shadow:0 20px 60px #25352e18}.spark{display:inline-block;color:var(--ink);font-size:46px;line-height:1;margin-bottom:16px}.welcome-card h2,.win-content h2{font-family:Georgia,serif;font-size:46px;font-weight:400;letter-spacing:-2px;line-height:1.02;margin:0 0 15px}.welcome-card>p:not(.eyebrow),.win-content>p:not(.eyebrow){color:var(--muted);font-size:13px;line-height:1.7}.button{display:inline-flex;align-items:center;justify-content:center;gap:35px;border-radius:6px;border:1px solid transparent;padding:15px 22px;font-size:13px;font-weight:600;text-decoration:none}.primary{background:var(--accent);color:var(--accent-ink)}.primary:hover{filter:brightness(.96)}.secondary{background:transparent;border-color:#25352e30}.welcome-card .button{margin-top:7px;min-width:220px}.hint{display:block;color:var(--muted);font-size:10px;margin-top:15px}.game-footer{display:flex;align-items:center;justify-content:space-between;padding:13px 0}.game-footer p{font-size:12px;color:var(--muted);margin:0}.text-button{border:0;background:none;padding:10px;font-size:12px;text-decoration:underline;text-underline-offset:4px}.game-footer .text-button{text-decoration:none}footer{border-top:1px solid #25352e20;display:flex;justify-content:space-between;align-items:center;margin-top:20px;padding:22px 0;font-size:9px;letter-spacing:1.7px;color:var(--muted)}.footer-star{font-size:20px;vertical-align:middle;color:var(--ink);margin-left:15px}dialog{border:1px solid #25352e25;border-radius:18px;background:var(--paper);color:var(--ink);padding:30px;width:min(620px,calc(100% - 32px));max-height:90vh}dialog::backdrop{background:#14251dd0;backdrop-filter:blur(6px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center}.dialog-heading h2{font-size:30px;font-weight:500;letter-spacing:-1px;margin:0}.dialog-heading .eyebrow{margin-bottom:8px}.helper{font-size:12px;line-height:1.6;color:var(--muted)}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:24px 0}.settings-grid label{font-size:12px;display:flex;flex-direction:column;gap:8px}.wide{grid-column:1/-1}input:not([type=file]),select{width:100%;min-width:0;border:1px solid #25352e30;border-radius:5px;background:#fff8;padding:11px;color:var(--ink)}input[type=color]{height:40px;padding:3px!important}.upload-section{border-top:1px solid #25352e20;margin-top:20px;padding-top:12px}.upload-section h3{font-size:14px}.upload-section h3 span{font-size:11px;color:var(--muted);font-weight:400;margin-left:10px}.upload{position:relative;cursor:pointer;overflow:hidden}.upload input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.upload:focus-within{outline:3px solid #416bba;outline-offset:3px}.logo-controls{display:flex;align-items:center;gap:10px}#logo-preview{height:45px;width:65px;object-fit:contain}.photo-list{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-top:16px}.photo-slot{position:relative}.photo-slot img{display:block;width:100%;aspect-ratio:1.4;object-fit:cover;border-radius:6px}.photo-slot small{font-size:10px;color:var(--muted);display:block;margin:5px 0}.photo-slot button{position:absolute;right:4px;top:4px;border:0;border-radius:50%;background:#fff;width:24px;height:24px}.setup-actions{border-top:1px solid #25352e20;padding-top:20px;display:flex;flex-direction:column;gap:12px}.setup-actions>div{display:flex;justify-content:center;gap:16px}#setup-message{color:#96511f;min-height:20px}#win{max-width:460px}.win-content{text-align:center;padding:20px}.win-content .spark{font-size:70px}.win-content .button{display:flex;width:100%;margin-top:25px}.win-content>.text-button{margin-top:15px}.confirm-content h2{margin:0;font-weight:500}.confirm-content p{font-size:14px;color:var(--muted)}.confirm-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:25px}
@media(min-width:1100px) and (min-height:850px){.intro{padding:50px 0 35px}.board{max-width:1150px}.card{aspect-ratio:1.55}.welcome-card{padding:40px 70px}.welcome-card h2{font-size:58px}}
@media(max-width:850px){.app{padding:0 5vw}header{height:78px}.live-label{display:none}.intro{padding-top:28px;align-items:flex-start;flex-direction:column;gap:25px}.stats{padding:0;gap:35px}.stats strong{font-size:26px}.stat-label{margin-bottom:6px}.card{aspect-ratio:1.1}.card-mark{font-size:32px}.card-back small{font-size:7px;letter-spacing:1px}.board{gap:8px}.play-area{padding:10px}.welcome-card{padding:23px}.welcome-card h2{font-size:40px}h1{letter-spacing:-1.5px}.header-right{gap:8px}}
@media(max-width:480px){.card{aspect-ratio:.8}.welcome-card{padding:18px 22px}.welcome-card .spark{font-size:30px;margin-bottom:10px}.welcome-card h2{font-size:34px}.brand{font-size:14px}.brand-icon{font-size:30px}footer{font-size:7px;letter-spacing:1px}.settings-grid{grid-template-columns:1fr}.wide{grid-column:auto}dialog{padding:22px}.game-footer p{max-width:65%;line-height:1.6}.photo-list{grid-template-columns:repeat(2,1fr)}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
@media(min-width:851px){.play-area{height:clamp(320px,calc(100dvh - 415px),680px)}.board{height:100%;grid-auto-rows:minmax(0,1fr)}.card{aspect-ratio:auto;min-height:0}.intro{padding:30px 0}footer{margin-top:8px;padding:18px 0}}
@media(min-width:851px) and (max-height:849px){.welcome-card{padding:16px 40px}.welcome-card h2{font-size:38px}.welcome-card .spark{font-size:32px;margin-bottom:10px}}

.card-front img{object-fit:contain;background:#fff9d7}.robot-art{display:block;width:100%;height:100%;background-image:url(robots.png);background-size:400% 400%;background-repeat:no-repeat}.board[data-count="12"]{grid-template-columns:repeat(6,1fr)}.board[data-count="16"]{grid-template-columns:repeat(8,1fr)}.robot-preview{object-fit:cover!important}.card-back small{font-size:clamp(5px,.6vw,9px)}@media(max-width:850px){.board[data-count="12"],.board[data-count="16"]{grid-template-columns:repeat(4,1fr)}.board[data-count="12"] .card,.board[data-count="16"] .card{aspect-ratio:1.2}}

.photo-robot{display:block;width:100%;aspect-ratio:1.4;background-image:url(robots.png);background-size:400% 400%;border-radius:6px}
.robot-art{height:100%;width:auto;max-width:100%;aspect-ratio:1230/1278;background-size:400% 400%}

.robot-wave{display:block;position:relative;width:80px;height:83px;margin:0 auto 8px;background:url(robots.png) 0 0/400% 400%}.robot-wave::before{content:"";position:absolute;left:69%;top:34%;width:31%;height:31%;background:#fbf7dd}.robot-wave span{position:absolute;inset:0;background:url(robots.png) 0 0/400% 400%;clip-path:polygon(67% 33%,100% 33%,100% 66%,67% 66%);transform-origin:70% 57%;animation:hello 1.2s ease-in-out infinite alternate}@keyframes hello{from{transform:rotate(-12deg)}to{transform:rotate(15deg)}}@media(prefers-reduced-motion:reduce){.robot-wave span{animation:none}}@media(min-width:851px) and (max-height:849px){.robot-wave{width:54px;height:56px;margin-bottom:2px}}

/* Match the card face to the illustration background. */
.card-front,.card-front img{background-color:#fdfadc}.robot-art{mix-blend-mode:normal}
/* Isolate the raised hand; keep the robot’s face stationary. */
.robot-wave::before{left:77%;top:45%;width:22%;height:16%;background:#fdfadc}.robot-wave span{clip-path:polygon(77% 45%,99% 38%,100% 61%,77% 61%);transform-origin:77% 57%}
.round-controls{display:flex;align-items:center}.pause-overlay{z-index:2}
/* A gentle hop accompanies the separate hand wave; the face stays together. */
.robot-wave{transform-origin:50% 90%;animation:robot-bounce 2.4s ease-in-out infinite}
.robot-wave span{animation:hello .55s ease-in-out infinite alternate}
.robot-wave::after{content:'✦';position:absolute;right:-8%;top:7%;color:#fa5b9c;font-size:14px;animation:robot-sparkle 2.4s ease-in-out infinite;pointer-events:none}
@keyframes robot-bounce{0%,100%{transform:translateY(0) rotate(0)}25%{transform:translateY(-4px) rotate(-3deg)}50%{transform:translateY(0) rotate(0)}75%{transform:translateY(-3px) rotate(3deg)}}
@keyframes robot-sparkle{0%,100%{opacity:.45;transform:scale(.7) rotate(0)}50%{opacity:1;transform:scale(1.15) rotate(25deg)}}
@media(prefers-reduced-motion:reduce){.robot-wave,.robot-wave span,.robot-wave::after{animation:none}}
/* Blend the mascot's pale illustration background into the welcome card. */
.robot-wave{filter:brightness(1.12) contrast(1.3);mix-blend-mode:multiply}
