:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #061017;
    color: #edf7f3;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    min-height: 100%;
}

body {
    overflow: hidden;
    overscroll-behavior: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

h1:focus {
    outline: none;
}

.boot-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #061017;
}

.boot-panel {
    width: min(420px, calc(100vw - 32px));
    border: 1px solid rgba(106, 220, 196, 0.25);
    background: rgba(9, 24, 28, 0.88);
    padding: 28px;
}

.lobby-shell {
    position: relative;
    isolation: isolate;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 24px;
    background: #061017;
}

.lobby-shell::before {
    content: "";
    position: absolute;
    inset: -30px;
    z-index: -2;
    background-image:
        url("/content/Brand/hex_reference.webp"),
        linear-gradient(145deg, #6fcfe0, #7ecf55 38%, #16a5d5 72%, #07131a);
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    background-size: cover, cover;
    filter: blur(13px) saturate(1.12) brightness(0.78);
    transform: scale(1.04);
}

.lobby-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at center, rgba(1, 9, 14, 0.06) 0 34%, rgba(1, 8, 12, 0.42) 62%, rgba(0, 0, 0, 0.86) 100%),
        linear-gradient(180deg, rgba(2, 13, 17, 0.2), rgba(2, 9, 13, 0.58));
}

.lobby-panel {
    position: relative;
    z-index: 1;
    width: min(476px, calc(100vw - 32px));
    border: 1px solid rgba(202, 222, 220, 0.2);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(10, 24, 24, 0.82), rgba(7, 17, 18, 0.76));
    box-shadow: 0 26px 84px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(16px);
    padding: 28px 28px 30px;
}

.lobby-brand {
    display: grid;
    gap: 8px;
    justify-items: center;
    margin-bottom: 26px;
    text-align: center;
}

.lobby-brand img {
    width: 142px;
    height: 74px;
    object-fit: contain;
}

.lobby-brand h1 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.lobby-brand p {
    margin: 4px 0 0;
    color: #c5d1cf;
    font-size: 0.96rem;
}

.lobby-form {
    display: grid;
    gap: 14px;
}

.login-panel {
    display: grid;
    gap: 14px;
    padding: 22px;
    border: 1px solid rgba(202, 222, 220, 0.19);
    border-radius: 8px;
    background: rgba(3, 11, 14, 0.62);
}

.auth-session {
    min-height: 54px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 0 14px;
    border: 1px solid rgba(202, 222, 220, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
}

.auth-session strong {
    min-width: 0;
    overflow: hidden;
    color: #edf7f3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-section-label {
    color: #aab8b6;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.google-login-button-shell {
    min-height: 42px;
}

.google-login-button-shell.official-google-button {
    position: absolute;
    width: 1px;
    min-height: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.google-login-button-shell.is-hidden {
    display: none;
}

.google-login-action,
.guest-login-action {
    width: 100%;
    min-height: 54px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(202, 222, 220, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #edf7f3;
    padding: 0 12px;
}

.google-login-action:hover,
.guest-login-action:hover {
    border-color: rgba(77, 215, 164, 0.45);
    background: rgba(255, 255, 255, 0.1);
}

.google-login-action img {
    width: 32px;
    height: 32px;
    display: block;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    padding: 4px;
}

.google-login-action strong,
.guest-login-action strong {
    min-width: 0;
    text-align: left;
    font-size: 0.94rem;
}

.guest-login-action {
    grid-template-columns: minmax(0, 1fr);
}

.login-divider {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    color: #b8c5c2;
    font-size: 0.76rem;
    font-weight: 800;
}

.login-divider::before,
.login-divider::after {
    content: "";
    height: 1px;
    background: rgba(202, 222, 220, 0.14);
}

.google-login-status {
    min-height: 18px;
    margin: 0;
    color: #f5d570;
    font-size: 0.78rem;
    line-height: 1.35;
}

.google-login-status:empty {
    display: none;
}

.google-login-status[data-state="error"] {
    color: #ffb6a8;
}

.lobby-form label {
    display: grid;
    gap: 6px;
}

.lobby-form span {
    color: #9cb4b1;
    font-size: 0.78rem;
}

.lobby-form input {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(122, 220, 207, 0.24);
    background: rgba(2, 10, 14, 0.72);
    color: #edf7f3;
    padding: 0 12px;
    outline: none;
}

.lobby-form input:focus {
    border-color: rgba(245, 213, 112, 0.72);
}

.lobby-error {
    margin: 0;
    color: #ffb6a8;
    font-size: 0.82rem;
}

.dashboard-shell {
    position: relative;
    isolation: isolate;
    height: 100dvh;
    min-height: 100svh;
    overflow: hidden;
    display: grid;
    grid-template-rows: 86px auto minmax(0, 1fr);
    gap: 10px;
    padding:
        max(10px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(10px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left));
    background:
        radial-gradient(ellipse at 47% 23%, rgba(246, 177, 46, 0.28), transparent 31%),
        radial-gradient(ellipse at 82% 38%, rgba(133, 54, 190, 0.24), transparent 26%),
        linear-gradient(180deg, rgba(6, 15, 18, 0.96), rgba(4, 8, 10, 0.99)),
        #05090b;
}

.dashboard-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.82;
    background:
        linear-gradient(90deg, rgba(246, 177, 46, 0.07) 1px, transparent 1px) 0 0 / 72px 72px,
        linear-gradient(0deg, rgba(62, 214, 205, 0.05) 1px, transparent 1px) 0 0 / 72px 72px,
        radial-gradient(circle at 50% 27%, transparent 0 125px, rgba(245, 196, 80, 0.2) 126px 128px, transparent 130px),
        radial-gradient(circle at 50% 27%, transparent 0 215px, rgba(245, 196, 80, 0.18) 216px 218px, transparent 220px);
}

.deck-builder-topbar,
.deck-result-strip,
.active-deck-panel,
.deck-library-panel,
.deck-detail-panel {
    border: 1px solid rgba(214, 166, 71, 0.36);
    background: linear-gradient(180deg, rgba(11, 20, 22, 0.92), rgba(5, 10, 12, 0.94));
    box-shadow: inset 0 0 0 1px rgba(255, 225, 139, 0.07), 0 18px 44px rgba(0, 0, 0, 0.38);
}

.deck-builder-topbar {
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(210px, 300px) minmax(0, 1fr) minmax(210px, 270px);
    gap: 12px;
    align-items: stretch;
    min-height: 0;
    padding: 8px 10px;
}

.deck-builder-player {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.deck-builder-player img {
    width: 82px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(245, 178, 58, 0.34));
}

.deck-builder-player h1,
.deck-builder-player p {
    margin: 0;
}

.deck-builder-player h1 {
    color: #f6c762;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.56rem;
    line-height: 1;
    text-transform: uppercase;
}

.deck-builder-player p {
    margin-top: 7px;
    color: #f2efe0;
    font-size: 0.82rem;
    font-weight: 800;
}

.deck-builder-player p span {
    margin-left: 8px;
    color: #b8b3a1;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.deck-builder-counters {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(64px, 1fr));
    gap: 7px;
}

.deck-builder-counters div {
    min-width: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    padding: 6px 5px;
    border: 1px solid rgba(93, 213, 205, 0.18);
    background:
        linear-gradient(135deg, rgba(16, 31, 36, 0.94), rgba(5, 11, 14, 0.94)),
        #071014;
}

.deck-builder-counters span {
    color: #c5bfa7;
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
}

.deck-builder-counters strong {
    margin-top: 3px;
    color: #f6d66f;
    font-size: 1.22rem;
    line-height: 1;
}

.deck-start-button {
    min-width: 0;
    display: grid;
    place-items: center;
    align-content: center;
    border: 1px solid rgba(255, 198, 84, 0.88);
    background:
        linear-gradient(180deg, rgba(192, 53, 25, 0.98), rgba(93, 17, 13, 0.98)),
        #8d2215;
    color: #fff2bf;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 2px rgba(255, 235, 152, 0.18), 0 0 24px rgba(255, 102, 25, 0.34);
}

.deck-start-button strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.28rem, 1.95vw, 1.92rem);
    line-height: 1;
}

