:root {
    --game-bg: #0e1c34;
    --game-panel: rgba(34, 51, 86, 0.66);
    --game-panel-border: rgba(120, 136, 164, 0.28);
    --game-grid: rgba(120, 136, 164, 0.42);
    --game-grid-soft: rgba(120, 136, 164, 0.24);
    --game-text: #f0f5ff;
    --game-muted: #c2cbe0;
    --game-primary: #9cf1ff;
    --game-primary-strong: #39e9ff;
    --game-primary-glow: rgba(57, 233, 255, 0.32);
    --game-secondary: #ff8f95;
    --game-secondary-glow: rgba(255, 143, 149, 0.3);
    --game-surface: #091325;
    --game-surface-elevated: rgba(18, 33, 64, 0.94);
    --game-cell-size: 2.4vw;
    --game-cell-gap: 0.45rem;
    --game-cell-radius: 0.22rem;
    --game-player-cell-size: clamp(26px, 4.4vw, 48px);
    --game-player-cell-gap: 0.45rem;
}

html,
body {
    min-height: 100%;
    background: var(--game-bg);
}

body {
    color: var(--game-text);
}


/*sidebar start*/
.sidebar-shell {
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
        var(--game-surface-elevated);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-nav__link {
    position: relative;
    overflow: hidden;
    border-right: 4px solid transparent;
    color: rgba(222, 229, 255, 0.4);
    background: transparent;
    transform: translateX(0);
    transition:
        color 0.22s ease,
        background-color 0.22s ease,
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.sidebar-nav__link::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(90deg, rgba(156, 241, 255, 0.16), rgba(156, 241, 255, 0.03));
    transform: translateX(-12px);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
}

.sidebar-nav__icon,
.sidebar-nav__label {
    position: relative;
    z-index: 1;
    transition:
        transform 0.22s ease,
        color 0.22s ease,
        text-shadow 0.22s ease;
}

.sidebar-nav__link:hover,
.sidebar-nav__link:focus-visible {
    color: rgba(156, 241, 255, 0.94);
    background: rgba(0, 229, 255, 0.07);
    box-shadow: inset 0 0 0 1px rgba(156, 241, 255, 0.08), 0 8px 18px rgba(0, 0, 0, 0.12);
    transform: translateX(4px);
}

.sidebar-nav__link:hover::before,
.sidebar-nav__link:focus-visible::before {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-nav__link:hover .sidebar-nav__icon,
.sidebar-nav__link:focus-visible .sidebar-nav__icon {
    transform: translateX(2px) scale(1.05);
    color: var(--game-primary);
    text-shadow: 0 0 10px rgba(57, 233, 255, 0.3);
}

.sidebar-nav__link:hover .sidebar-nav__label,
.sidebar-nav__link:focus-visible .sidebar-nav__label {
    transform: translateX(2px);
    text-shadow: 0 0 10px rgba(57, 233, 255, 0.18);
}

.sidebar-nav__link:focus-visible {
    outline: none;
}

.sidebar-nav__link--active {
    border-right-color: #00E5FF;
    background: rgba(0, 229, 255, 0.1);
    color: #00E5FF;
}

.sidebar-nav__link--active::before {
    opacity: 1;
    transform: translateX(0);
    background: linear-gradient(90deg, rgba(156, 241, 255, 0.12), rgba(156, 241, 255, 0.02));
}

.sidebar-nav__link--active .sidebar-nav__icon,
.sidebar-nav__link--active .sidebar-nav__label {
    text-shadow: 0 0 10px rgba(57, 233, 255, 0.18);
}
/*sidebar end*/


/*mobile menu start*/
body.mobile-menu-open {
    overflow: hidden;
}

.mobile-menu[hidden] {
    display: none;
}

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 70;
}

.mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 14, 32, 0.72);
    backdrop-filter: blur(10px);
}

.mobile-menu__drawer {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: min(86vw, 22rem);
    height: 100%;
    overflow-y: auto;
    padding: 1.25rem 1rem 2rem;
    border-right: 1px solid rgba(120, 136, 164, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
        var(--game-surface-elevated);
    box-shadow:
        12px 0 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transform: translateX(0);
}

.mobile-menu__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 4.25rem 0.75rem 1.5rem;
}

