*{box-sizing:border-box}html{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}html[data-theme="light"]{--bg:#fafaf9;--surface:#fff;--ink:#21192f;--muted:#716b7b;--border:#e6e3e9;--tag:#f0e7f4;--purple:#66318c;--purple2:#542276}html[data-theme="dark"]{--bg:#17171c;--surface:#24242b;--ink:#f5f4f7;--muted:#aaa6b4;--border:#3b3943;--tag:#393140;--purple:#8650b3;--purple2:#6c3697}body{margin:0;background:var(--bg);color:var(--ink);transition:background .18s,color .18s}.container{max-width:900px;margin:auto;padding:0 22px}.header{height:95px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border)}.brand{display:flex;align-items:center;gap:12px;color:var(--ink);text-decoration:none;font-size:29px;letter-spacing:-1.3px}.brand img{width:48px;height:48px;object-fit:cover;border-radius:12px}.brand span{color:#ed725c}.header nav{display:flex;align-items:center;gap:8px}.icon-button{width:42px;height:42px;border:0;background:transparent;color:var(--ink);display:grid;place-items:center;border-radius:10px;cursor:pointer}.icon-button:hover,.icon-button:focus-visible{background:var(--tag)}svg{width:23px;height:23px}.intro{margin:48px 0 29px}.intro h1{font-size:clamp(34px,6vw,49px);letter-spacing:-1.8px;margin:0 0 10px}.intro p,.detail>p{font-size:18px;color:var(--muted);margin:0}.library{display:grid;gap:22px}.game-card{background:var(--surface);border:1px solid var(--border);border-radius:22px;padding:22px;box-shadow:0 3px 9px rgba(20,15,30,.055)}.game-row{display:flex;align-items:center;gap:24px}.game-icon{width:168px;height:168px;object-fit:cover;border-radius:24px;flex:none}.game-copy{min-width:0}.game-copy h2{font-size:clamp(22px,3.5vw,31px);letter-spacing:-.8px;margin:0 0 12px}.game-copy p{font-size:17px;line-height:1.45;color:var(--muted);margin:0 0 19px}.tags{display:flex;gap:9px;flex-wrap:wrap}.tags span{background:var(--tag);padding:7px 13px;border-radius:30px;font-size:14px;font-weight:650}.play{margin-top:20px;min-height:57px;border-radius:12px;background:linear-gradient(100deg,var(--purple),var(--purple2));color:#fff;display:flex;align-items:center;justify-content:center;gap:12px;text-decoration:none;font-weight:750;font-size:17px}.play svg{width:21px}.play:hover{filter:brightness(1.08)}footer{text-align:center;color:var(--muted);padding:35px 0 45px;font-size:15px}.back{display:inline-flex;align-items:center;gap:4px;text-decoration:none;color:var(--muted);margin:28px 0}.back svg{width:19px}.detail{background:var(--surface);border:1px solid var(--border);border-radius:22px;padding:28px;margin-bottom:24px}.detail>img{width:106px;border-radius:18px}.detail h1{font-size:36px;letter-spacing:-1px;margin:15px 0 8px}.notice{background:var(--tag);padding:20px;border-radius:12px;line-height:1.5;margin-top:28px;color:var(--ink)}.modes{display:grid;gap:12px;margin-top:28px}.modes>div{padding:18px;border:1px solid var(--border);border-radius:12px;display:flex;flex-direction:column;gap:5px}.modes small{color:var(--muted);font-size:14px}@media(max-width:600px){.container{padding:0 16px}.header{height:79px}.brand{font-size:24px;gap:8px}.brand img{width:40px;height:40px}.header nav{gap:0}.icon-button{width:39px;height:39px}.intro{margin:34px 0 26px}.intro p{font-size:15px}.game-card{padding:15px;border-radius:18px}.game-row{gap:14px}.game-icon{width:112px;height:112px;border-radius:18px}.game-copy h2{font-size:22px;margin:0 0 7px}.game-copy p{font-size:14px;margin-bottom:11px}.tags{gap:5px}.tags span{padding:5px 9px;font-size:12px}.play{min-height:52px;font-size:15px;margin-top:16px}.detail{padding:20px}}@media(max-width:375px){.game-icon{width:95px;height:95px}.game-copy h2{font-size:20px}.game-copy p{font-size:13px}.tags span{font-size:11px}}
/* V3.1: clean game icon transparency and visible theme control */
.game-icon{object-fit:contain;background:transparent}.icon-button#theme-toggle{background:transparent}.icon-button#theme-toggle svg{width:25px;height:25px;display:block}

/* V3.2 transparent master brand mark */
.brand img{object-fit:contain;border-radius:0}

/* V3.2.2: same idle/hover/focus treatment as other header controls */
.icon-button#theme-toggle{background:transparent;box-shadow:none;}
.icon-button#theme-toggle:hover,.icon-button#theme-toggle:focus-visible{background:var(--tag);}
.icon-button#theme-toggle:focus:not(:focus-visible),.icon-button#theme-toggle:active{background:transparent;box-shadow:none;}

/* Rebuilt, self-contained game introductions */
.game-main{width:100%;max-width:560px;margin:0 auto}.game-intro{display:flex;flex-direction:column;align-items:center;text-align:center;padding:20px 0 22px}.game-intro[hidden],.flow[hidden],.modal-backdrop[hidden]{display:none!important}.hero-icon{display:block;width:124px!important;height:124px!important;max-width:124px!important;object-fit:contain;margin:0 auto 14px}.game-intro h1{font-size:32px;letter-spacing:-.8px;margin:0 0 5px}.game-intro .subtitle{margin:0 0 20px;color:var(--muted);font-size:15px}.best-card{width:100%;border:1px solid var(--border);background:var(--surface);border-radius:17px;display:flex;flex-direction:column;align-items:center;gap:4px;padding:18px;margin-bottom:23px}.best-card svg{color:#8c52b5;width:23px;height:23px}.best-card strong{font-size:25px}.best-card small{color:var(--muted);font-size:13px}.game-intro h3{align-self:stretch;text-align:left;font-size:14px;margin:0 0 11px}.mode-options{width:100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin-bottom:18px}.mode-option{width:100%;min-width:0;min-height:122px;background:var(--surface);color:var(--ink);border:1px solid var(--border);border-radius:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:12px 6px;cursor:pointer;font:inherit}.mode-option.chosen{border:2px solid #8c52b5;background:var(--tag)}.mode-option svg{width:25px;height:25px;color:#8c52b5}.mode-option b{font-size:14px}.mode-option small{color:var(--muted);font-size:12px}.primary-action,.secondary-action{width:100%;border-radius:12px;cursor:pointer;font:inherit;font-weight:750;min-height:53px}.primary-action{background:#66318c;color:white;border:0;margin:0;display:flex;justify-content:center;align-items:center;gap:10px}.secondary-action{margin-top:10px;background:var(--surface);color:var(--ink);border:1px solid var(--border)}.small-note{font-size:12px;color:var(--muted);margin:17px 0 0}.flow{border:1px solid var(--border);background:var(--surface);border-radius:18px;padding:22px;margin:12px 0 30px}.flow h2{text-align:center;margin:8px 0}.flow p{text-align:center;color:var(--muted);line-height:1.5}.flow .tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:18px 0}.flow .tabs button{background:var(--surface);border:1px solid var(--border);border-radius:10px;color:var(--ink);padding:12px;font:inherit;cursor:pointer}.flow .tabs .active{border:2px solid #8c52b5;background:var(--tag)}.flow input{width:100%;padding:14px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--ink);font:inherit}.flow .primary-action{margin-top:14px}.flow .primary-action:disabled{opacity:.4;cursor:not-allowed}.flow .secondary-action{margin-top:12px}.room-code{text-align:center;font-size:30px;font-weight:800;letter-spacing:3px;padding:12px}.player-row{display:flex;justify-content:space-between;align-items:center;padding:13px;border:1px solid var(--border);border-radius:10px;margin:8px 0}.room-controls{display:flex;align-items:center;justify-content:center;gap:12px;margin:12px 0}.room-controls button{width:42px;height:42px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--ink);cursor:pointer}.room-controls button:disabled{opacity:.4}.room-status{text-align:center;background:var(--tag);border-radius:10px;padding:13px;margin:12px 0}.modal-backdrop{position:fixed;inset:0;z-index:1000;background:rgba(10,8,15,.7);display:flex;align-items:center;justify-content:center;padding:18px}.rules-dialog{width:100%;max-width:460px;max-height:85dvh;overflow-y:auto;background:var(--surface);color:var(--ink);border-radius:20px;padding:22px;box-shadow:0 22px 70px #0005}.dialog-top{display:flex;justify-content:space-between;align-items:center}.dialog-top h2{margin:0}.dialog-top button{background:transparent;border:0;color:var(--ink);font-size:28px;cursor:pointer}.rules-dialog ol{padding-left:23px;line-height:1.55}.rules-dialog li{margin:9px 0}.rules-dialog .primary-action{margin-top:16px}.game-main .back{margin:23px 0 10px}.flow .muted{color:var(--muted);font-size:12px}.flow .center{text-align:center}.game-main button:focus-visible{outline:3px solid #8c52b5;outline-offset:2px}@media(max-width:600px){.game-main{max-width:560px}.game-intro{padding-top:15px}.hero-icon{width:124px!important;height:124px!important}.game-intro h1{font-size:29px}}

/* V5.1 responsive introduction screens — width AND available viewport height */
@media (max-width: 600px) {
 .game-main .back {margin: 14px 0 5px;}
 .game-intro {padding: 10px 0 12px;}
 .hero-icon {width: 106px!important;height:106px!important;max-width:106px!important;margin-bottom:10px;}
 .game-intro h1 {font-size:27px;margin-bottom:3px;}
 .game-intro .subtitle {font-size:14px;margin-bottom:14px;}
 .best-card {padding:11px 12px;gap:2px;margin-bottom:15px;}
 .best-card svg {width:20px;height:20px;}
 .best-card strong {font-size:21px;}
 .game-intro h3 {margin-bottom:8px;}
 .mode-options {margin-bottom:13px;gap:9px;}
 .mode-option {min-height:101px;gap:5px;padding:9px 5px;}
 .mode-option svg {width:22px;height:22px;}
 .primary-action,.secondary-action {min-height:48px;}
 .secondary-action {margin-top:8px;}
 .small-note {margin-top:12px;}
}
@media (max-width: 600px) and (max-height: 850px), (max-width: 375px) {
 .header {height:65px;}
 .game-main .back {margin:10px 0 2px;}
 .game-intro {padding:5px 0 8px;}
 .hero-icon {width:88px!important;height:88px!important;max-width:88px!important;margin-bottom:7px;}
 .game-intro h1 {font-size:25px;}
 .game-intro .subtitle {font-size:13px;margin-bottom:10px;}
 .best-card {padding:8px;gap:1px;margin-bottom:11px;}
 .best-card svg {width:18px;height:18px;}
 .best-card strong {font-size:19px;}
 .game-intro h3 {margin-bottom:7px;}
 .mode-options {margin-bottom:10px;}
 .mode-option {min-height:88px;gap:4px;padding:7px 4px;}
 .mode-option svg {width:20px;height:20px;}
 .mode-option b {font-size:13px;}
 .mode-option small {font-size:11px;}
 .primary-action,.secondary-action {min-height:44px;}
 .secondary-action {margin-top:7px;}
 .small-note {margin-top:9px;}
}
@media (max-width: 600px) and (max-height: 700px) {
 .hero-icon {width:76px!important;height:76px!important;max-width:76px!important;}
 .game-intro h1 {font-size:23px;}
 .best-card {padding:6px;}
 .mode-option {min-height:80px;}
 .game-main .back {margin:7px 0 0;}
}
@media (prefers-reduced-motion: reduce) { .flow {scroll-behavior:auto;} }

/* Word Grid shared Challenge Friends entry */
.wg-entry-shell{max-width:760px;margin:24px auto 36px;padding:30px;border:1px solid var(--border,#e8e1ed);border-radius:24px;background:var(--card,#fff);text-align:center}
.wg-entry-heading{margin:12px 0 28px}.wg-entry-kicker{font-size:12px;font-weight:900;letter-spacing:2px;color:#a26ad5}.wg-entry-heading h1{font-size:clamp(32px,6vw,52px);margin:12px 0;color:var(--text,#261b31)}.wg-entry-heading p,.wg-entry-card p{color:var(--muted,#756b80)}
.wg-entry-card{border:1px solid var(--border,#e8e1ed);border-radius:20px;padding:22px 25px;margin:18px 0;background:var(--card,#fff)}.wg-entry-card h2{font-size:24px;margin:0 0 12px}.wg-entry-card .lobby-primary{width:100%;margin-top:14px}.wg-entry-card .lobby-input{width:100%;box-sizing:border-box}.wg-entry-username{max-width:400px;margin:18px auto;text-align:left}.wg-entry-username label{font-size:13px;font-weight:700;display:block;margin-bottom:8px}.wg-entry-back{display:inline-block;margin:14px auto;color:inherit;text-decoration:none;border:1px solid var(--border,#e8e1ed);border-radius:10px;padding:10px 20px}
@media(max-width:600px){.wg-entry-shell{padding:17px;margin:18px auto}.wg-entry-card{padding:16px}.wg-entry-heading h1{font-size:36px}}

/* RANKED seamless transparent icon */
.game-icon[src*="ranked-web.webp"]{border:0!important;background:transparent!important;box-shadow:none!important;object-fit:contain!important}

/* V11 visible keyboard focus across themes */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[role="button"]:focus-visible{outline:3px solid #a66ad4;outline-offset:3px;}

/* V11 Stage 3: readable crawlable game summaries and footer links */
.static-game-rules{max-width:760px;margin:2.5rem auto 1rem;padding:1.25rem 1.5rem;border:1px solid rgba(128,128,128,.22);border-radius:16px;line-height:1.6}.static-game-rules h2{font-size:1.15rem;margin:0 0 .5rem}.static-game-rules p{margin:0}.legal-nav{display:flex;justify-content:center;flex-wrap:wrap;gap:.6rem 1.2rem;margin-top:1rem;font-size:.84rem}.legal-nav a{color:inherit;text-decoration:underline;text-underline-offset:3px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