.deck-start-button span {
    display: block;
    margin-top: 6px;
    color: #ffd993;
    font-size: 0.68rem;
    font-weight: 800;
}

.deck-start-button:disabled {
    filter: grayscale(0.75) brightness(0.6);
}

.deck-result-strip {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
}

.deck-result-strip > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.deck-result-strip strong {
    color: #f5cf61;
}

.deck-result-strip dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    gap: 8px;
}

.deck-builder-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 12px;
}

.deck-builder-main {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(230px, 42%) minmax(0, 1fr);
    gap: 10px;
}

.active-deck-panel {
    position: relative;
    min-height: 0;
    overflow: hidden;
    padding: 14px 22px 18px;
}

.deck-section-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    margin-bottom: 12px;
}

.deck-section-title span {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(246, 197, 81, 0.85), transparent);
}

.deck-section-title h2 {
    margin: 0;
    color: #f6cf73;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1rem, 1.6vw, 1.48rem);
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
}

.active-deck-slots {
    height: calc(100% - 34px);
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    gap: clamp(8px, 1.3vw, 18px);
    align-items: center;
}

.deck-slot {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 258px;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 2px;
    align-items: end;
    padding: 8px;
    border: 1px dashed rgba(164, 144, 91, 0.45);
    background: rgba(2, 8, 10, 0.54);
    color: #dbcfae;
}

.deck-slot.filled {
    border-style: solid;
    border-color: rgba(255, 192, 67, 0.78);
    background: linear-gradient(180deg, rgba(65, 38, 13, 0.72), rgba(8, 12, 13, 0.9));
    box-shadow: 0 0 20px rgba(245, 171, 38, 0.3), inset 0 0 0 1px rgba(255, 240, 163, 0.12);
}

.deck-slot.tier-2,
.dashboard-card.tier-2,
.detail-card.tier-2 {
    border-color: rgba(211, 86, 255, 0.74);
    box-shadow: 0 0 20px rgba(181, 73, 255, 0.24), inset 0 0 0 1px rgba(244, 199, 255, 0.1);
}

.deck-slot.focused {
    outline: 2px solid rgba(255, 242, 159, 0.78);
    outline-offset: 2px;
}

.deck-slot img {
    min-height: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45));
}