.mobile-menu__eyebrow {
    margin: 0 0 0.35rem;
    color: var(--game-muted);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.mobile-menu__title {
    margin: 0;
    color: var(--game-text);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mobile-menu__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--game-panel-border);
    border-radius: 999px;
    background: rgba(156, 241, 255, 0.08);
    color: var(--game-primary);
}

@media (min-width: 1024px) {
    .mobile-menu {
        display: none !important;
    }
}
/*mobile menu end*/


/*modal start*/
body.settings-modal-open {
    overflow: hidden;
}

body.game-over-modal-open {
    overflow: hidden;
}

.settings-modal[hidden] {
    display: none;
}

.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.settings-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 14, 32, 0.72);
    backdrop-filter: blur(12px);
}

.settings-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 28rem);
    border: 1px solid var(--game-panel-border);
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
        var(--game-surface-elevated);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 1.5rem;
}

.settings-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.settings-modal__eyebrow {
    margin: 0 0 0.35rem;
    color: var(--game-muted);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.settings-modal__title {
    margin: 0;
    color: var(--game-text);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.settings-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--game-panel-border);
    border-radius: 999px;
    background: rgba(156, 241, 255, 0.08);
    color: var(--game-primary);
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.settings-modal__close:hover {
    background: rgba(156, 241, 255, 0.16);
    color: var(--game-text);
    transform: translateY(-1px);
}

.settings-modal__content {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.settings-modal__group {
    margin: 0;
    padding: 0;
    border: none;
}

.settings-modal__group-title {
    margin: 0 0 0.65rem;
    color: var(--game-muted);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.settings-modal__difficulty-grid {
    display: grid;
    gap: 0.75rem;
}

.settings-modal__option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--game-panel-border);
    border-radius: 0.85rem;
    background: rgba(28, 45, 78, 0.62);
    color: var(--game-text);
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.settings-modal__option--toggle {
    justify-content: space-between;
}

.settings-modal__option--radio {
    justify-content: space-between;
}

.settings-modal__option-info {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-modal__option-icon {
    color: var(--game-primary);
    font-size: 1.15rem;
}

.settings-modal__option input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--game-primary-strong);
}

.game-over-modal__dialog {
    width: min(100%, 30rem);
}

.game-over-modal__content {
    gap: 1.25rem;
}

.game-over-modal__message {
    margin: 0;
    padding: 1rem 1.1rem;
    border: 1px solid var(--game-panel-border);
    border-radius: 0.9rem;
    background: rgba(28, 45, 78, 0.62);
    color: var(--game-text);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.5;
}

.game-over-modal[data-result="victory"] .game-over-modal__message {
    border-color: rgba(156, 241, 255, 0.3);
    color: var(--game-primary);
    box-shadow: inset 0 0 16px rgba(57, 233, 255, 0.08);
}

.game-over-modal[data-result="defeat"] .game-over-modal__message {
    border-color: rgba(255, 143, 149, 0.3);
    color: var(--game-secondary);
    box-shadow: inset 0 0 16px rgba(255, 143, 149, 0.08);
}

.game-over-modal__actions {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.game-over-modal__actions .game-action-button {
    flex: 1 1 10rem;
    max-width: none;
}
/*modal end*/


/* button start */
.game-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 20rem;
    min-height: 3.5rem;
    max-height: 3.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--game-primary-strong);
    color: #003840;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(0, 227, 253, 0.15);
    transition:
            background-color 0.3s ease,
            transform 0.3s ease,
            box-shadow 0.3s ease,
            opacity 0.3s ease;
}

.game-action-button:hover {
    background: var(--game-primary);
    transform: translateY(-1px);
}

.game-action-button:disabled {
    opacity: 0.75;
    cursor: default;
    transform: none;
}

.game-action-button--full {
    max-width: none;
}
/* button end */


.game-shell {
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(57, 233, 255, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(156, 241, 255, 0.08), transparent 32%),
        var(--game-bg);
}

