:root{font-family:Segoe UI,system-ui,sans-serif;color:#1f2933;background-color:#f7f7fb}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:#f7f7fb}html.has-active-game,body.has-active-game{height:100dvh;overflow:hidden}@media(max-width:900px){html.has-active-game,body.has-active-game{height:auto;overflow:auto}}@media(max-width:900px){body,#app,.app-shell,.app-main{height:auto!important;overflow:visible!important}}html.has-active-game.force-desktop,body.has-active-game.force-desktop{height:100dvh;overflow:hidden}a{color:#2563eb;text-decoration:none}a:hover{text-decoration:underline}#app{min-height:100vh}.app-shell{display:flex;flex-direction:column;min-height:100vh}.app-shell.has-active-game{height:100dvh;overflow:hidden}.app-header{display:flex;justify-content:flex-start;align-items:center;height:64px;box-sizing:border-box;padding:.5rem 1rem;background:#fff;border-bottom:1px solid #e2e8f0;gap:1.5rem;flex-wrap:nowrap;position:sticky;top:0;z-index:60}.app-header-right{display:flex;align-items:center;gap:1rem;margin-left:auto;margin-right:0;flex:1 1 auto;justify-content:flex-end;min-width:0}.site-title{display:inline-flex;align-items:center;gap:.6rem;font-size:1.75rem;font-weight:700;color:#1d4ed8;text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:2px}.site-title:hover,.site-title:focus-visible{color:#1e3a8a}.site-title-logo{width:28px;height:28px;flex:0 0 auto}.site-lock-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:2rem 1rem;background:#0f172acc;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);z-index:300}.site-lock-card{width:min(420px,100%);background:#0f172a;color:#f8fafc;border-radius:18px;padding:2rem;text-align:center;box-shadow:0 18px 40px #0f172a66}.site-lock-title{margin:0 0 .5rem;font-size:1.5rem}.site-lock-copy{margin:0 0 1.5rem;color:#cbd5f5}.site-lock-form{display:grid;gap:.75rem;text-align:left}.site-lock-label{font-weight:600}.site-lock-input{width:100%;padding:.65rem .75rem;border-radius:10px;border:1px solid #1e293b;background:#0b1220;color:#f8fafc}.site-lock-button{width:100%;padding:.7rem .75rem;border-radius:10px;border:none;background:#38bdf8;color:#0f172a;font-weight:700;cursor:pointer}.site-lock-button:disabled{opacity:.7;cursor:not-allowed}.site-lock-error{margin:.9rem 0 0;color:#fca5a5;font-weight:600}.site-lock-hint{margin:.75rem 0 0;color:#94a3b8;font-size:.9rem}.app-main{flex:1;padding:2rem;max-width:1200px;width:100%;margin:0 auto}.app-main.full-bleed{padding:0;max-width:none;width:100%;margin:0;height:calc(100dvh - var(--app-header-height, 64px));overflow:hidden}.home{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1.5rem;width:100%}.home-layout{display:flex;flex-direction:column;gap:1.5rem;align-items:center;width:100%}.home-mode-card{width:100%;text-align:center}.home-mode-card .mode-picker{align-items:center}.home-mode-card .mode-buttons{justify-content:center}.card{background:#fff;border-radius:16px;padding:1.5rem;box-shadow:0 8px 16px #0f172a14}.card.is-disabled{opacity:.55;filter:grayscale(.35)}.card.is-disabled .primary{pointer-events:none}.coming-soon{margin:.5rem 0 .75rem;font-weight:700;color:#6b7280;text-transform:uppercase;letter-spacing:.08em;font-size:.8rem}.primary.is-disabled{background:#cbd5f5;color:#6b7280;border-color:#cbd5f5;cursor:not-allowed;text-decoration:none}.instruction-overlay{position:fixed;inset:0;background:#0f172a8c;display:flex;align-items:center;justify-content:center;padding:1.5rem;z-index:200}.instruction-card{background:#fff;border-radius:18px;padding:1.75rem;width:min(640px,100%);box-shadow:0 18px 40px #0f172a40;display:grid;gap:.9rem;text-align:left}.instruction-card h2{margin:0}.instruction-card ul{margin:0;padding-left:1.25rem;display:grid;gap:.4rem}.instruction-hint{margin:0;font-style:italic;color:#4b5563}.instruction-opt-out{display:flex;align-items:center;gap:.5rem;font-weight:600}.primary{display:inline-flex;align-items:center;justify-content:center;padding:.6rem 1.4rem;border-radius:999px;background:#2563eb;color:#fff;font-weight:600}button{border-radius:10px;border:1px solid #cbd5f5;padding:.5rem 1rem;background:#fff;cursor:pointer}.multiplayer-header,.solo-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.75rem 1rem;margin:0;border-bottom:1px solid #e2e8f0;background:#fff}.multiplayer.is-active{width:100%;height:100%}.join-panel{max-width:420px;background:#fff;padding:1.5rem;border-radius:16px;box-shadow:0 10px 18px #0f172a14}.join-panel label{display:flex;flex-direction:column;gap:.4rem;margin-bottom:1rem}.mode-picker{display:flex;flex-direction:column;gap:.35rem;margin-bottom:1rem}.mode-label{font-weight:600;color:#1f2933}.mode-buttons{display:flex;flex-wrap:wrap;gap:.75rem}.mode-button{border-radius:999px;border:1px solid #d0d7ff;background:#fff;color:#1f2933;font-weight:700;font-size:1.05rem;padding:.75rem 1.6rem;box-shadow:0 8px 16px #2563eb1f;transition:transform .12s ease,box-shadow .12s ease,background .12s ease}.mode-button-title,.mode-button-subtitle{display:inline}@media(max-width:900px){.mode-button{padding:.9rem 1.8rem}.mode-button-title,.mode-button-subtitle{display:block;line-height:1.1}.mode-button-subtitle{font-weight:600;font-size:.95rem;opacity:.85}}.mode-button:hover{transform:translateY(-1px);box-shadow:0 10px 18px #2563eb29}.mode-button.active{background:#2563eb;border-color:#2563eb;color:#fff}.join-panel input{padding:.5rem .75rem;border-radius:8px;border:1px solid #cbd5f5}.actions{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.error{color:#b91c1c}.game-layout{display:grid;grid-template-columns:260px 1fr;grid-template-rows:1fr;align-items:stretch;height:100%}.left-rail{display:flex;flex-direction:column;gap:.2rem;padding:.75rem;border-right:1px solid #e2e8f0;background:#fff;height:100%}.play-mode,.status-line{font-weight:600;color:#1f2933;margin:0;line-height:1.2}.players-panel{background:#fff;padding:0;border-radius:0;box-shadow:none}.players-panel h3{margin:.15rem 0 .2rem;line-height:1.2}.players-panel p{margin:0}.players-panel ul{list-style:none;padding:0;margin:0;display:grid;gap:.2rem}.players-panel li{display:grid;grid-template-columns:1fr auto;gap:.25rem;align-items:center}.players-panel .score{font-weight:700}.players-panel .status{grid-column:span 2;font-size:.8rem;color:#4b5563}.players-panel .status.offline{color:#b91c1c}.players-panel .turn{font-size:.85rem;color:#2563eb}.game-board{--board-cols: 12;--board-rows: 6;--board-padding: .5rem;--card-size: 80px;display:grid;grid-template-columns:repeat(var(--board-cols),var(--card-size));grid-template-rows:repeat(var(--board-rows),var(--card-size));grid-auto-rows:var(--card-size);gap:.5rem;padding:var(--board-padding);align-content:start;box-sizing:border-box;height:auto}.card-tile{width:100%;aspect-ratio:1 / 1;padding:0;border:none;background:transparent}.card-tile.matched{pointer-events:none;animation:match-hide .3s ease forwards;animation-delay:var(--match-hide-delay, 1.5s)}@keyframes match-hide{to{opacity:0;visibility:hidden}}.multiplayer.is-active .game-board{align-content:center;height:100%;min-height:0}.multiplayer.is-active .card-tile{height:auto;aspect-ratio:1 / 1}@media(min-width:901px){.multiplayer.is-active .game-board{align-content:center;justify-content:center;height:100%}.multiplayer.is-active .card-tile{height:auto}}.card-inner{position:relative;width:100%;height:100%;aspect-ratio:1 / 1;transform-style:preserve-3d;transition:transform .4s ease}.card-inner.revealed,.card-inner.matched{transform:rotateY(180deg)}.card-front,.card-back{position:absolute;width:100%;height:100%;backface-visibility:hidden;border-radius:12px;display:grid;place-items:center;border:1px solid #cbd5f5;background:#fde7f1}.card-front{font-size:1.5rem;color:#94a3b8}.card-front img{width:100%;height:100%;object-fit:cover;object-position:center;padding:3px;box-sizing:border-box}.card-back{transform:rotateY(180deg);background:#fff}.card-back img{width:100%;height:100%;object-fit:cover;object-position:center;padding:3px;box-sizing:border-box}.invite-link{display:flex;align-items:center;gap:.5rem;min-width:0;flex:1 1 auto}.invite-label{white-space:nowrap}.invite-url{width:min(520px,50vw);max-width:100%;padding:.45rem .6rem;border-radius:8px;border:1px solid #cbd5f5;background:#fff;color:#1f2933;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.invite-copied{white-space:nowrap}@media(max-width:1100px){.game-board{grid-template-columns:repeat(10,minmax(70px,1fr));grid-template-rows:repeat(8,minmax(0,1fr))}}@media(max-width:900px){.game-layout{grid-template-columns:1fr}.left-rail{display:none}.game-board{--card-size: calc((100vw - 3.5rem) / 6);grid-template-columns:repeat(6,var(--card-size));grid-auto-rows:var(--card-size);align-content:start;justify-content:start}}@media(max-width:900px){html.has-active-game:not(.force-desktop),body.has-active-game:not(.force-desktop){height:auto;overflow:auto}.app-main.full-bleed{height:auto;overflow:visible}.multiplayer.is-active{min-height:auto}.game-layout{height:auto}.multiplayer.is-active .game-board{height:auto;align-content:start}}html.force-desktop .mobile-menu-button,html.force-desktop .mobile-drawer,html.force-desktop .mobile-overlay{display:none}.mobile-menu-button{display:none;border:1px solid #cbd5f5;background:#fff;border-radius:8px;padding:.35rem .6rem;font-size:1.1rem;cursor:pointer}.mobile-overlay,.mobile-drawer{display:none}@media(max-width:900px){html:not(.force-desktop) .app-header{position:sticky;padding-right:3.25rem}html:not(.force-desktop) .mobile-menu-button{display:inline-flex;position:absolute;right:1rem;top:50%;transform:translateY(-50%)}html:not(.force-desktop) .mobile-overlay{display:block;position:fixed;inset:0;background:#0f172a66;z-index:40}html:not(.force-desktop) .mobile-drawer{display:block;position:fixed;top:calc(var(--app-header-height, 64px) + 8px);right:0;left:0;background:#fff;padding:.75rem 1rem 1rem;border-bottom:1px solid #e2e8f0;transform:translateY(-110%);transition:transform .25s ease;z-index:50}html:not(.force-desktop) .mobile-drawer.open{transform:translateY(0)}html:not(.force-desktop) .app-header .invite-link{display:none}html:not(.force-desktop) .app-header-right{margin-left:auto}}.desktop-toggle{display:flex;align-items:center;gap:.5rem;margin-top:.5rem}.dev-tools{display:flex;gap:.5rem;margin-top:.5rem;flex-wrap:wrap}.delay-control{display:flex;flex-direction:column;gap:.25rem;font-size:.85rem;color:#475569}.delay-control input{width:120px}.turn-banner{position:fixed;top:40%;left:50%;transform:translate(-50%,-50%);padding:.75rem 1.5rem;background:#0f172ad9;color:#fff;border-radius:999px;font-weight:700;letter-spacing:.02em;z-index:60;animation:banner-fade 1.2s ease forwards}@keyframes banner-fade{0%{opacity:0;transform:translate(-50%,-50%) scale(.98)}10%{opacity:1;transform:translate(-50%,-50%) scale(1)}80%{opacity:1}to{opacity:0}}