.deck-slot span,
.deck-slot small {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deck-slot span {
    color: #fff1c6;
    font-size: 0.78rem;
    font-weight: 900;
}

.deck-slot small {
    color: #d9c58c;
    font-size: 0.64rem;
    text-transform: uppercase;
}

.deck-slot.empty {
    place-items: center;
    align-content: center;
    grid-template-rows: auto auto;
}

.deck-library-panel {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-rows: 52px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
}

.deck-filter-row {
    display: grid;
    grid-template-columns: 104px 190px minmax(494px, 1fr) 98px;
    gap: 8px;
    align-items: stretch;
    min-width: 0;
    height: 52px;
}

.filter-block,
.owned-count {
    min-width: 0;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
    border: 1px solid rgba(214, 166, 71, 0.26);
    background: rgba(2, 8, 10, 0.52);
}

.filter-block > span,
.owned-count span {
    color: #c4b88c;
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
}

.deck-filter-button {
    min-height: 32px;
    width: 44px;
    border: 1px solid rgba(214, 166, 71, 0.28);
    background: rgba(9, 21, 24, 0.88);
    color: #d8ccb0;
    padding: 0 10px;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.deck-filter-button.active {
    border-color: rgba(255, 210, 91, 0.86);
    background: linear-gradient(180deg, rgba(171, 118, 28, 0.88), rgba(76, 47, 15, 0.92));
    color: #fff2be;
}

.type-filter .deck-filter-button:nth-of-type(3) {
    border-color: rgba(103, 222, 99, 0.4);
}

.type-filter .deck-filter-button:nth-of-type(4) {
    border-color: rgba(255, 87, 80, 0.44);
}

.type-filter .deck-filter-button:nth-of-type(5) {
    border-color: rgba(98, 210, 241, 0.44);
}

.type-filter .deck-filter-button:nth-of-type(6) {
    border-color: rgba(208, 89, 237, 0.44);
}

.owned-count {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    width: 98px;
}

.owned-count strong {
    color: #efe7d0;
    font-size: 1rem;
}

.dashboard-error {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 66px;
    z-index: 8;
    margin: 0;
    min-height: 22px;
    padding: 3px 8px;
    border: 1px solid rgba(255, 127, 103, 0.32);
    background: rgba(33, 8, 7, 0.9);
    color: #ffb6a8;
    font-size: 0.82rem;
}

.card-library {
    min-height: 0;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
    grid-auto-rows: 220px;
    gap: 10px;
    padding: 4px 4px 4px 0;
    scrollbar-color: rgba(218, 180, 91, 0.5) rgba(4, 9, 11, 0.5);
}

.dashboard-card {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 220px;
    display: grid;
    grid-template-rows: 124px 79px;
    gap: 5px;
    padding: 6px;
    border: 2px solid rgba(255, 192, 67, 0.56);
    background: linear-gradient(180deg, rgba(65, 38, 13, 0.7), rgba(6, 12, 13, 0.92));
    overflow: hidden;
}

.dashboard-card.selected {
    border-color: rgba(255, 212, 88, 0.95);
    background: linear-gradient(180deg, rgba(98, 55, 15, 0.82), rgba(6, 12, 13, 0.94));
    box-shadow: inset 0 0 0 1px rgba(255, 248, 178, 0.28), 0 0 16px rgba(255, 178, 38, 0.18);
}

.dashboard-card.focused {
    border-color: rgba(255, 242, 159, 0.98);
    box-shadow: inset 0 0 0 1px rgba(255, 248, 178, 0.34), 0 0 18px rgba(255, 215, 91, 0.24);
}

.dashboard-card-main {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 124px;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.dashboard-card-main img {
    display: block;
    width: 100%;
    height: 124px;
    object-fit: contain;
}

.dashboard-card.selected .dashboard-card-main::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(246, 189, 59, 0.3);
    pointer-events: none;
}

.card-pick-state {
    position: absolute;
    left: 4px;
    top: 6px;
    z-index: 3;
    padding: 2px 5px;
    border: 1px solid rgba(255, 223, 119, 0.4);
    background: rgba(4, 10, 12, 0.82);
    color: #f8d678;
    font-size: 0.54rem;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-card-body {
    position: relative;
    z-index: 4;
    min-width: 0;
    height: 79px;
    display: grid;
    gap: 4px;
    align-content: start;
    padding-top: 1px;
    background: linear-gradient(180deg, rgba(4, 10, 12, 0.78), rgba(4, 10, 12, 0.92));
}

.dashboard-card-title {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.dashboard-card-title strong,
.dashboard-card-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-card-title strong {
    color: #fff0bf;
    font-size: 0.66rem;
}

.dashboard-card-title span {
    color: #d5c7a3;
    font-size: 0.56rem;
    text-transform: uppercase;
}

.dashboard-card-stats,
.dashboard-card-costs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.dashboard-card-stats span,
.dashboard-card-costs span {
    min-width: 0;
    overflow: hidden;
    padding: 3px 4px;
    background: rgba(255, 255, 255, 0.055);
    color: #efe2bf;
    font-size: 0.54rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-card-costs span {
    color: #f8d678;
}

.locked-card {
    place-items: center;
    align-content: center;
    height: 220px;
    border-color: rgba(128, 104, 71, 0.28);
    background:
        linear-gradient(135deg, rgba(13, 28, 30, 0.55), rgba(3, 8, 10, 0.92)),
        #050a0c;
    color: #8f846e;
}

.locked-card-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(214, 166, 71, 0.28);
    color: #bd9d62;
    font-size: 0.64rem;
    font-weight: 900;
    text-transform: uppercase;
}

.locked-card > span {
    margin-top: 10px;
    font-size: 0.64rem;
}

.deck-detail-panel {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
}

.detail-card {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 192, 67, 0.58);
    background:
        linear-gradient(180deg, rgba(23, 16, 15, 0.92), rgba(5, 9, 12, 0.98)),
        #080d10;
}

.detail-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.detail-card-head h2,
.detail-card-head span {
    margin: 0;
}

.detail-card-head h2 {
    color: #f6f1dd;
    font-size: 1.36rem;
    line-height: 1.05;
}

.detail-card-head span {
    display: block;
    margin-top: 5px;
    color: #c8b991;
    font-size: 0.78rem;
}

.detail-card-head strong {
    flex: 0 0 auto;
    color: #ffd66e;
    font-size: 1.35rem;
}

.detail-card-art {
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 14px;
    border: 1px solid rgba(255, 214, 110, 0.22);
    background:
        radial-gradient(ellipse at 50% 36%, rgba(243, 184, 61, 0.25), transparent 57%),
        rgba(3, 8, 10, 0.54);
    overflow: hidden;
}

.detail-card.tier-2 .detail-card-art {
    background:
        radial-gradient(ellipse at 50% 36%, rgba(184, 82, 255, 0.27), transparent 57%),
        rgba(3, 8, 10, 0.54);
}

.detail-card-art img {
    display: block;
    width: min(74%, 220px);
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.detail-stats div {
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

.detail-stats dt {
    color: #b5aa8e;
    font-size: 0.62rem;
    font-weight: 900;
}

.detail-stats dd {
    color: #f8f0d6;
    font-size: 1rem;
}

.detail-trait {
    padding: 10px;
    border: 1px solid rgba(214, 166, 71, 0.26);
    background: rgba(139, 102, 54, 0.16);
}

.detail-trait strong {
    display: block;
    color: #f6d476;
    font-size: 0.92rem;
}

.detail-trait p,
.detail-flavor {
    margin: 6px 0 0;
    color: #d8c7a2;
    font-size: 0.78rem;
    line-height: 1.38;
}

.detail-upgrades {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.detail-empty {
    min-height: 0;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 18px;
    border: 1px dashed rgba(214, 166, 71, 0.28);
    color: #b5aa8e;
    text-align: center;
}

.detail-empty h2,
.detail-empty p {
    margin: 0;
}

.detail-empty p {
    margin-top: 8px;
    font-size: 0.82rem;
}

.deck-detail-actions {
    display: grid;
    grid-template-columns: 0.72fr 1fr 1fr;
    gap: 8px;
}

@media (max-width: 1180px) {
    .dashboard-shell {
        grid-template-rows: auto auto minmax(0, 1fr);
        overflow: auto;
    }

    .deck-builder-topbar {
        grid-template-columns: minmax(180px, 1fr);
    }

    .deck-builder-counters {
        grid-template-columns: repeat(4, minmax(68px, 1fr));
    }

    .deck-start-button {
        min-height: 64px;
    }

    .deck-builder-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .deck-detail-panel {
        display: none;
    }

    .deck-builder-main {
        min-height: 760px;
    }
}

@media (max-width: 760px) {
    .dashboard-shell {
        padding: 8px;
    }

    .deck-builder-counters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .deck-filter-row {
        grid-template-columns: 1fr;
    }

    .filter-block,
    .owned-count {
        flex-wrap: wrap;
    }

    .active-deck-slots {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .deck-slot {
        min-height: 190px;
    }
}

.game-shell {
    height: 100vh;
    min-width: 980px;
    display: grid;
    grid-template-columns: 260px minmax(520px, 1fr) 300px;
    grid-template-rows: 64px minmax(0, 1fr) 190px;
    background:
        linear-gradient(180deg, rgba(17, 32, 29, 0.94), rgba(5, 16, 22, 0.98)),
        #07131a;
}

.topbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 8px 14px 8px 18px;
    border-bottom: 1px solid rgba(88, 226, 210, 0.22);
    background: rgba(3, 11, 15, 0.92);
}

.brand-lockup {
    display: flex;
    align-items: center;
    min-width: 300px;
    gap: 14px;
}

.brand-lockup img {
    width: 118px;
    height: 48px;
    object-fit: contain;
}

.brand-lockup h1,
.brand-lockup p,
.side-panel h2,
.spawn-card h2,
.result-card h2,
.detail-panel h2 {
    margin: 0;
}

.brand-lockup h1 {
    font-size: 1.08rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.brand-lockup p {
    margin-top: 5px;
    color: #9cb4b1;
    font-size: 0.78rem;
}

.session-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    color: #c6d8d5;
    font-size: 0.88rem;
}

.session-strip span:not(.status-pill) {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.status-pill {
    padding: 7px 11px;
    background: rgba(236, 190, 72, 0.16);
    color: #f7d66a;
    border: 1px solid rgba(236, 190, 72, 0.34);
}

.top-actions,
.dock-actions,
.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-button,
.primary-action,
.page-button,
.icon-button {
    min-height: 36px;
    border: 1px solid rgba(122, 220, 207, 0.28);
    background: rgba(10, 33, 38, 0.92);
    color: #effdfa;
    padding: 0 13px;
}

.tool-button:hover:not(:disabled),
.primary-action:hover:not(:disabled),
.page-button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
    border-color: rgba(245, 213, 112, 0.65);
    background: rgba(28, 58, 52, 0.96);
}

.tool-button:disabled,
.primary-action:disabled,
.page-button:disabled,
.icon-button:disabled {
    color: #6f7c7d;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(45, 47, 50, 0.66);
}

.primary-action {
    background: rgba(16, 90, 77, 0.92);
    border-color: rgba(92, 218, 165, 0.5);
}

.primary-action.selected {
    background: rgba(170, 132, 40, 0.9);
    border-color: rgba(255, 218, 106, 0.72);
}

.danger {
    border-color: rgba(255, 107, 107, 0.36);
    color: #ffd0d0;
}

.side-panel {
    min-height: 0;
    overflow: auto;
    padding: 14px;
    background: rgba(6, 18, 22, 0.74);
}

.teams-panel {
    border-right: 1px solid rgba(88, 226, 210, 0.18);
}

.intel-panel {
    border-left: 1px solid rgba(88, 226, 210, 0.18);
}

.side-panel h2 {
    color: #f3fbf8;
    font-size: 0.92rem;
    line-height: 1.25;
    margin-bottom: 10px;
}

.team-card,
.event-log,
.detail-panel {
    margin-bottom: 12px;
    border: 1px solid rgba(120, 218, 210, 0.16);
    background: rgba(9, 26, 30, 0.86);
    padding: 12px;
}

.team-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
    min-width: 0;
}

.team-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-swatch {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.52);
}

dl {
    margin: 0;
}

.team-card dl,
.detail-panel dl,
.result-card dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
}

.team-card dl div,
.detail-panel dl div,
.result-card dl div {
    min-width: 0;
}

dt {
    color: #91aba8;
    font-size: 0.72rem;
}

dd {
    margin: 2px 0 0;
    color: #edf7f3;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.event-log p {
    margin: 0 0 8px;
    color: #b8c8c5;
    font-size: 0.8rem;
    line-height: 1.35;
}

.battlefield-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: 38px minmax(0, 1fr);
    background: #081017;
}

.battlefield-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 5px 10px;
    border-bottom: 1px solid rgba(88, 226, 210, 0.16);
    background: rgba(8, 20, 24, 0.86);
}

.icon-button {
    min-width: 42px;
    padding: 0 10px;
}

.selection-readout {
    min-width: 190px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    color: #f5cf61;
    font-size: 0.88rem;
}

.game-stage {
    position: relative;
    min-height: 0;
    overflow: hidden;
    outline: none;
    touch-action: none;
    user-select: none;
    background:
        linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25% 50%, rgba(255, 255, 255, 0.025) 50% 75%, transparent 75%) 0 0 / 32px 32px,
        #071117;
}