.game-panel {
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.game-table-wrap {
    position: relative;
    overflow-x: auto;
    padding: 0.15rem;
}

.game-table-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.08;
    background: linear-gradient(180deg, rgba(156, 241, 255, 0.05), transparent 28%);
}

.game-table-wrap--compact {
    padding: 0;
}

.game-field {
    width: max-content;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    user-select: none;
    contain: layout paint style;
}

.game-field__header,
.game-field__row {
    display: flex;
    align-items: center;
    gap: var(--game-cell-gap);
}

.game-field__header {
    margin-bottom: var(--game-cell-gap);
}

.game-field__body {
    display: flex;
    flex-direction: column;
    gap: var(--game-cell-gap);
}

.game-field__corner,
.game-field__label,
.game-field__cell {
    width: var(--game-cell-size);
    height: var(--game-cell-size);
    min-width: var(--game-cell-size);
    min-height: var(--game-cell-size);
    box-sizing: border-box;
    border-radius: var(--game-cell-radius);
}

.game-field__label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.game-field__corner,
.game-field__label {
    border: none;
    background: transparent;
    color: var(--game-muted);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    line-height: 1;
    text-transform: uppercase;
}

.game-field__label--column {
    padding-top: 0.1rem;
}

.game-field__cell {
    --cell-background: rgba(18, 32, 60, 0.92);
    --cell-border-color: var(--game-grid-soft);
    --cell-box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--cell-border-color);
    background: var(--cell-background);
    box-shadow: var(--cell-box-shadow);
    transition:
        transform 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.game-field--opponent .game-field__cell:hover {
    transform: translateY(-1px);
    --cell-border-color: rgba(156, 241, 255, 0.48);
    --cell-background: rgba(24, 42, 74, 0.96);
}

.game-field__cell.ship {
    --cell-background: rgba(40, 74, 102, 0.96);
    --cell-border-color: rgba(156, 241, 255, 0.54);
    --cell-box-shadow: inset 0 0 10px rgba(156, 241, 255, 0.2);
}

.game-field__cell.shot {

}

.game-field__cell.shot::after,
.game-field__cell.pending-shot::after {
    content: '';
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
}

.game-field__cell.shot::after {
    width: 0.4rem;
    height: 0.4rem;
    background: rgba(255, 143, 149, 0.95);
    box-shadow: 0 0 6px rgba(255, 143, 149, 0.38);
}

#player-field .game-field__cell.shot::after {
    width: 0.25rem;
    height: 0.25rem;
}

.game-field__cell.ship.shot,
.game-field__cell.hit,
.game-field__cell.hit:hover{
    --cell-background: rgba(74, 34, 42, 0.96);
    /*--cell-background: rgba(22, 52, 68, 0.96);*/
    --cell-border-color: rgba(255, 143, 149, 0.42);
    --cell-box-shadow: inset 0 0 10px rgba(255, 143, 149, 0.18);

    /*--cell-background: rgba(40, 74, 102, 0.96);*/
    /*--cell-border-color: rgba(156, 241, 255, 0.54);*/
}

.game-field__cell.ship.shot::after,
.game-field__cell.shot.hit::after {
    content: none;
}

.game-field__cell.pending-shot {
    --cell-background: rgba(22, 52, 68, 0.96);
    --cell-border-color: rgba(57, 233, 255, 0.68);
    --cell-box-shadow: inset 0 0 12px rgba(57, 233, 255, 0.2);
}

.game-field__cell.pending-shot::after {
    width: 14px;
    height: 14px;
    border: 2px solid var(--game-primary-strong);
    border-top-color: transparent;
    box-sizing: border-box;
    animation: pending-shot-spin 0.8s linear infinite;
}

.game-field.field-disabled {
    opacity: 0.84;
}

.game-field .game-field__cell:hover {
    cursor: pointer;
}

.game-field.field-disabled .game-field__cell:hover {
    cursor: not-allowed;
}

.game-field.field-disabled .game-field__cell:hover {
    transform: none;
    border-color: var(--game-grid-soft);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.015),
        0 0 0 1px rgba(0, 0, 0, 0.08);
}

