.game-active .search-box,
.game-active .series-list {
    display: none;
}

.cards-grid.game-host {
    display: block;
    padding: 0;
    gap: 0;
    overflow-y: auto;
}

.game-sidebar-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
}

.game-side-section {
    margin-bottom: 1rem;
}

.game-side-title {
    margin: 0 0 0.55rem;
    color: #cfe8f6;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.game-side-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.game-side-btn,
.game-side-link {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(103, 193, 245, 0.26);
    border-radius: 8px;
    background: rgba(16, 55, 78, 0.84);
    color: #eaf7ff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.game-side-btn {
    text-align: center;
    padding: 0 0.5rem;
}

.game-side-link {
    display: block;
    padding: 0.7rem 0.75rem;
    margin-bottom: 0.42rem;
}

.game-side-btn:hover,
.game-side-link:hover,
.game-side-link.active {
    border-color: rgba(255, 214, 90, 0.82);
    background: rgba(39, 127, 163, 0.9);
    transform: translateX(2px);
}

.game-side-btn.primary {
    border-color: rgba(255, 214, 90, 0.66);
    background: #ffd65a;
    color: #172331;
}

.game-side-link.disabled {
    cursor: default;
    opacity: 0.42;
    text-decoration: none;
}

.game-side-link.disabled:hover {
    border-color: rgba(103, 193, 245, 0.26);
    background: rgba(16, 55, 78, 0.84);
    transform: none;
}

.game-page {
    width: 100%;
    min-height: 100%;
    display: grid;
    grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
    grid-template-rows: minmax(300px, auto) minmax(420px, 1fr);
    gap: 1rem;
    padding: 1.1rem;
    background: #0d2232;
}

.game-card {
    min-width: 0;
    border: 1px solid rgba(103, 193, 245, 0.18);
    border-radius: 8px;
    background:
        radial-gradient(circle at top left, rgba(103, 193, 245, 0.14), transparent 36%),
        linear-gradient(145deg, rgba(16, 55, 78, 0.95), rgba(9, 31, 46, 0.98));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
}

.game-card-inner {
    padding: 1.25rem;
}

.game-trainer-card {
    display: grid;
    gap: 0.9rem;
}

.game-trainer-name,
.game-event-title {
    margin: 0;
    color: #ffffff;
    font-size: 1.18rem;
    line-height: 1.2;
}

.game-partner {
    margin: 0;
    color: #cfe8f6;
    font-weight: 900;
}

.game-coins {
    color: #ffd65a;
    font-weight: 900;
    font-size: 1.1rem;
}

.game-stat-row {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) 46px;
    align-items: center;
    gap: 0.55rem;
    color: #cfe8f6;
    font-size: 0.86rem;
    font-weight: 900;
}

.game-stat-bar {
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
}

.game-stat-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: #63d173;
    transition: width 0.25s ease;
}

.game-stat-fill.affection {
    background: #ff8fb3;
}

.game-stats-copy {
    margin: 0;
    color: #67c1f5;
    font-weight: 900;
    line-height: 1.6;
}

.game-event-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.game-area-description {
    margin: 0;
    color: #b2d6e8;
    line-height: 1.45;
}

.game-event-body {
    margin: 0;
    color: #ffffff;
    font-weight: 800;
    line-height: 1.5;
    white-space: pre-line;
}

.game-controls-card {
    overflow: hidden;
}

.game-team-list {
    display: grid;
    gap: 0.58rem;
}

.game-team-slot {
    min-height: 46px;
    border: 1px solid rgba(103, 193, 245, 0.2);
    border-radius: 8px;
    background: #10374e;
    color: #ffffff;
    font: inherit;
    font-weight: 900;
    text-align: left;
    padding: 0 0.85rem;
    cursor: pointer;
}

.game-team-slot.active {
    background: #277fa3;
    border-color: rgba(255, 214, 90, 0.74);
}

.game-stage {
    min-height: 420px;
    overflow: hidden;
}

.game-stage-content {
    height: 100%;
    min-height: 420px;
    position: relative;
}

.game-map-shell,
.game-encounter,
.game-subview {
    height: 100%;
    min-height: 420px;
}

.game-map-shell {
    position: relative;
    overflow: hidden;
}

.game-map {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #091f2e;
}