.world-layer {
    position: absolute;
    inset: 0;
    width: 2500px;
    height: 2200px;
    transform-origin: 0 0;
    will-change: transform;
}

.hex-tile {
    position: absolute;
    z-index: 1;
    width: 120px;
    height: 140px;
    padding: 0;
    border: 0;
    background-color: #3b4b42;
    background-position: center;
    background-size: cover;
    clip-path: polygon(50% 0%, 99% 25%, 99% 75%, 50% 100%, 1% 75%, 1% 25%);
    color: transparent;
    box-shadow: inset 0 0 0 2px rgba(13, 30, 32, 0.7);
}

.hex-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--owner-color);
    pointer-events: none;
}

.hex-selection-ring {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    overflow: visible;
    opacity: 0;
    pointer-events: none;
}

.hex-selection-ring polygon {
    fill: none;
    stroke: rgba(250, 216, 96, 0.96);
    stroke-width: 6;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 7px rgba(250, 216, 96, 0.56));
}

.hex-tile.pending .hex-selection-ring {
    opacity: 1;
}

.hex-tile.pending .hex-selection-ring polygon {
    stroke: rgba(91, 229, 215, 0.96);
    filter:
        drop-shadow(0 0 6px rgba(91, 229, 215, 0.48))
        drop-shadow(0 0 12px rgba(250, 216, 96, 0.34));
}

.hex-tile .hex-coordinate {
    position: relative;
    z-index: 4;
    opacity: 0;
    color: white;
    font-size: 12px;
}

.hex-tile:hover .hex-coordinate,
.hex-tile.pending .hex-coordinate,
.hex-tile.selected .hex-coordinate,
.hex-tile.reachable .hex-coordinate {
    opacity: 1;
}

.hex-tile.blocked {
    filter: saturate(0.6) brightness(0.68);
}

.hex-tile.valid-spawn,
.hex-tile.valid-deploy,
.hex-tile.valid-build,
.hex-tile.reachable {
    box-shadow:
        inset 0 0 0 4px rgba(118, 235, 153, 0.82),
        0 0 18px rgba(72, 216, 156, 0.22);
}

.hex-tile.valid-build {
    box-shadow:
        inset 0 0 0 4px rgba(240, 200, 76, 0.88),
        0 0 18px rgba(240, 200, 76, 0.2);
}

.hex-tile.pending {
    box-shadow:
        0 0 20px rgba(250, 216, 96, 0.22);
}

.structure-token {
    position: absolute;
    z-index: 4;
    width: 76px;
    height: 80px;
    transform: translate(-50%, -65%);
    pointer-events: none;
    display: grid;
    place-items: center;
}

.structure-token::before {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 28px;
    background: var(--team-color);
    border: 2px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.35);
}

.structure-token img {
    position: absolute;
    top: 0;
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.structure-token strong {
    position: relative;
    z-index: 1;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
}

.structure-mueang {
    width: 88px;
    height: 92px;
}

.unit-token {
    position: absolute;
    z-index: 5;
    width: 86px;
    height: 112px;
    padding: 0;
    border: 0;
    background: transparent;
    transform: translate(-50%, -75%);
}

.unit-token::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 15px;
    height: 14px;
    background: var(--team-color);
    border-radius: 50%;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.45);
}

.unit-token img {
    position: absolute;
    left: 50%;
    bottom: 16px;
    width: 80px;
    height: 86px;
    object-fit: contain;
    transform: translateX(-50%);
    filter: drop-shadow(0 9px 10px rgba(0, 0, 0, 0.44));
}