@media (min-width: 1280px) {
    #main-wrap {
        align-items: stretch;
        height: auto;
    }

    #main-wrap > div {
        height: 100%;
    }

    #secondary-wrap {
        min-height: 0;
    }

    #command-log-wrap {
        flex: 1 1 auto;
        min-height: 0;
    }

    #history {
        flex: 1 1 auto;
        min-height: 15rem;
    }
}

/* command log start */
#history {
    display: block;
    background: var(--game-panel);
    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 12px 28px rgba(0, 0, 0, 0.14);
}

#history-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--game-text);
}

#history-content > .history-entry {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0 0.4rem 0.85rem;
    border-left: 1px solid rgba(120, 136, 164, 0.36);
    color: rgba(240, 245, 255, 0.86);
}

#history-content > .history-entry::before {
    content: '';
    position: absolute;
    top: 0.8rem;
    left: -0.28rem;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 999px;
    background: rgba(194, 203, 224, 0.58);
}

#history-content > .history-entry:first-child {
    color: var(--game-primary);
}

#history-content > .history-entry:first-child::before {
    background: var(--game-primary-strong);
    box-shadow: 0 0 6px rgba(57, 233, 255, 0.34);
}

.history-entry__start,
.history-entry__result {
    display: block;
    min-width: 50px;
}

.history-entry__start {
    flex: 1 1 auto;
}

.history-entry__result {
    flex: 0 0 auto;
    text-align: right;
    color: rgba(156, 241, 255, 0.94);
    white-space: normal;
    word-break: break-word;
}
/* command log end */


/* status card start */
.status-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--game-panel-border);
    border-radius: 0.55rem;
    background: rgba(28, 45, 78, 0.62);
}

.status-card__header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--game-muted);
}

.status-card__bar {
    height: 4px;
    width: 100%;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(42, 60, 96, 1);
}

.status-card__fill {
    height: 100%;
    transition:
        width 0.3s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

#player-ships-remaining-value,
#opponent-ships-remaining-value {
    transition:
        color 0.2s ease,
        text-shadow 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

#player-ships-remaining-value[data-fleet-level="normal"] {
    color: var(--game-primary);
}

#opponent-ships-remaining-value[data-fleet-level="normal"] {
    color: var(--game-secondary);
}

#player-ships-remaining-bar[data-fleet-level="normal"] {
    background: var(--game-primary);
    box-shadow: 0 0 5px rgba(57, 233, 255, 0.3);
}

#opponent-ships-remaining-bar[data-fleet-level="normal"] {
    background: var(--game-secondary);
    box-shadow: 0 0 5px rgba(255, 143, 149, 0.3);
}

#player-ships-remaining-value[data-fleet-level="warning"],
#opponent-ships-remaining-value[data-fleet-level="warning"] {
    color: #ffd88f;
    text-shadow: 0 0 8px rgba(255, 216, 143, 0.2);
}

#player-ships-remaining-bar[data-fleet-level="warning"],
#opponent-ships-remaining-bar[data-fleet-level="warning"] {
    background: #ffd88f;
    box-shadow: 0 0 6px rgba(255, 216, 143, 0.26);
}

#player-ships-remaining-value[data-fleet-level="critical"] {
    color: var(--game-secondary);
    text-shadow: 0 0 8px rgba(255, 143, 149, 0.22);
}

#opponent-ships-remaining-value[data-fleet-level="critical"] {
    color: var(--game-primary);
}

#player-ships-remaining-bar[data-fleet-level="critical"] {
    background: var(--game-secondary);
    box-shadow: 0 0 6px rgba(255, 143, 149, 0.28);
}

#opponent-ships-remaining-bar[data-fleet-level="critical"] {
    background: var(--game-primary);
    box-shadow: 0 0 6px rgba(57, 233, 255, 0.28);

}

.fleet-indicator--updated {
    animation: fleet-indicator-flash 0.65s ease;
}

.status-card__fill.fleet-indicator--updated {
    transform-origin: left center;
}

.status-card__fill--primary {
    width: 100%;
    background: var(--game-primary);
    box-shadow: 0 0 5px rgba(57, 233, 255, 0.3);
}

