.home { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; gap: calc(var(--u) * 1.1); padding-top: calc(var(--u) * 1.8); }
.home .start__title { font-size: calc(var(--u) * 3.4); }
.home__head { text-align: center; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--edge); }
.tabs button { font: 700 calc(var(--u) * 1.05) var(--serif); padding: 0.45em 1.6em; border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button.on { background: linear-gradient(170deg, #f3cf6e, #c9952f); color: #2a1d05; }
.tabs button:focus-visible, .hseg button:focus-visible, .hhero:focus-visible, .mbtn:focus-visible, .hmore summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hpanel { width: min(60em, 100%); box-sizing: border-box; display: grid; grid-template-columns: minmax(14em, 0.8fr) 1.4fr; gap: calc(var(--u) * 1.4); padding: calc(var(--u) * 1.4); border-radius: 14px; background: var(--panel); border: 1px solid rgba(243, 207, 110, 0.4); backdrop-filter: blur(4px); align-self: center; }
.hpanel[hidden] { display: none; }
.hcol { display: grid; gap: calc(var(--u) * 1); align-content: start; }
.hrow { display: grid; gap: 0.4em; }
.hrow__l, .hpick, .hrivals > span { margin: 0; font: 600 calc(var(--u) * 0.95) system-ui; color: var(--gold); letter-spacing: 0.08em; }
.hseg { display: flex; gap: 6px; }
.hseg button { flex: 1; display: grid; place-items: center; padding: 0.55em 0.6em; border-radius: 8px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.04); color: #e8f1f2; font: 600 calc(var(--u) * 1.05) system-ui; cursor: pointer; }
.hseg button small { font-size: 0.68em; color: var(--muted); }
.hseg button.on { border-color: var(--gold); background: rgba(243, 207, 110, 0.18); color: var(--gold); }
.hseg button:disabled { opacity: 0.45; cursor: not-allowed; }
.hmore summary { cursor: pointer; color: var(--muted); font-size: calc(var(--u) * 0.95); }
.hmore[open] { display: grid; gap: 0.6em; }
.hnote { margin: 0.4em 0 0; color: var(--muted); font-size: calc(var(--u) * 0.85); }
.hheroes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hhero { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.04); color: #e8f1f2; cursor: pointer; }
.hhero img { width: min(5.2em, 100%); aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 2px solid transparent; }
.hhero b { font-size: calc(var(--u) * 1.05); }
.hhero small { color: var(--muted); font-size: calc(var(--u) * 0.8); }
.hhero.on { border-color: var(--gold); background: rgba(243, 207, 110, 0.14); }
.hhero.on img { border-color: var(--gold); }
.hrivals { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.hriv { display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-size: calc(var(--u) * 0.85); padding: 3px 8px 3px 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); }
.hriv img { width: 1.8em; height: 1.8em; border-radius: 50%; object-fit: cover; }
.hriv i { font-style: normal; color: var(--muted); }
.hpanel--multi { grid-template-columns: 1fr 1fr; }
.mcard { display: grid; gap: 0.7em; align-content: start; padding: calc(var(--u) * 1.1); border-radius: 10px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.03); }
.mcard h2 { margin: 0; font: 700 calc(var(--u) * 1.2) var(--serif); color: var(--gold); }
.mcard p { margin: 0; color: var(--muted); font-size: calc(var(--u) * 0.9); }
.mcode { display: flex; gap: 6px; }
.mcode input { flex: 1; min-width: 0; padding: 0.55em 0.7em; border-radius: 8px; border: 1px solid var(--edge); background: rgba(0, 0, 0, 0.35); color: #fff; font: 700 calc(var(--u) * 1.1) ui-monospace, Menlo, monospace; letter-spacing: 0.15em; }
.mbtn { padding: 0.55em 1.2em; border-radius: 8px; border: 1px solid var(--gold); background: rgba(243, 207, 110, 0.2); color: var(--gold); font: 700 calc(var(--u) * 1) system-ui; cursor: pointer; }
.mbtn:disabled, .mcode input:disabled { opacity: 0.4; cursor: not-allowed; }
.mnote { grid-column: 1 / -1; text-align: center; margin: 0; }
.mdev { color: var(--gold); }
.merr { color: #ff8a8a; }
.home__actions { display: grid; justify-items: center; gap: calc(var(--u) * 0.8); margin-top: calc(var(--u) * 1.2); }
.home__actions .cta[hidden] { display: none; }
.home .rules { list-style: none; padding: 0; display: grid; gap: 8px; }
.home .rules li, .modal .rules li { display: flex; gap: 8px; align-items: center; }
.modal .rules { list-style: none; padding: 0; display: grid; gap: 8px; }
.modal .rules img { width: 2.2em; height: 2.2em; object-fit: contain; }
@media (max-width: 760px) {
  .home { padding: calc(var(--u) * 1.4) 10px 12px; }
  .hpanel, .hpanel--multi { grid-template-columns: 1fr; padding: 12px; }
  .hheroes { grid-template-columns: 1fr 1fr; }
  .hcol--heroes { order: -1; }
  .home__actions .cta { width: 100%; justify-content: center; box-sizing: border-box; }
  .home__actions { width: 100%; }
  .start__minor { flex-wrap: wrap; justify-content: center; }
  .home { gap: 8px; }
  .hpanel:not(.hpanel--multi) { gap: 10px; }
  .hhero { grid-template-columns: auto 1fr; grid-template-rows: auto auto; justify-items: start; column-gap: 8px; align-items: center; padding: 6px 8px; }
  .hhero img { grid-row: 1 / 3; width: 2.8em; }
  .hhero small { font-size: 11px; }
  .hcol { gap: 8px; }
  .home__actions { margin-top: 0; gap: 6px; }
}
@media (max-width: 760px) and (max-height: 760px) {
  .home .start__tagline { display: none; }
  .home .start__title { font-size: calc(var(--u) * 2.6); }
}
@media (max-height: 430px) and (orientation: landscape) {
  .home { gap: 6px; padding: 6px 12px; --u: 12px; }
  .home .start__title { font-size: 24px; letter-spacing: 0.1em; }
  .home .start__tagline { display: none; }
  .tabs button { padding: 0.3em 1.2em; font-size: 13px; }
  .hpanel, .hpanel--multi { grid-template-columns: minmax(0, 0.8fr) 1.4fr; padding: 8px 10px; gap: 10px; width: min(60em, 96vw); }
  .hcol { gap: 6px; }
  .hheroes { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .hhero { padding: 4px 2px; }
  .hhero img { width: 2.6em; }
  .hhero small { display: none; }
  .hcol--heroes { order: 0; }
  .hseg button { padding: 0.3em 0.4em; font-size: 13px; }
  .hnote, .hmore { font-size: 11px; }
  .hriv { font-size: 11px; }
  .home__actions { margin-top: 2px; gap: 4px; grid-template-columns: auto auto; align-items: center; column-gap: 14px; width: auto; }
  .home__actions .cta { width: auto; padding: 0.5em 1.8em; font-size: 16px; }
  .start__minor { flex-wrap: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .bg i { animation: none; } .start { transition: none; } }

/* ---- unify with the in-game menu kit (assets/ui/menu): 9-slice panel, gold/teal buttons, teal segmented controls ---- */
.hpanel:not(.hpanel--multi), .hpanel--multi {
  border-style: solid; border-width: 54px 40px; border-image: url('assets/ui/menu/panel.webp') 190 150 fill / 54px 40px stretch;
  background: transparent; backdrop-filter: none; padding: 0; gap: calc(var(--u) * 1.4); width: min(62em, 100%);
}
.home .cta {
  border-style: solid; border-width: 20px 30px; border-color: transparent; background: transparent; box-shadow: none; padding: 0 1.6em; min-height: 56px; box-sizing: border-box;
  border-image: url('assets/ui/menu/btn_gold.webp') 40 60 fill / 20px 30px stretch; color: #3a2606; text-shadow: 0 1px 0 rgba(255, 235, 170, 0.6); letter-spacing: 0.08em;
}
.home .cta:hover { filter: brightness(1.12); box-shadow: none; }
.home .cta kbd { color: #3a2606; }
.home .ghost {
  border-style: solid; border-width: 14px 30px; border-color: transparent; background: transparent; padding: 0 0.2em; min-height: 46px; box-sizing: border-box;
  border-image: url('assets/ui/menu/btn_teal.webp') 30 60 fill / 14px 30px stretch; text-shadow: 0 1px 3px #000;
}
.home .ghost:hover { background: transparent; filter: brightness(1.15); }
.home .seg-ctl, .home .tabs { background: #06222a; border: 1.5px solid #2fb5ad; }
.home .seg-ctl button.on { background: linear-gradient(180deg, rgba(72, 214, 214, 0.45), rgba(30, 140, 150, 0.45)); box-shadow: 0 0 10px rgba(80, 230, 230, 0.45), inset 0 0 0 1px #6fe9ea; color: #fff; }
.home .seg-ctl button { min-height: 30px; }
.hseg button { background: #06222a; border-color: #2fb5ad; }
.hseg button.on { background: linear-gradient(180deg, rgba(72, 214, 214, 0.4), rgba(30, 140, 150, 0.4)); box-shadow: 0 0 10px rgba(80, 230, 230, 0.4), inset 0 0 0 1px #6fe9ea; border-color: #6fe9ea; color: #fff; }
.hhero { background: rgba(6, 34, 42, 0.6); border-color: rgba(47, 181, 173, 0.5); }
.hhero.on { border-color: var(--gold); background: rgba(243, 207, 110, 0.16); box-shadow: 0 0 14px rgba(243, 207, 110, 0.35); }
.tabs button.on { background: linear-gradient(170deg, #f3cf6e, #c9952f); }
.mcard { background: rgba(6, 34, 42, 0.5); border-color: rgba(47, 181, 173, 0.5); }
@media (max-width: 760px) { .hpanel, .hpanel--multi { border-width: 40px 28px; border-image-width: 40px 28px; padding: 0; } .home .cta { width: 100%; } }
@media (max-height: 430px) and (orientation: landscape) { .hpanel, .hpanel--multi { border-width: 30px 26px; border-image-width: 30px 26px; padding: 0; } }
@media (max-width: 760px) {
  .home .start__title { font-size: calc(var(--u) * 2.6); letter-spacing: 0.08em; }
  .home .ghost { min-height: 40px; border-width: 12px 26px; border-image-width: 12px 26px; font-size: 13px; }
  .home .cta { min-height: 50px; }
  .hpanel:not(.hpanel--multi) { gap: 6px; }
}

/* v10: concept layout */
.tabs { gap: 6px; padding: 5px; }
.tabs button { min-height: 40px; padding: 0.4em 1.6em; border: 1.5px solid #2fb5ad; background: #06222a; color: #cfe7ec; }
.tabs button.on { border-color: #ffe39a; color: #2a1d05; box-shadow: 0 0 12px rgba(243, 207, 110, 0.4); }
.hpanel:not(.hpanel--multi) { grid-template-columns: minmax(13em, 0.75fr) 1.5fr; align-items: center; }
.hcol--ctl { padding-right: calc(var(--u) * 1.2); border-right: 1px solid rgba(111, 233, 234, 0.3); }
.hcol--heroes { text-align: center; }
.hpick { text-align: center; }
.hhero { position: relative; padding-bottom: 22px; }
.hhero__dot { position: absolute; bottom: 5px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; border: 2px solid #6fe9ea; background: transparent; }
.hhero.on .hhero__dot { border-color: var(--gold); background: radial-gradient(circle, var(--gold) 38%, transparent 42%); }
.hhero img { width: min(6em, 100%); }
.hrivals { justify-content: center; }
.hpanel--multi { gap: calc(var(--u) * 1.4); }
.mcard { border: 2px solid rgba(243, 207, 110, 0.45); border-radius: 12px; background: linear-gradient(170deg, rgba(14, 50, 58, 0.8), rgba(6, 24, 30, 0.85)); text-align: center; min-height: 11em; align-content: center; }
.mcard h2 { font-size: calc(var(--u) * 1.5); color: #fff3c9; }
.mcard > p { text-align: center; }
.mcard .mbtn[data-lobby="create"] { justify-self: center; }
.mcode { align-self: center; padding: 3px; border-radius: 8px; border: 1px solid rgba(111, 233, 234, 0.4); background: rgba(0, 0, 0, 0.35); }
.mcode input { border: 0; background: transparent; }
.mcode .mbtn { padding: 0 1em; font-size: calc(var(--u) * 1.6); line-height: 1; background: linear-gradient(170deg, #f3cf6e, #c9952f); color: #3a2606; border-color: #ffe39a; }
@media (max-width: 760px) { .hcol--ctl { border-right: 0; padding-right: 0; } .hhero { padding-bottom: 20px; } .hhero__dot { left: auto; right: 8px; bottom: 50%; margin: 0 0 -6px 0; } }

/* v11: logo art, tent illustration, phone layout (controls on top, 2x2 hero cards, dot bottom-centre) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home .start__title { margin: 0; line-height: 0; }
.start__logo { display: block; width: auto; max-width: min(460px, 70vw); height: min(150px, 17vh); margin: 0 auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); }
.mtent { width: auto; height: calc(var(--u) * 5.5); justify-self: center; object-fit: contain; pointer-events: none; }
@media (max-width: 760px) {
  .start__logo { width: min(300px, 74vw); height: auto; }
  .hpanel:not(.hpanel--multi) { grid-template-columns: 1fr; align-items: stretch; }
  .hcol--ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; padding: 0; }
  .hcol--ctl .hrow { min-width: 0; }
  .hcol--ctl .hseg button { padding: 0.5em 0.2em; white-space: nowrap; }
  .hheroes { grid-template-columns: 1fr 1fr; }
  .hhero { grid-template-columns: auto minmax(0, 1fr); padding: 6px 8px 20px; }
  .hhero b, .hhero small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .hhero__dot { left: 50%; right: auto; bottom: 5px; margin: 0 0 0 -6px; }
  .mtent { height: 64px; }
}
@media (max-height: 430px) and (orientation: landscape) {
  .start__logo { width: auto; height: 54px; }
  .mtent { height: 44px; }
  .hheroes { grid-template-columns: repeat(4, 1fr); }
  .hhero { grid-template-columns: 1fr; justify-items: center; padding: 4px 2px 18px; }
  .hhero img { grid-row: auto; width: 2.6em; }
  .hhero b { font-size: 12px; }
  .hhero__dot { left: 50%; right: auto; bottom: 4px; margin: 0 0 0 -6px; }
  .hpanel:not(.hpanel--multi) { grid-template-columns: minmax(0, 0.8fr) 1.4fr; }
  .hcol--ctl { display: grid; grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 760px) and (orientation: portrait) { .hcol--ctl { order: -1; } .hcol--heroes { order: 1; } }
@media (max-width: 760px) and (orientation: portrait) { .hhero img { width: 2.9em; } .hhero { column-gap: 8px; } }
@media (max-height: 430px) and (orientation: landscape) { .home .cta { min-height: 38px; } .home__head { margin: 0; } .home { gap: 6px; } }
@media (max-width: 760px) and (orientation: portrait) { .hhero { grid-template-columns: 52px minmax(0, 1fr); } .hhero img { width: 52px; } }
@media (max-height: 430px) and (orientation: landscape) {
  .start__logo { height: 44px; }
  .tabs button { min-height: 32px; padding: 0.2em 1.2em; }
  .hpanel, .hpanel--multi { border-width: 22px 24px; border-image-width: 22px 24px; }
  .hhero img { width: 2.2em; }
  .hrow__l { font-size: 12px; }
  .home .ghost { min-height: 32px; }
}
@media (max-height: 430px) and (orientation: landscape) { .hrivals { display: none; } .hhero { padding-bottom: 16px; } }
@media (max-height: 430px) and (orientation: landscape) { .start__logo { height: 38px; } .home { padding-top: 4px; padding-bottom: 4px; } .home .cta { min-height: 34px; } }
@media (max-height: 430px) and (orientation: landscape) { .hhero__dot { width: 10px; height: 10px; margin-left: -5px; bottom: 3px; } .hhero small { display: none; } .hhero b { margin-bottom: 2px; } }
/* v12: icon-only sound control, safe bottom margin */
.snd { position: fixed; top: 12px; right: 12px; z-index: 5; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1.5px solid rgba(127, 227, 240, 0.7); background: rgba(6, 28, 34, 0.8); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.snd:hover { background: rgba(20, 70, 80, 0.9); }
.snd:focus-visible { outline: 2px solid #f3cf6e; outline-offset: 0; }
.start { padding-bottom: max(16px, calc(var(--u) * 1.6)) !important; }
.home__actions { padding-bottom: 16px; }
/* v12 online cards */
.hpanel--multi { align-items: stretch; }
.mcard { min-height: 15em; }
.mcard--btn { font: inherit; cursor: pointer; display: grid; place-items: center; align-content: center; gap: 0.5em; color: inherit; }
.mcard--btn:hover:not(:disabled), .mcard--btn:focus-visible { border-color: #7fe3f0; box-shadow: 0 0 14px rgba(127, 227, 240, 0.45); }
.mcard--btn:focus-visible { outline: 2px solid #f3cf6e; outline-offset: 0; }
.mcard--btn:disabled { opacity: 0.55; cursor: not-allowed; }
.mcard .mtent { width: 60%; max-width: 100%; height: auto; }
.mcard:not(.mcard--btn) { align-content: center; }
@media (max-width: 760px) { .mcard { min-height: 0; } .mcard .mtent { width: 52%; } }
@media (max-height: 430px) and (orientation: landscape) { .mcard { min-height: 0; } .mcard .mtent { width: auto; height: 5.5em; } }
@media (min-width: 761px) and (min-height: 431px) and (max-height: 800px) { .start__logo { height: min(150px, 13vh); } .start { gap: calc(var(--u) * 0.8) !important; padding-top: calc(var(--u) * 1.6) !important; } }
@media (max-height: 430px) and (orientation: landscape) { .home__actions { padding-bottom: 0; } .start { padding-bottom: 16px !important; } }
.mcode input::placeholder { letter-spacing: normal; }
