.game-home{position:fixed;inset:0;z-index:2000;overflow:auto;background:radial-gradient(ellipse at 50% 100%,#12352b80,transparent 65%),radial-gradient(ellipse at 90% 0,#45246960,transparent 55%),#111016;color:#f4f2f7;padding:clamp(18px,4vh,44px) max(20px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom));}
.game-home[hidden]{display:none}
.main-menu-open .shell{visibility:hidden}
.home-content{max-width:1120px;min-height:100%;margin:auto;display:flex;flex-direction:column;justify-content:center;gap:clamp(18px,4vh,40px)}
.home-header{display:flex;align-items:center;justify-content:space-between;gap:20px}
.home-heading .home-kicker{font:10px monospace;letter-spacing:3px;color:#c098f5;margin:0 0 12px}
.home-heading h1{font-size:clamp(32px,4vw,56px)!important;letter-spacing:-2px;line-height:1.08;margin:0 0 12px}
.home-heading h1 span{color:#b16bff}
.home-heading>p:last-child{margin:0;color:#aaa4b4;font-size:15px}
.home-modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.mode-card{display:flex;flex-direction:column;align-items:flex-start;text-align:left;border:1px solid #40364c;border-radius:20px;padding:24px;min-width:0;color:inherit;background:linear-gradient(155deg,#292131,#19191f);font:inherit;cursor:pointer;transition:transform .18s,border-color .18s,background .18s;overflow:hidden}
.mode-card:hover{transform:translateY(-5px);border-color:#b16bff;background:linear-gradient(155deg,#362344,#192720)}
.mode-card:focus-visible{outline:3px solid #c493ff;outline-offset:4px}
.mode-meta{font:9px monospace;letter-spacing:1.5px;color:#b5a4c5;margin-top:20px}
.mode-card>strong{font-size:28px;letter-spacing:-.7px;margin:8px 0 10px}
.mode-description{font-size:13px;line-height:1.6;color:#bcb7c6;flex:1}
.mode-play{display:flex;justify-content:space-between;align-items:center;width:100%;border-top:1px solid #ffffff13;padding-top:16px;margin-top:20px;font-size:13px;font-weight:700;color:#d5b1ff}
.mode-play>span:last-child{font-size:23px;font-weight:400}
.mode-art{height:100px;display:flex;align-items:center;justify-content:center;width:100%;isolation:isolate;position:relative}
.mode-art:after{content:'';position:absolute;inset:auto 12% 0;height:20px;background:#0007;border-radius:50%;filter:blur(10px);z-index:-1}
.home-ball{display:grid;place-items:center;width:66px;height:66px;border-radius:50%;flex:none;font-style:normal;font-weight:800;font-size:20px;background:radial-gradient(circle at 30% 24%,#ffffffab 0%,#ffffff16 17%,transparent 35%),radial-gradient(circle at 36% 28%,var(--ball),#000 160%);box-shadow:inset -8px -10px 14px #0005,0 12px 18px #0006}
.home-ball:empty{font-size:0}
.home-ball:not(:empty){color:#16131b;text-shadow:0 0 1px #fff;background:radial-gradient(circle at center,#f4eee0 0 24%,transparent 25%),radial-gradient(circle at 30% 24%,#ffffffab,transparent 30%),radial-gradient(circle at 36% 28%,var(--ball),#000 160%)}
.mode-art .home-ball:nth-child(2){width:86px;height:86px;z-index:1;margin:0 -10px;transform:translateY(5px)}
.ball-yellow{--ball:#ffc500}.ball-black{--ball:#29292e}.ball-red{--ball:#ee1a36}.ball-pink{--ball:#fa8fc3}.ball-blue{--ball:#1468ec}.home-ball.ball-stripe:not(:empty){--ball:#efbd00;border:0;background:radial-gradient(circle at center,#f4eee0 0 24%,transparent 25%),radial-gradient(ellipse at 30% 22%,#ffffff99,transparent 35%),linear-gradient(0deg,#0005,transparent 65%),linear-gradient(#eee9dc 0 25%,#efbd00 26% 74%,#eee9dc 75% 100%)}
.home-footer{display:flex;justify-content:space-between;align-items:center;gap:14px;color:#8f879b;font-size:12px;min-height:40px}
.touch-game #backToGameMenu{position:fixed;top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));font-size:10px;min-height:40px;padding:6px 8px;width:60px;background:#241b30}
#backToGameMenu:disabled{opacity:.4;cursor:default}
@media(max-width:620px) and (orientation:portrait){.home-content{gap:22px;justify-content:flex-start}.home-modes{grid-template-columns:1fr;gap:12px}.mode-card{display:grid;grid-template-columns:92px 1fr;column-gap:16px;padding:16px;border-radius:15px}.mode-art{grid-row:1/5;height:100%;min-height:100px}.home-ball{width:35px;height:35px;font-size:12px}.mode-art .home-ball:nth-child(2){width:48px;height:48px;margin:0 -12px}.mode-meta{margin-top:0;font-size:8px;letter-spacing:1px}.mode-card>strong{font-size:23px;margin:4px 0}.mode-description{font-size:12px;line-height:1.4}.mode-play{padding-top:5px;margin-top:7px}.home-footer{flex-wrap:wrap}.mode-card:hover{transform:none}}
@media(max-height:560px) and (orientation:landscape){.game-home{padding-top:12px;padding-bottom:12px}.home-content{gap:12px}.home-heading .home-kicker,.home-heading>p:last-child{display:none}.home-heading h1{font-size:28px!important;margin:0}.mode-card{padding:12px 16px;border-radius:14px}.mode-art{height:60px}.home-ball{width:43px;height:43px;font-size:14px}.mode-art .home-ball:nth-child(2){width:56px;height:56px}.mode-meta{margin-top:10px;font-size:8px}.mode-card>strong{font-size:22px;margin:5px 0}.mode-description{font-size:11px;line-height:1.4}.mode-play{padding-top:6px;margin-top:10px}.home-footer{min-height:26px}.home-header .brand{font-size:10px}}
@media(prefers-reduced-motion:reduce){.mode-card{transition:none}.mode-card:hover{transform:none}}

.home-opponent{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}.home-opponent-tabs{display:flex;gap:4px;padding:4px;border:1px solid #44354f;border-radius:12px;background:#19141f}.home-opponent-tabs button{border:0;border-radius:8px;background:transparent;color:#b9afc5;font-family:inherit;font-size:13px;font-weight:600;padding:10px 16px;min-height:40px;cursor:pointer}.home-opponent-tabs button[aria-pressed="true"]{background:#8536d4;color:white}.home-difficulty{display:flex;gap:12px;align-items:center;color:#b9afc5;font-size:12px}.home-difficulty[hidden]{display:none}.home-difficulty select{color:#f3edf8;background:#251c30;border:1px solid #564261;border-radius:8px;padding:10px 16px;min-height:40px}.home-opponent button:focus-visible,.home-difficulty select:focus-visible{outline:2px solid #c493ff;outline-offset:3px}@media(max-height:560px) and (orientation:landscape){.home-opponent-tabs button{padding:5px 12px;min-height:30px;font-size:11px}.home-difficulty select{min-height:30px;padding:5px 12px}.home-content{gap:9px}}

.online-preview{padding:16px 20px;border:1px solid #6b4593;border-radius:12px;background:linear-gradient(120deg,#38204788,#17362b66)}.online-preview[hidden]{display:none}.online-preview strong{color:#d8b4ff;font-size:14px}.online-preview p{margin:6px 0 0;color:#bcb7c6;font-size:13px;line-height:1.5}.mode-card:disabled{opacity:.55;cursor:default}.mode-card:disabled:hover{transform:none;border-color:#40364c;background:linear-gradient(155deg,#292131,#19191f)}@media(max-width:620px){.home-opponent-tabs{max-width:100%;flex-wrap:wrap}.home-opponent-tabs button{padding:9px 12px;font-size:12px}}

.home-entry{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.home-entry[hidden],.home-opponent[hidden],.home-modes[hidden],.home-footer[hidden],.home-back[hidden]{display:none}.connection-card{display:flex;flex-direction:column;align-items:flex-start;min-width:0;padding:28px 30px;border:1px solid #4c3a5c;border-radius:20px;background:linear-gradient(140deg,#30213e,#18261f);color:inherit;text-align:left;font:inherit;cursor:pointer;transition:border-color .18s,transform .18s}.connection-card:hover{border-color:#bd8aff;transform:translateY(-4px)}.connection-card:focus-visible,.home-back:focus-visible{outline:3px solid #c493ff;outline-offset:4px}.connection-icon{font-size:46px;line-height:1;color:#bd8aff}.connection-card>strong{font-size:34px;margin:10px 0 12px;letter-spacing:-1px}.connection-card .mode-description{max-width:340px}.connection-card .mode-play{margin-top:24px}.home-back{align-self:flex-start;border:0;background:none;color:#bd9cde;cursor:pointer;font:inherit;font-size:13px;padding:2px 0;margin-bottom:-18px}#gameHome[data-stage="entry"] .home-opponent,#gameHome[data-stage="entry"] .home-modes,#gameHome[data-stage="entry"] .home-footer,#gameHome[data-stage="entry"] #onlinePreview{display:none}@media(max-width:620px) and (orientation:portrait){.home-entry{grid-template-columns:1fr;gap:14px}.connection-card{padding:20px 24px}.connection-card>strong{font-size:28px}.connection-icon{font-size:34px}.connection-card .mode-meta{margin-top:12px}.connection-card .mode-play{margin-top:16px}.home-back{margin-bottom:-8px}}@media(max-height:560px) and (orientation:landscape){.connection-card{padding:16px 22px}.connection-icon{font-size:28px}.connection-card>strong{font-size:26px;margin:6px 0}.connection-card .mode-meta{margin-top:10px}.connection-card .mode-description{font-size:12px}.connection-card .mode-play{margin-top:14px;padding-top:10px}.home-back{margin-bottom:0}}@media(prefers-reduced-motion:reduce){.connection-card{transition:none}.connection-card:hover{transform:none}}

.home-opponent-tabs button[hidden]{display:none}

/* Keep the back button at the left edge in flex and grid menus. */
#homeBack{justify-self:start;width:max-content;text-align:left}
