: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:0;margin-right:0}.site-title{font-size:1.75rem;font-weight:700;color:#1f2933}.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}.card{background:#fff;border-radius:16px;padding:1.5rem;box-shadow:0 8px 16px #0f172a14}.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}.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;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{display:grid;grid-template-columns:repeat(12,minmax(80px,1fr));grid-auto-rows:minmax(80px,auto);gap:.5rem;padding:.5rem;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{grid-template-rows:repeat(6,auto);align-content:start;height:auto;max-height:100%}.multiplayer.is-active .card-tile{height:auto;aspect-ratio:1 / 1}.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:#fff}.card-front{font-size:1.5rem;color:#94a3b8}.card-back{transform:rotateY(180deg)}.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) .mobile-menu-button{display:inline-flex}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}.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}}