.status-card__fill--secondary {
    background: var(--game-secondary);
    box-shadow: 0 0 5px rgba(255, 143, 149, 0.3);
}

.status-card__fill--75 {
    width: 75%;
}

.status-card__fill--50 {
    width: 50%;
}
/* status card end */

/* player field start */
#player-field {
    --game-cell-size: 1vw;
    --game-cell-gap: 0.16rem;
}

#player-field .game-field__label {
    font-size: 8px;
    letter-spacing: 0.1em;
}

#player-field .game-field__header {
    display: none;
}

#player-field .game-field__label--row {
    display: none;
}
/* player field end */

@keyframes pending-shot-spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes fleet-indicator-flash {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    35% {
        opacity: 0.88;
        transform: scale(1.06);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 1024px) {
    :root {
        --game-cell-size: clamp(24px, 5vw, 40px);
        --game-cell-gap: 0.32rem;
    }
}

@media (max-width: 767px) and (orientation: portrait) {
    :root {
        --game-cell-size: clamp(20px, 7vw, 30px);
        --game-cell-gap: 0.22rem;
    }

    header.fixed {
        position: static;
    }

    .settings-modal {
        padding: 1rem;
    }

    .settings-modal__dialog {
        padding: 1.1rem;
    }

    .game-over-modal__actions {
        flex-direction: column;
    }

    .game-table-wrap {
        padding: 0;
    }


    .game-field__header {
        display: none;
    }
    .game-field__label--row {
        display: none;
    }

    .game-field__label {
        font-size: 9px;
    }

    main.game-shell > section {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    #main-wrap {
        gap: 0.5rem;
    }

    #secondary-wrap {
        gap: 0.25rem;
    }

    #history {
        height: 6rem;
    }

    #history-content {
        font-size: 10px;
    }

    #history-content > .history-entry {
        padding: 0.3rem 0 0.3rem 0.65rem;
    }

    #command-log-title-wrap {
        display: none;
    }

    #opponent-stat-wrap {
        grid-template-columns: 1fr auto;
        gap: 0.25rem;
    }

    #opponent-stat-wrap section {
        padding: 0.25rem;
    }

    .game-panel.p-4 {
        padding: 0.65rem;
    }

    #player-field {
        --game-cell-size: clamp(13px, 4vw, 18px);
        --game-cell-gap: 0.1rem;
    }

    #header-wrap {
        display: none;
    }
}

@media (max-width: 968px) and (orientation: landscape) {
    :root {
        --game-cell-size: 8vh;
        --game-cell-gap: 0.22rem;
    }

    header.fixed {
        position: static;
    }

    main.game-shell > section {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .game-table-wrap {
        padding: 0;
    }

    .game-field__header {
        display: none;
    }
    .game-field__label--row {
        display: none;
    }

    .game-field__label {
        font-size: 9px;
    }

    #opponent-field-title {
        display: none;
    }

    #main-wrap {
        gap: 0.5rem;
        display: grid;
        grid-template-columns: 1fr auto;
        max-height: none;
    }

    #main-wrap > div {
        height: auto;
        justify-content: end;
    }

    .sidebar-shell {
        overflow-y: auto;
    }

    .mobile-menu__drawer {
        height: 100dvh;
        max-height: 100dvh;
    }

    #secondary-wrap {
        gap: 0.25rem;
    }

    #history {
        height: 6rem;
    }

    #history-content {
        font-size: 10px;
    }

    #history-content > .history-entry {
        padding: 0.3rem 0 0.3rem 0.65rem;
    }

    #command-log-title-wrap {
        display: none;
    }

    #opponent-stat-wrap {
        grid-template-columns: 1fr auto;
        gap: 0.25rem;
    }

    #opponent-stat-wrap section {
        padding: 0.25rem;
    }

    .game-panel.p-4 {
        padding: 0.65rem;
    }

    #player-field {
        --game-cell-size: 5.3vh;
        --game-cell-gap: 0.1rem;
    }

    #header-wrap {
        display: none;
    }
}