.unit-token.team-enemy img {
    filter: sepia(0.28) saturate(1.12) drop-shadow(0 9px 10px rgba(0, 0, 0, 0.44));
}

.unit-token.selected {
    outline: none;
}

.unit-state {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    max-width: 82px;
    padding: 2px 6px;
    background: rgba(3, 11, 15, 0.78);
    color: #d5e5e0;
    font-size: 0.58rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.activity-attack .unit-state {
    color: #ff9d7b;
}

.activity-move .unit-state {
    color: #75d8ff;
}

.health-bar {
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 54px;
    height: 7px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.health-bar::after {
    content: "";
    display: block;
    width: var(--health);
    height: 100%;
    background: linear-gradient(90deg, #6ee56e, #f6d45f);
}

.structure-token .health-bar {
    bottom: 0;
}

.spawn-card,
.result-card {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 10;
    width: min(500px, calc(100% - 34px));
    transform: translateX(-50%);
    border: 1px solid rgba(111, 226, 212, 0.32);
    background: rgba(5, 18, 22, 0.94);
    padding: 18px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
}

.spawn-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 16px;
    align-items: center;
}

.spawn-card h2,
.result-card h2 {
    color: #f5cf61;
    font-size: 1.05rem;
}

.spawn-card p {
    margin: 0;
    color: #bfcecb;
}

.spawn-card .primary-action {
    grid-row: 1 / span 2;
    grid-column: 2;
}

.result-card {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
}

.result-card h2 {
    margin-bottom: 14px;
    font-size: 1.4rem;
}

.result-card .primary-action {
    margin-top: 16px;
    width: 100%;
}

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.metric-grid div {
    padding: 10px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-grid span {
    display: block;
    color: #90a8a3;
    font-size: 0.72rem;
}

.metric-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 0.98rem;
    color: #f2fbf8;
}

.minimap {
    position: relative;
    width: 100%;
    height: 190px;
    margin-bottom: 14px;
    border: 1px solid rgba(111, 226, 212, 0.2);
    background: rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.minimap-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    padding: 0;
    border: 0;
    transform: translate(-50%, -50%);
}

.minimap-dot.blocked {
    filter: brightness(0.55);
}

.command-dock {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 290px 48px minmax(0, 1fr) 48px;
    gap: 12px;
    align-items: center;
    min-height: 0;
    padding: 14px;
    border-top: 1px solid rgba(88, 226, 210, 0.18);
    background: rgba(3, 12, 16, 0.94);
    touch-action: pan-x;
}

.dock-actions {
    align-items: stretch;
    flex-wrap: wrap;
}

.dock-actions .primary-action,
.dock-actions .tool-button {
    flex: 1 1 120px;
}

.unit-card-row {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 10px;
}

.unit-card {
    min-width: 0;
    height: 158px;
    display: grid;
    grid-template-rows: 70px 22px 20px 1fr;
    gap: 3px;
    padding: 8px;
    border: 1px solid rgba(95, 197, 210, 0.22);
    background: rgba(8, 27, 32, 0.92);
    color: #eef8f5;
    text-align: left;
}

.unit-card:hover,
.unit-card.selected {
    border-color: rgba(245, 213, 112, 0.72);
    background: rgba(22, 56, 52, 0.94);
}

.unit-card.unaffordable {
    background: rgba(42, 28, 31, 0.9);
    color: #c7b9b9;
}

.unit-card img {
    width: 100%;
    height: 70px;
    object-fit: contain;
}

.unit-card strong,
.unit-card span,
.unit-card small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unit-card strong {
    font-size: 0.76rem;
    text-transform: uppercase;
}

.unit-card span {
    color: #bfd1cd;
    font-size: 0.72rem;
}

.unit-card small {
    color: #f0ce72;
    font-size: 0.68rem;
}

.page-button {
    width: 48px;
    height: 48px;
    padding: 0;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.orientation-lock {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 8, 12, 0.96);
}

.orientation-lock-panel {
    width: min(360px, calc(100vw - 48px));
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 24px;
    border: 1px solid rgba(245, 213, 112, 0.38);
    background: rgba(8, 23, 28, 0.96);
    text-align: center;
}

.orientation-lock-panel h2,
.orientation-lock-panel p {
    margin: 0;
}

.orientation-lock-panel h2 {
    color: #f5cf61;
    font-size: 1.15rem;
}

.orientation-lock-panel p {
    color: #c6d8d5;
    font-size: 0.92rem;
}

.phone-rotate {
    width: 58px;
    height: 86px;
    border: 3px solid #edf7f3;
    border-radius: 12px;
    position: relative;
    transform: rotate(90deg);
}

.phone-rotate::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #edf7f3;
    transform: translateX(-50%);
}

.phone-rotate::after {
    content: "";
    position: absolute;
    left: -20px;
    top: -20px;
    width: 92px;
    height: 92px;
    border: 3px solid transparent;
    border-top-color: #f5cf61;
    border-right-color: #f5cf61;
    border-radius: 999px;
}

.orientation-blocked > :not(.orientation-lock) {
    filter: saturate(0.7) brightness(0.55);
    pointer-events: none;
}

.lobby-shell.device-mobile.orientation-landscape {
    padding:
        max(12px, env(safe-area-inset-top))
        max(14px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom))
        max(14px, env(safe-area-inset-left));
}

.lobby-shell.device-mobile.orientation-landscape .lobby-panel {
    width: min(620px, calc(100vw - 28px));
    padding: 16px;
}

.lobby-shell.device-mobile.orientation-landscape .lobby-brand {
    grid-template-columns: auto 1fr;
    align-items: center;
    margin-bottom: 12px;
}

.lobby-shell.device-mobile.orientation-landscape .lobby-brand img {
    width: 112px;
    height: 38px;
}

.lobby-shell.device-mobile.orientation-landscape .lobby-form {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 10px;
}

.lobby-shell.device-mobile.orientation-landscape .lobby-error {
    grid-column: 1 / -1;
}

.lobby-shell.device-mobile.orientation-portrait {
    padding: 16px;
}

.dashboard-shell.device-mobile {
    min-width: 0;
}

