:root {
    --page-bg: #030805;
    --panel-bg: #07120d;
    --panel-strong: #0b1d13;
    --ink: #d8ffe7;
    --muted: #7ea68b;
    --line: rgba(85, 255, 137, 0.24);
    --field: #020604;
    --green-dark: #0a2a17;
    --green: #28f06c;
    --green-soft: #4dff91;
    --green-dim: #12833d;
    --green-wire: #74ffae;
    --amber-green: #b4ff42;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background:
        linear-gradient(rgba(40, 240, 108, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(40, 240, 108, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(40, 240, 108, 0.12), transparent 34rem),
        var(--page-bg);
    background-size: 24px 24px, 24px 24px, auto, auto;
    color: var(--ink);
    font-family: Consolas, "Lucida Console", Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.site-header,
.game-header {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    padding: 36px 0 18px;
}

.site-header__inner,
.game-header {
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(40, 240, 108, 0.08);
}

.site-kicker {
    margin: 0 0 8px;
    color: var(--green-soft);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 14px;
    font-size: 2.15rem;
    line-height: 1.05;
}

.site-main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.game-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    min-height: 184px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(40, 240, 108, 0.1), transparent 26%),
        var(--panel-bg);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease;
}

.game-card,
.back-link,
.canvas-frame,
.game-panel,
.overlay-button,
.control-button {
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.game-card:hover,
.game-card:focus-visible {
    border-color: var(--green-soft);
    outline: none;
    transform: translateY(-2px);
}

.game-card__preview {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 3px;
    min-height: 184px;
    padding: 18px;
    background:
        linear-gradient(rgba(40, 240, 108, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(40, 240, 108, 0.08) 1px, transparent 1px),
        var(--field);
    background-size: 14px 14px;
    border-right: 1px solid var(--line);
}

.preview-cell {
    border-radius: 3px;
    background: rgba(40, 240, 108, 0.07);
}

.preview-cell--i { background: #26f06c; }
.preview-cell--j { background: #1ac65a; }
.preview-cell--l { background: #85ff4f; }
.preview-cell--o { background: #55ff91; }
.preview-cell--s { background: #10a64b; }
.preview-cell--t { background: #b4ff42; }
.preview-cell--z { background: #42df73; }
.preview-cell--brick { background: var(--green-soft); }
.preview-cell--brick-alt { background: var(--amber-green); }
.preview-cell--paddle { background: var(--green); }
.preview-cell--bubble-loop,
.preview-cell--bubble-signal,
.preview-cell--bubble-code {
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(40, 240, 108, 0.28);
}
.preview-cell--bubble-loop {
    background: radial-gradient(circle at 35% 30%, #eafff1, #32ff78 34%, #05240f 100%);
}
.preview-cell--bubble-signal {
    background: radial-gradient(circle at 35% 30%, #eafff1, #aaff41 34%, #183000 100%);
}
.preview-cell--bubble-code {
    background: radial-gradient(circle at 35% 30%, #eafff1, #1fcf5f 34%, #05240f 100%);
}
.preview-cell--shooter {
    background: #d8ffe7;
    transform: skewX(-18deg);
}
.preview-cell--tower-path {
    border-radius: 2px;
    background: #183c2a;
    box-shadow: inset 0 0 0 1px rgba(180, 255, 66, 0.28);
}
.preview-cell--tower-pulse,
.preview-cell--tower-frost,
.preview-cell--tower-mortar,
.preview-cell--tower-rail {
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(216, 255, 231, 0.22), inset 0 0 0 3px #020604;
}
.preview-cell--tower-pulse {
    background: #28f06c;
}
.preview-cell--tower-frost {
    background: #57d8ff;
}
.preview-cell--tower-mortar {
    background: #ffcf5a;
}
.preview-cell--tower-rail {
    background: #ff6fba;
}
.preview-cell--bot {
    border-radius: 2px;
    background: #d8ffe7;
    box-shadow: inset 0 -4px 0 #102016;
}

.game-card__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 22px;
}

.game-card__title {
    font-size: 1.45rem;
    font-weight: 800;
}

.game-card__description {
    color: var(--muted);
    line-height: 1.45;
}

.game-card__meta {
    color: var(--green-soft);
    font-size: 0.86rem;
    font-weight: 700;
}

.game-page {
    background:
        linear-gradient(rgba(40, 240, 108, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(40, 240, 108, 0.03) 1px, transparent 1px),
        #030805;
    background-size: 24px 24px;
    color: var(--ink);
}

.game-page--tower {
    /* Neutralni sedy motiv drzi Tower Defense oddeleny od zeleneho stylu ostatnich her. */
    --panel-bg: #17191d;
    --panel-strong: #22252a;
    --ink: #e6e8eb;
    --muted: #9ca3ad;
    --line: rgba(183, 190, 199, 0.34);
    --field: #0f1114;
    --green: #c3c8cf;
    --green-soft: #f0f2f5;
    --green-dim: #6f7782;
    --green-wire: #aeb5bf;
    --amber-green: #d4d8dd;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
    background:
        linear-gradient(rgba(183, 190, 199, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(183, 190, 199, 0.04) 1px, transparent 1px),
        linear-gradient(145deg, rgba(118, 126, 138, 0.22), transparent 34rem),
        #0b0d10;
    background-size: 28px 28px, 28px 28px, auto, auto;
}

.game-page--tower .site-kicker {
    color: #d9dde3;
}

.game-page--tower .game-header {
    border-bottom-color: rgba(183, 190, 199, 0.34);
    box-shadow: 0 1px 0 rgba(230, 232, 235, 0.1);
}

.game-header {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
    padding: 18px 0 10px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(40, 240, 108, 0.12), rgba(40, 240, 108, 0.02));
    color: var(--ink);
    text-decoration: none;
}

.game-page--tower .back-link {
    border-color: rgba(183, 190, 199, 0.42);
    background:
        linear-gradient(135deg, rgba(202, 207, 214, 0.16), rgba(31, 34, 39, 0.76)),
        #15181c;
    color: #e6e8eb;
}

.back-link:hover,
.back-link:focus-visible {
    border-color: var(--green-soft);
    outline: none;
}

.game-shell {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(260px, 340px);
    align-items: start;
    justify-content: center;
    gap: 16px;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0 24px;
}

.game-shell--wide {
    grid-template-columns: minmax(320px, 620px) minmax(260px, 340px);
}

.game-shell--tower {
    grid-template-columns: minmax(420px, 980px) minmax(280px, 360px);
    width: min(1400px, calc(100% - 32px));
}

.play-zone,
.game-panel {
    min-width: 0;
}

.canvas-frame {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(40, 240, 108, 0.16), transparent 18%),
        var(--field);
    padding: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38), inset 0 0 22px rgba(40, 240, 108, 0.06);
}

.game-page--tower .canvas-frame {
    border-color: rgba(183, 190, 199, 0.42);
    background:
        repeating-linear-gradient(135deg, rgba(216, 221, 228, 0.1) 0 8px, rgba(20, 23, 27, 0.16) 8px 16px),
        linear-gradient(135deg, rgba(52, 57, 64, 0.58), rgba(13, 15, 18, 0.9)),
        #15181c;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(230, 232, 235, 0.07);
}

#gameCanvas {
    display: block;
    width: min(100%, 270px);
    height: auto;
    margin: 0 auto;
    aspect-ratio: 1 / 2;
    border-radius: 6px;
    background: var(--field);
    cursor: pointer;
    touch-action: none;
    box-shadow: inset 0 0 0 1px rgba(40, 240, 108, 0.14);
}

.game-page--bubble #gameCanvas {
    width: min(100%, 460px);
    aspect-ratio: 14 / 17;
}

.game-page--tower #gameCanvas {
    width: min(100%, 920px);
    aspect-ratio: 26 / 17;
    cursor: crosshair;
    background: #0f1114;
    box-shadow: inset 0 0 0 1px rgba(183, 190, 199, 0.24), inset 0 0 42px rgba(0, 0, 0, 0.42);
}

.game-overlay {
    position: absolute;
    inset: 8px;
    display: grid;
    place-content: center;
    gap: 14px;
    border-radius: 6px;
    background:
        linear-gradient(rgba(40, 240, 108, 0.05) 1px, transparent 1px),
        rgba(2, 6, 4, 0.84);
    background-size: 12px 12px;
    text-align: center;
}

.game-page--tower .game-overlay {
    background:
        repeating-linear-gradient(135deg, rgba(230, 232, 235, 0.06) 0 10px, transparent 10px 20px),
        rgba(15, 17, 20, 0.92);
    border: 1px solid rgba(183, 190, 199, 0.42);
}

.game-overlay[hidden] {
    display: none;
}

.game-overlay strong {
    font-size: 1.5rem;
}

.overlay-button,
.control-button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.overlay-button {
    min-height: 44px;
    padding: 0 18px;
    background: var(--green);
    color: #020604;
    font-weight: 800;
}

.game-page--tower .overlay-button,
.game-page--tower .control-button {
    border: 1px solid rgba(183, 190, 199, 0.36);
    background:
        linear-gradient(180deg, rgba(230, 232, 235, 0.16), rgba(75, 82, 92, 0.16)),
        #17191d;
    color: #e6e8eb;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.45);
}

.mouse-controls {
    display: grid;
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    gap: 7px;
    margin-top: 10px;
}

.mouse-controls--compact {
    grid-template-columns: repeat(3, minmax(52px, 1fr));
}

/* Tower Defense má vlastní obchod, protože volba věže je součástí hlavní herní smyčky. */
.tower-shop {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(40, 240, 108, 0.2);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(40, 240, 108, 0.1), rgba(40, 240, 108, 0.03)),
        var(--field);
    padding: 10px;
}

.game-page--tower .game-panel,
.game-page--tower .tower-shop,
.game-page--tower .metrics--tower,
.game-page--tower .entity-column,
.game-page--tower .tower-detail,
.game-page--tower .score-list {
    border-color: rgba(183, 190, 199, 0.32);
    background:
        linear-gradient(135deg, rgba(77, 84, 94, 0.28), rgba(18, 21, 25, 0.76)),
        #15181c;
}

.game-page--tower .game-panel {
    box-shadow: var(--shadow), inset 0 0 0 1px rgba(230, 232, 235, 0.06);
}

.game-page--tower .tower-shop {
    border-left: 4px solid rgba(183, 190, 199, 0.56);
}

.tower-controls {
    display: grid;
    gap: 6px;
}

.tower-control-row {
    display: grid;
    gap: 6px;
}

.tower-control-row--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tower-control-row--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tower-build-button {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    min-width: 0;
    border: 1px solid rgba(40, 240, 108, 0.2);
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(40, 240, 108, 0.14), rgba(40, 240, 108, 0.04));
    color: var(--ink);
    cursor: pointer;
    padding: 6px 7px;
    text-align: left;
}

.game-page--tower .tower-build-button {
    border-color: rgba(183, 190, 199, 0.34);
    background:
        linear-gradient(180deg, rgba(230, 232, 235, 0.08), rgba(18, 21, 25, 0.58)),
        #171a1f;
}

.tower-build-button:hover,
.tower-build-button:focus-visible,
.tower-build-button.is-active {
    border-color: var(--green-soft);
    outline: none;
    background: linear-gradient(135deg, rgba(40, 240, 108, 0.28), rgba(40, 240, 108, 0.08));
}

.game-page--tower .tower-build-button:hover,
.game-page--tower .tower-build-button:focus-visible,
.game-page--tower .tower-build-button.is-active {
    border-color: #f0f2f5;
    background:
        linear-gradient(180deg, rgba(230, 232, 235, 0.18), rgba(103, 112, 124, 0.24)),
        #20242a;
}

.tower-build-button.is-expensive {
    opacity: 0.62;
}

.tower-build-button small {
    grid-column: 1 / -1;
    color: var(--green-soft);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
}

.game-page--tower .tower-build-button small {
    color: #d9dde3;
}

.tower-build-button > span:not(.tower-swatch) {
    min-width: 0;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tower-swatch {
    width: 15px;
    height: 15px;
    border: 2px solid #020604;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(216, 255, 231, 0.26);
}

.tower-swatch.tower-swatch--image {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    box-shadow: none;
    image-rendering: pixelated;
}

.game-page--tower .tower-swatch {
    border-color: #101216;
    box-shadow: 0 0 0 1px rgba(230, 232, 235, 0.28);
}

.game-page--tower .tower-swatch.tower-swatch--image {
    box-shadow: none;
}

.tower-swatch--pulse {
    background: #28f06c;
}

.tower-swatch--frost {
    background: #57d8ff;
}

.tower-swatch--splash {
    background: #ffcf5a;
}

.tower-swatch--rail {
    background: #ff6fba;
}

.tower-swatch--range {
    background: #d8ffe7;
}

.tower-swatch--damage {
    background: #ff8f5a;
}

/* Spodní kolona ukazuje jen aktivní prvky, které ještě nejsou zničené. */
.entity-column {
    display: grid;
    gap: 8px;
    height: 124px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid rgba(40, 240, 108, 0.2);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(40, 240, 108, 0.1), rgba(40, 240, 108, 0.03)),
        var(--field);
    padding: 10px;
}

.entity-column__track {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    height: 76px;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0;
    scrollbar-width: thin;
}

.entity-column__empty {
    display: grid;
    min-height: 46px;
    margin: 0;
    place-items: center;
    color: var(--muted);
    font-size: 0.82rem;
}

.entity-column__empty[hidden] {
    display: none;
}

.entity-chip {
    --entity-color: #28f06c;
    display: grid;
    grid-template-rows: 1fr 5px;
    align-self: center;
    flex: 0 0 44px;
    gap: 4px;
    width: 44px;
    height: 48px;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(216, 255, 231, 0.16);
    border-radius: 6px;
    background: rgba(2, 6, 4, 0.74);
    box-shadow: inset 0 0 18px rgba(40, 240, 108, 0.06);
    padding: 4px;
}

.entity-chip.is-critical {
    border-color: rgba(255, 111, 111, 0.58);
}

.entity-chip__health {
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.entity-chip__symbol {
    display: grid;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    place-items: center;
    border-radius: 4px;
    background: var(--entity-color);
    color: #020604;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
}

.entity-chip__bar {
    width: 100%;
    height: 5px;
    overflow: hidden;
    border: 1px solid rgba(216, 255, 231, 0.2);
    border-radius: 999px;
    background: rgba(2, 6, 4, 0.88);
}

.entity-chip__fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--entity-color), #d8ffe7);
    transition: width 120ms linear;
}

.control-button {
    display: grid;
    place-items: center;
    min-height: 44px;
    border: 1px solid rgba(40, 240, 108, 0.2);
    background: linear-gradient(135deg, rgba(40, 240, 108, 0.16), rgba(40, 240, 108, 0.04));
    color: var(--ink);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.control-button:hover,
.control-button:focus-visible {
    background: linear-gradient(135deg, rgba(40, 240, 108, 0.26), rgba(40, 240, 108, 0.08));
    outline: 2px solid var(--green-soft);
    outline-offset: 2px;
}

.control-button--accent {
    background: var(--green);
    color: #020604;
}

.control-button--accent:hover,
.control-button--accent:focus-visible {
    background: var(--green-soft);
}

.game-page--tower .control-button:hover,
.game-page--tower .control-button:focus-visible,
.game-page--tower .overlay-button:hover,
.game-page--tower .overlay-button:focus-visible {
    background:
        linear-gradient(180deg, rgba(240, 242, 245, 0.18), rgba(103, 112, 124, 0.24)),
        #20242a;
    outline: 2px solid #f0f2f5;
    outline-offset: 2px;
}

.control-symbol {
    font-size: 1.22rem;
    line-height: 1;
}

.game-panel {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(40, 240, 108, 0.14), transparent 22%),
        var(--panel-bg);
    padding: 14px;
    box-shadow: var(--shadow);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.metrics--tower {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    margin-bottom: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgba(40, 240, 108, 0.2);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(40, 240, 108, 0.1), rgba(40, 240, 108, 0.03)),
        var(--field);
    padding: 6px;
    scrollbar-width: thin;
}

.metric {
    min-width: 0;
    border: 1px solid rgba(40, 240, 108, 0.2);
    border-radius: 8px;
    padding: 10px;
    background: var(--field);
}

.game-page--tower .metric {
    border-color: rgba(183, 190, 199, 0.34);
    background:
        linear-gradient(180deg, rgba(230, 232, 235, 0.06), transparent 48%),
        #111419;
}

.metric span,
.panel-label,
.player-field span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    margin-top: 4px;
    font-size: 1.24rem;
    color: var(--green-soft);
    text-shadow: 0 0 14px rgba(40, 240, 108, 0.28);
}

.game-page--tower .metric strong {
    color: #f0f2f5;
    text-shadow: 0 0 12px rgba(230, 232, 235, 0.18);
}

.metrics--tower .metric {
    flex: 0 0 82px;
    border-radius: 6px;
    padding: 6px 8px;
}

.metrics--tower .metric--money {
    flex-basis: 98px;
}

.metrics--tower .metric--lives {
    flex-basis: 92px;
}

.metrics--tower .metric span {
    font-size: 0.64rem;
    letter-spacing: 0.05em;
}

.metrics--tower .metric strong {
    margin-top: 2px;
    font-size: 1rem;
    text-align: right;
}

.money-readout,
.metric-readout {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 2px;
    min-width: 0;
    width: 100%;
}

.money-readout #moneyValue,
.metric-readout strong {
    margin-top: 0;
}

/* Ikony jsou mimo hodnoty, proto zustanou videt i po prepsani cisla skriptem. */
.money-coin,
.metric-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    image-rendering: auto;
}

#moneyValue {
    color: #d9dde3;
    text-shadow: 0 0 14px rgba(230, 232, 235, 0.18);
}

.game-page--tower #moneyValue {
    color: #d9dde3;
    text-shadow: 0 0 12px rgba(230, 232, 235, 0.18);
}

.next-piece {
    display: grid;
    gap: 8px;
}

#nextCanvas {
    width: 96px;
    height: 96px;
    border: 1px solid rgba(40, 240, 108, 0.2);
    border-radius: 8px;
    background: var(--field);
}