.game-map-hotspots {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.game-map-hotspot {
    position: absolute;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    cursor: crosshair;
    padding: 0;
}

.game-map-hotspot:hover,
.game-map-hotspot:focus-visible {
    border-color: rgba(255, 214, 90, 0.85);
    background: rgba(255, 214, 90, 0.12);
    outline: none;
}

.game-map-fallback {
    height: 100%;
    min-height: 420px;
    display: grid;
    place-items: center;
    color: #eaf7ff;
    font-weight: 900;
    text-align: center;
    padding: 2rem;
}

.game-encounter {
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: #efffba;
    color: #111827;
}

.game-encounter-card {
    width: min(720px, 100%);
    display: grid;
    justify-items: center;
    gap: 1rem;
    text-align: center;
}

.game-sprite {
    width: 160px;
    height: 170px;
    display: grid;
    place-items: center;
    border: 4px solid #2d2d2d;
    background: #ffdd50;
}

.game-sprite img {
    max-width: 138px;
    max-height: 138px;
    object-fit: contain;
    image-rendering: auto;
}

.game-sprite.fallback {
    color: #111827;
    font-weight: 900;
}

.game-encounter-actions,
.game-battle-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.game-action {
    min-width: 140px;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: #2d2d2d;
    color: #ffffff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.game-action.primary {
    background: #ffd65a;
    color: #172331;
}

.game-action:disabled {
    cursor: default;
    opacity: 0.55;
}

.game-gym-photo {
    height: 100%;
    min-height: 420px;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    background: #000;
}

.game-gym-photo img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}

.game-gym-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.68);
}

.game-battle {
    min-height: 520px;
    padding: 1.2rem;
    background: #ffffff;
    color: #111827;
}

.game-battle h2 {
    margin: 0 0 1rem;
    text-align: center;
}

.game-battle-field {
    display: grid;
    grid-template-columns: minmax(180px, 430px) 170px 170px minmax(180px, 430px);
    align-items: start;
    justify-content: center;
    gap: 1rem;
}

.game-battle-status {
    background: #ecffbb;
    border: 1px solid #c9e19c;
}

.game-battle-name {
    padding: 0.55rem 0.8rem;
    background: #2d2d2d;
    color: #ffffff;
    font-weight: 900;
    text-align: center;
}

.game-hp-wrap {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
    padding: 1rem;
    font-weight: 900;
}

.game-hp-bar {
    height: 24px;
    background: #d8e2dc;
    overflow: hidden;
}

.game-hp-fill {
    height: 100%;
    width: 100%;
    background: #39b86b;
}

.game-battle-message {
    width: min(640px, 100%);
    min-height: 118px;
    margin: 1.35rem auto 1rem;
    color: #737373;
    font-weight: 900;
    text-align: center;
    white-space: pre-line;
}

.game-move-select {
    width: min(260px, 100%);
    min-height: 42px;
    display: block;
    margin: 0 auto 1rem;
    border: 1px solid #9ca3af;
    border-radius: 8px;
    padding: 0 0.75rem;
    font: inherit;
    font-weight: 800;
}

.game-subview {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    background: #0a2d46;
}

.game-subview h2 {
    margin: 0;
    padding: 1rem;
    background: #14415f;
    color: #ffffff;
    text-align: center;
    text-transform: uppercase;
}

.game-subview-body {
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
}

.game-back-row {
    min-height: 42px;
    border: 0;
    background: #10374e;
    color: #ffffff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.game-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.game-captured-tile,
.game-shop-row,
.game-log-row {
    border: 1px solid rgba(103, 193, 245, 0.18);
    border-radius: 8px;
    background: #10374e;
    color: #ffffff;
}

.game-captured-tile {
    min-height: 190px;
    padding: 0.85rem;
    cursor: pointer;
}

.game-captured-tile strong {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 1rem;
}

.game-mini-bars {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.game-mini-bar {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
}

.game-mini-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: #63d173;
}

.game-mini-bar.affection span {
    background: #ff8fb3;
}

.game-shop-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.7rem;
}

.game-shop-row p {
    margin: 0;
    color: #cfe8f6;
    font-weight: 800;
}

.game-shop-row strong {
    color: #ffffff;
}

.game-shop-section-title {
    margin: 1rem 0 0.55rem;
    color: #ffffff;
}

.game-empty {
    color: #b2d6e8;
    font-weight: 900;
}

.game-log-row {
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.45rem;
    color: #cfe8f6;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .game-page {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto minmax(420px, 1fr);
    }

    .game-battle-field {
        grid-template-columns: minmax(180px, 1fr) minmax(100px, 150px);
    }
}

@media (max-width: 768px) {
    .game-page {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .game-card-inner {
        padding: 1rem;
    }

    .game-side-grid {
        grid-template-columns: 1fr;
    }

    .game-battle-field {
        grid-template-columns: 1fr;
    }

    .game-battle-field .game-sprite {
        justify-self: center;
    }

    .game-shop-row {
        grid-template-columns: 1fr;
    }

    .game-action {
        width: 100%;
    }
}