.dashboard-shell.device-mobile.orientation-landscape {
    grid-template-rows: 54px minmax(0, 1fr);
    gap: 6px;
    padding:
        max(5px, env(safe-area-inset-top))
        max(6px, env(safe-area-inset-right))
        max(5px, env(safe-area-inset-bottom))
        max(6px, env(safe-area-inset-left));
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-topbar {
    grid-template-columns: 120px minmax(0, 1fr) 150px;
    gap: 6px;
    padding: 5px;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-player {
    gap: 6px;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-player img {
    display: none;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-player h1 {
    font-size: 0.96rem;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-player p {
    margin-top: 3px;
    font-size: 0.58rem;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-player p span {
    display: none;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-counters {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
    gap: 4px;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-counters div:nth-child(n+6) {
    display: none;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-counters div {
    padding: 3px;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-counters span {
    font-size: 0.48rem;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-counters strong {
    font-size: 0.72rem;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-start-button strong {
    font-size: 0.86rem;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-start-button span {
    margin-top: 2px;
    font-size: 0.48rem;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-result-strip {
    display: none;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-detail-panel {
    display: none;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-builder-main {
    grid-template-rows: minmax(114px, 34%) minmax(0, 1fr);
    gap: 6px;
}

.dashboard-shell.device-mobile.orientation-landscape .active-deck-panel {
    padding: 7px 9px 8px;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-section-title {
    gap: 8px;
    margin-bottom: 5px;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-section-title h2 {
    font-size: 0.74rem;
}

.dashboard-shell.device-mobile.orientation-landscape .active-deck-slots {
    height: calc(100% - 20px);
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    gap: 5px;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-slot {
    max-height: none;
    padding: 3px;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-slot span {
    font-size: 0.46rem;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-slot small {
    display: none;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-library-panel {
    gap: 5px;
    padding: 6px;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-filter-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-filter-row::-webkit-scrollbar {
    display: none;
}

.dashboard-shell.device-mobile.orientation-landscape .filter-block,
.dashboard-shell.device-mobile.orientation-landscape .owned-count {
    flex: 0 0 auto;
    gap: 3px;
    padding: 3px;
}

.dashboard-shell.device-mobile.orientation-landscape .filter-block > span,
.dashboard-shell.device-mobile.orientation-landscape .owned-count span {
    display: none;
}

.dashboard-shell.device-mobile.orientation-landscape .deck-filter-button {
    min-height: 24px;
    min-width: 36px;
    padding: 0 6px;
    font-size: 0.54rem;
}

.dashboard-shell.device-mobile.orientation-landscape .owned-count {
    min-width: 58px;
}

.dashboard-shell.device-mobile.orientation-landscape .owned-count strong {
    font-size: 0.62rem;
}

.dashboard-shell.device-mobile.orientation-landscape .dashboard-error {
    font-size: 0.62rem;
}

.dashboard-shell.device-mobile.orientation-landscape .card-library {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    grid-auto-rows: minmax(104px, auto);
    gap: 5px;
    padding: 0 2px 0 0;
    -webkit-overflow-scrolling: touch;
}

.dashboard-shell.device-mobile.orientation-landscape .dashboard-card {
    gap: 2px;
    padding: 3px;
}

.dashboard-shell.device-mobile.orientation-landscape .dashboard-card-main img {
    height: 72px;
}

.dashboard-shell.device-mobile.orientation-landscape .card-pick-state {
    padding: 1px 3px;
    font-size: 0.42rem;
}

.dashboard-shell.device-mobile.orientation-landscape .dashboard-card-title strong {
    font-size: 0.48rem;
}

.dashboard-shell.device-mobile.orientation-landscape .dashboard-card-title span,
.dashboard-shell.device-mobile.orientation-landscape .dashboard-card-stats span,
.dashboard-shell.device-mobile.orientation-landscape .dashboard-card-costs span {
    font-size: 0.42rem;
}

.dashboard-shell.device-mobile.orientation-landscape .dashboard-card-stats,
.dashboard-shell.device-mobile.orientation-landscape .dashboard-card-costs {
    gap: 2px;
}

.dashboard-shell.device-mobile.orientation-landscape .dashboard-card-stats span,
.dashboard-shell.device-mobile.orientation-landscape .dashboard-card-costs span {
    padding: 1px 2px;
}

.dashboard-shell.device-mobile.orientation-landscape .locked-card {
    min-height: 104px;
}

.dashboard-shell.device-mobile.orientation-landscape .locked-card-mark {
    width: 42px;
    height: 42px;
    font-size: 0.48rem;
}

.game-shell.device-mobile {
    min-width: 0;
    height: 100dvh;
    min-height: 100svh;
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr);
}

.game-shell.device-mobile .teams-panel,
.game-shell.device-mobile .intel-panel {
    display: none;
}

.game-shell.device-mobile .brand-lockup img,
.game-shell.device-mobile .brand-lockup p,
.game-shell.device-mobile .session-strip {
    display: none;
}

.game-shell.device-mobile .brand-lockup {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0;
}

.game-shell.device-mobile .brand-lockup h1 {
    overflow: hidden;
    font-size: 0.98rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-shell.device-mobile.orientation-landscape {
    grid-template-rows: 46px minmax(0, 1fr) 126px;
}

.game-shell.device-mobile.orientation-landscape .topbar {
    grid-row: 1;
    gap: 8px;
    padding:
        max(5px, env(safe-area-inset-top))
        max(8px, env(safe-area-inset-right))
        5px
        max(8px, env(safe-area-inset-left));
}

.game-shell.device-mobile.orientation-landscape .top-actions {
    flex: 0 0 auto;
    gap: 6px;
}

.game-shell.device-mobile.orientation-landscape .tool-button,
.game-shell.device-mobile.orientation-landscape .primary-action,
.game-shell.device-mobile.orientation-landscape .page-button,
.game-shell.device-mobile.orientation-landscape .icon-button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.76rem;
}

.game-shell.device-mobile.orientation-landscape .battlefield-panel {
    grid-row: 2;
    grid-template-rows: 38px minmax(0, 1fr);
    min-height: 0;
}

.game-shell.device-mobile.orientation-landscape .battlefield-toolbar {
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 3px 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.game-shell.device-mobile.orientation-landscape .battlefield-toolbar::-webkit-scrollbar,
.game-shell.device-mobile.orientation-landscape .unit-card-row::-webkit-scrollbar {
    display: none;
}

.game-shell.device-mobile.orientation-landscape .toolbar-group {
    flex: 0 0 auto;
    gap: 5px;
}

.game-shell.device-mobile.orientation-landscape .icon-button {
    min-width: 36px;
}

.game-shell.device-mobile.orientation-landscape .selection-readout {
    flex: 0 0 138px;
    min-width: 138px;
    max-width: 138px;
    text-align: left;
    font-size: 0.74rem;
}

.game-shell.device-mobile.orientation-landscape .command-dock {
    grid-row: 3;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    grid-template-rows: 34px minmax(0, 1fr);
    gap: 6px;
    align-items: stretch;
    padding:
        6px
        max(8px, env(safe-area-inset-right))
        max(6px, env(safe-area-inset-bottom))
        max(8px, env(safe-area-inset-left));
}

.game-shell.device-mobile.orientation-landscape .dock-actions {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
}

.game-shell.device-mobile.orientation-landscape .dock-actions .primary-action,
.game-shell.device-mobile.orientation-landscape .dock-actions .tool-button {
    min-width: 0;
    padding: 0 5px;
    font-size: 0.68rem;
}

.game-shell.device-mobile.orientation-landscape .page-button {
    grid-row: 2;
    width: 40px;
    height: 100%;
    padding: 0;
}

.game-shell.device-mobile.orientation-landscape .command-dock > .page-button:first-of-type {
    grid-column: 1;
}

.game-shell.device-mobile.orientation-landscape .command-dock > .page-button:last-of-type {
    grid-column: 3;
}

.game-shell.device-mobile.orientation-landscape .unit-card-row {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    min-width: 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.game-shell.device-mobile.orientation-landscape .unit-card {
    flex: 0 0 112px;
    width: 112px;
    height: 78px;
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-rows: 17px 15px 1fr;
    column-gap: 6px;
    row-gap: 1px;
    padding: 5px;
    scroll-snap-align: start;
}

.game-shell.device-mobile.orientation-landscape .unit-card img {
    grid-row: 1 / -1;
    grid-column: 1;
    width: 36px;
    height: 66px;
}

.game-shell.device-mobile.orientation-landscape .unit-card strong,
.game-shell.device-mobile.orientation-landscape .unit-card span,
.game-shell.device-mobile.orientation-landscape .unit-card small {
    grid-column: 2;
}

.game-shell.device-mobile.orientation-landscape .unit-card strong {
    font-size: 0.58rem;
}

.game-shell.device-mobile.orientation-landscape .unit-card span {
    font-size: 0.56rem;
}

.game-shell.device-mobile.orientation-landscape .unit-card small {
    font-size: 0.5rem;
}

.game-shell.device-mobile.orientation-landscape .spawn-card {
    bottom: 8px;
    width: min(390px, calc(100% - 18px));
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 10px;
}

.game-shell.device-mobile.orientation-landscape .spawn-card h2 {
    font-size: 0.92rem;
}

.game-shell.device-mobile.orientation-landscape .spawn-card p {
    font-size: 0.76rem;
}

.game-shell.device-mobile.orientation-landscape .spawn-card .primary-action {
    grid-row: 1 / span 2;
    grid-column: 2;
    width: auto;
}

@media (max-width: 1100px) {
    body {
        overflow: auto;
    }

    .game-shell {
        min-width: 0;
        height: auto;
        min-height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: 64px 56vh auto auto auto;
    }

    .topbar {
        gap: 10px;
    }

    .brand-lockup {
        min-width: 170px;
    }

    .brand-lockup img {
        display: none;
    }

    .session-strip span:not(.status-pill) {
        display: none;
    }

    .teams-panel,
    .intel-panel {
        border: 0;
    }

    .battlefield-panel {
        grid-row: 2;
    }

    .teams-panel {
        grid-row: 3;
    }

    .intel-panel {
        grid-row: 4;
    }

    .command-dock {
        grid-row: 5;
        grid-template-columns: 1fr;
    }

    .unit-card-row {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .page-button {
        width: 100%;
    }
}

@media (max-width: 900px) {
    body {
        overflow: hidden;
    }

    .game-shell {
        height: 100dvh;
        min-height: 100svh;
        overflow: hidden;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 58px minmax(0, 1fr) 184px;
    }

    .topbar {
        grid-row: 1;
        align-items: center;
        gap: 8px;
        padding:
            max(6px, env(safe-area-inset-top))
            max(8px, env(safe-area-inset-right))
            6px
            max(8px, env(safe-area-inset-left));
    }

    .brand-lockup {
        flex: 1 1 auto;
        min-width: 0;
        gap: 0;
    }

    .brand-lockup img,
    .brand-lockup p,
    .session-strip {
        display: none;
    }

    .brand-lockup h1 {
        overflow: hidden;
        font-size: 0.98rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .top-actions {
        flex: 0 0 auto;
        gap: 6px;
    }

    .tool-button,
    .primary-action,
    .page-button,
    .icon-button {
        min-height: 40px;
        padding: 0 10px;
        font-size: 0.82rem;
    }

    .battlefield-panel {
        grid-row: 2;
        grid-template-rows: 44px minmax(0, 1fr);
        min-height: 0;
    }

    .battlefield-toolbar {
        gap: 8px;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 4px 8px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .battlefield-toolbar::-webkit-scrollbar {
        display: none;
    }

    .toolbar-group {
        flex: 0 0 auto;
        gap: 6px;
    }

    .icon-button {
        min-width: 40px;
    }

    .selection-readout {
        flex: 0 0 148px;
        min-width: 148px;
        max-width: 148px;
        text-align: left;
        font-size: 0.78rem;
    }

    .teams-panel,
    .intel-panel {
        display: none;
    }

    .command-dock {
        grid-row: 3;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        grid-template-rows: 42px minmax(0, 1fr);
        gap: 8px;
        align-items: stretch;
        padding:
            8px
            max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left));
    }

    .dock-actions {
        grid-column: 1 / -1;
        grid-row: 1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        align-items: stretch;
    }

    .dock-actions .primary-action,
    .dock-actions .tool-button {
        min-width: 0;
        padding: 0 6px;
        font-size: 0.72rem;
    }

    .page-button {
        grid-row: 2;
        width: 44px;
        height: 100%;
        padding: 0;
    }

    .command-dock > .page-button:first-of-type {
        grid-column: 1;
    }

    .command-dock > .page-button:last-of-type {
        grid-column: 3;
    }

    .unit-card-row {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        min-width: 0;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .unit-card-row::-webkit-scrollbar {
        display: none;
    }

    .unit-card {
        flex: 0 0 132px;
        width: 132px;
        height: 118px;
        grid-template-rows: 46px 17px 15px 1fr;
        gap: 2px;
        padding: 6px;
        scroll-snap-align: start;
    }

    .unit-card img {
        height: 46px;
    }

    .unit-card strong {
        font-size: 0.68rem;
    }

    .unit-card span {
        font-size: 0.66rem;
    }

    .unit-card small {
        font-size: 0.58rem;
    }

    .spawn-card {
        bottom: 10px;
        width: calc(100% - 18px);
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }

    .spawn-card .primary-action {
        grid-row: auto;
        grid-column: 1;
        width: 100%;
    }

    .result-card {
        width: calc(100% - 18px);
        max-height: calc(100% - 24px);
        overflow: auto;
        padding: 14px;
    }
}

@media (max-width: 430px) {
    .game-shell {
        grid-template-rows: 56px minmax(0, 1fr) 176px;
    }

    .top-actions .tool-button {
        padding: 0 8px;
    }

    .battlefield-toolbar {
        padding-inline: 6px;
    }

    .icon-button {
        min-width: 38px;
        padding: 0 8px;
    }

    .selection-readout {
        flex-basis: 126px;
        min-width: 126px;
        max-width: 126px;
    }

    .unit-card {
        flex-basis: 124px;
        width: 124px;
    }
}

.fullscreen-help {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 8, 12, 0.68);
}

.fullscreen-help-panel {
    width: min(360px, calc(100vw - 32px));
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(245, 213, 112, 0.38);
    background: rgba(7, 21, 26, 0.98);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
}

.fullscreen-help-panel h2,
.fullscreen-help-panel p {
    margin: 0;
}

.fullscreen-help-panel h2 {
    color: #f5cf61;
    font-size: 1rem;
}

.fullscreen-help-panel p {
    color: #d7e4e0;
    font-size: 0.84rem;
    line-height: 1.4;
}

.game-shell.device-mobile.orientation-landscape {
    position: relative;
    height: 100dvh;
    min-height: -webkit-fill-available;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 92px;
    min-width: 0;
}

.game-shell.device-mobile.orientation-landscape.phase-spawnselection {
    grid-template-rows: minmax(0, 1fr);
}

.game-shell.device-mobile.orientation-landscape .topbar {
    position: absolute;
    z-index: 32;
    top: max(5px, env(safe-area-inset-top));
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    height: 34px;
    display: flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(122, 220, 207, 0.18);
    background: rgba(3, 11, 15, 0.72);
    backdrop-filter: blur(8px);
}

.game-shell.device-mobile.orientation-landscape .brand-lockup {
    display: none;
}

.game-shell.device-mobile.orientation-landscape .session-strip {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-start;
    gap: 5px;
    overflow: hidden;
    font-size: 0.66rem;
}

.game-shell.device-mobile.orientation-landscape .session-strip span {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    white-space: nowrap;
}

.game-shell.device-mobile.orientation-landscape .session-strip span:not(.status-pill) {
    display: none;
}

.game-shell.device-mobile.orientation-landscape .session-strip span:last-child {
    display: inline-flex;
}

.game-shell.device-mobile.orientation-landscape .status-pill {
    padding: 0 7px;
}

.game-shell.device-mobile.orientation-landscape .top-actions {
    flex: 0 0 auto;
    gap: 4px;
}

.game-shell.device-mobile.orientation-landscape .tool-button,
.game-shell.device-mobile.orientation-landscape .primary-action,
.game-shell.device-mobile.orientation-landscape .page-button,
.game-shell.device-mobile.orientation-landscape .icon-button {
    min-height: 26px;
    padding: 0 8px;
    font-size: 0.68rem;
}

.game-shell.device-mobile.orientation-landscape .battlefield-panel {
    grid-row: 1;
    position: relative;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
}

.game-shell.device-mobile.orientation-landscape .battlefield-toolbar {
    position: absolute;
    z-index: 31;
    left: max(6px, env(safe-area-inset-left));
    bottom: 8px;
    width: auto;
    max-width: min(460px, calc(100% - 12px));
    display: flex;
    justify-content: flex-start;
    gap: 5px;
    padding: 4px;
    border: 1px solid rgba(122, 220, 207, 0.16);
    background: rgba(3, 11, 15, 0.58);
    backdrop-filter: blur(7px);
}

.game-shell.device-mobile.orientation-landscape.phase-playing .battlefield-toolbar,
.game-shell.device-mobile.orientation-landscape.phase-gameover .battlefield-toolbar {
    bottom: 100px;
}

.game-shell.device-mobile.orientation-landscape .toolbar-group:first-child {
    display: none;
}

.game-shell.device-mobile.orientation-landscape .toolbar-group {
    gap: 4px;
}

.game-shell.device-mobile.orientation-landscape .icon-button {
    min-width: 30px;
}

.game-shell.device-mobile.orientation-landscape .selection-readout {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 160px;
    padding: 0 5px;
    text-align: left;
    font-size: 0.68rem;
}

.game-shell.device-mobile.orientation-landscape .game-stage {
    grid-row: 1;
    min-height: 0;
}

.game-shell.device-mobile.orientation-landscape .command-dock {
    grid-row: 2;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    grid-template-rows: 24px 58px;
    gap: 4px;
    padding:
        4px
        max(6px, env(safe-area-inset-right))
        max(4px, env(safe-area-inset-bottom))
        max(6px, env(safe-area-inset-left));
    min-height: 0;
    background: rgba(3, 12, 16, 0.86);
    backdrop-filter: blur(8px);
}

.game-shell.device-mobile.orientation-landscape.phase-spawnselection .command-dock {
    display: none;
}

.game-shell.device-mobile.orientation-landscape .dock-actions {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.game-shell.device-mobile.orientation-landscape .dock-actions .primary-action,
.game-shell.device-mobile.orientation-landscape .dock-actions .tool-button {
    min-height: 22px;
    padding: 0 4px;
    font-size: 0.56rem;
}

.game-shell.device-mobile.orientation-landscape .page-button {
    grid-row: 2;
    width: 34px;
    height: 58px;
    padding: 0;
}

.game-shell.device-mobile.orientation-landscape .unit-card-row {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    min-width: 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.game-shell.device-mobile.orientation-landscape .unit-card-row::-webkit-scrollbar {
    display: none;
}

.game-shell.device-mobile.orientation-landscape .unit-card {
    flex: 0 0 108px;
    width: 108px;
    height: 58px;
    grid-template-columns: 30px minmax(0, 1fr);
    grid-template-rows: 15px 13px 1fr;
    column-gap: 5px;
    row-gap: 0;
    padding: 4px;
}

.game-shell.device-mobile.orientation-landscape .unit-card img {
    grid-row: 1 / -1;
    grid-column: 1;
    width: 30px;
    height: 50px;
}

.game-shell.device-mobile.orientation-landscape .unit-card strong,
.game-shell.device-mobile.orientation-landscape .unit-card span,
.game-shell.device-mobile.orientation-landscape .unit-card small {
    grid-column: 2;
}

.game-shell.device-mobile.orientation-landscape .unit-card strong {
    font-size: 0.54rem;
}

.game-shell.device-mobile.orientation-landscape .unit-card span {
    font-size: 0.52rem;
}

.game-shell.device-mobile.orientation-landscape .unit-card small {
    font-size: 0.48rem;
}

.game-shell.device-mobile.orientation-landscape .spawn-card {
    left: 50%;
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: min(340px, calc(100% - 16px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(5, 18, 22, 0.82);
    backdrop-filter: blur(8px);
}

.game-shell.device-mobile.orientation-landscape .spawn-card h2 {
    font-size: 0.8rem;
}

.game-shell.device-mobile.orientation-landscape .spawn-card p {
    font-size: 0.66rem;
}

.game-shell.device-mobile.orientation-landscape .spawn-card .primary-action {
    grid-row: 1 / span 2;
    grid-column: 2;
    min-width: 78px;
}

.game-shell.device-mobile.orientation-landscape .result-card {
    width: min(360px, calc(100% - 16px));
    max-height: calc(100% - 24px);
    overflow: auto;
    padding: 12px;
}

@media (max-width: 1100px) and (orientation: landscape) {
    body {
        overflow: hidden;
    }
}