.player-field {
    display: grid;
    gap: 6px;
}

.player-field input {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(40, 240, 108, 0.28);
    border-radius: 8px;
    background: var(--field);
    color: var(--ink);
    padding: 0 12px;
}

.game-page--tower .player-field input {
    border-color: rgba(183, 190, 199, 0.4);
    background: #111419;
    color: #e6e8eb;
}

.player-field input:focus {
    border-color: var(--green-soft);
    outline: none;
}

.score-list {
    display: grid;
    gap: 8px;
}

.tower-detail {
    display: grid;
    gap: 8px;
    min-height: 238px;
    overflow: hidden;
    border: 1px solid rgba(40, 240, 108, 0.18);
    border-radius: 8px;
    background: var(--field);
    padding: 12px;
}

.tower-detail strong {
    min-width: 0;
    overflow: hidden;
    color: var(--green-soft);
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-page--tower .tower-detail strong {
    color: #f0f2f5;
}

.tower-detail p {
    height: 62px;
    overflow: hidden;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.target-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.target-controls[hidden] {
    display: none;
}

.target-controls button {
    min-width: 0;
    min-height: 25px;
    overflow: hidden;
    border: 1px solid rgba(183, 190, 199, 0.28);
    border-radius: 6px;
    background: #111419;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.target-controls button:hover,
.target-controls button:focus-visible,
.target-controls button.is-active {
    border-color: #f0f2f5;
    background: #20242a;
    color: #f0f2f5;
    outline: none;
}

.upgrade-progress {
    display: grid;
    gap: 6px;
    height: 30px;
}

.upgrade-progress.is-idle {
    visibility: hidden;
}

.upgrade-progress__bar {
    height: 10px;
    overflow: hidden;
    border: 1px solid rgba(180, 255, 66, 0.35);
    border-radius: 999px;
    background: rgba(2, 6, 4, 0.82);
}

.upgrade-progress__bar span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #9ca3ad, #f0f2f5);
    box-shadow: 0 0 14px rgba(230, 232, 235, 0.22);
    transition: width 120ms linear;
}

.upgrade-progress small {
    color: #ffcf5a;
    font-weight: 700;
}

.game-page--tower .upgrade-progress__bar {
    border-color: rgba(183, 190, 199, 0.35);
    background: #111419;
}

.game-page--tower .upgrade-progress__bar span {
    background: linear-gradient(90deg, #9ca3ad, #f0f2f5);
    box-shadow: 0 0 14px rgba(230, 232, 235, 0.22);
}

.game-page--tower .upgrade-progress small {
    color: #d9dde3;
}

.tower-detail__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tower-detail__actions .overlay-button,
.tower-detail__actions .control-button {
    height: 42px;
    min-height: 42px;
    overflow: hidden;
}

.tower-detail__actions button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
    font-size: 0.92rem;
}

.score-table th,
.score-table td {
    padding: 8px 7px;
    border-bottom: 1px solid rgba(40, 240, 108, 0.12);
    text-align: left;
}

.game-page--tower .score-table th,
.game-page--tower .score-table td {
    border-bottom-color: rgba(183, 190, 199, 0.18);
}

.score-table th {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.game-page--tower .score-table th {
    color: #9ca3ad;
}

.game-page--tower .score-table td {
    color: #e6e8eb;
}

.score-table td:nth-child(2),
.score-table td:nth-child(3) {
    text-align: right;
}

@media (max-width: 860px) {
    .game-shell {
        grid-template-columns: minmax(280px, 420px);
    }

    .game-shell--tower {
        grid-template-columns: minmax(280px, 1fr);
    }

    .game-panel {
        order: -1;
    }
}

@media (max-height: 860px) and (min-width: 861px) {
    h1 {
        font-size: 1.85rem;
        margin-bottom: 10px;
    }

    .game-header {
        padding: 12px 0 8px;
    }

    .game-shell {
        padding: 12px 0 18px;
    }

    #gameCanvas {
        width: min(100%, 245px);
    }

    .game-page--bubble #gameCanvas {
        width: min(100%, 420px);
    }

    .game-page--tower #gameCanvas {
        width: min(100%, 820px);
    }

    .control-button {
        min-height: 40px;
    }

    .game-panel {
        gap: 10px;
        padding: 12px;
    }

    #nextCanvas {
        width: 86px;
        height: 86px;
    }
}

@media (max-height: 760px) and (min-width: 861px) {
    #gameCanvas {
        width: min(100%, 220px);
    }

    .game-page--bubble #gameCanvas {
        width: min(100%, 380px);
    }

    .game-page--tower #gameCanvas {
        width: min(100%, 760px);
    }

    .mouse-controls {
        margin-top: 8px;
    }

    .control-button {
        min-height: 38px;
    }
}

@media (max-width: 620px) {
    h1 {
        font-size: 2rem;
    }

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

    .game-card__preview {
        min-height: 156px;
    }

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

    .mouse-controls {
        grid-template-columns: repeat(4, minmax(44px, 1fr));
    }

    .mouse-controls--compact {
        grid-template-columns: repeat(3, minmax(44px, 1fr));
    }

    .metrics {
        grid-template-columns: 1fr;
    }
}
