:root {
    color-scheme: dark;
    --tr-text: #f8fafc;
    --tr-muted: #9fb6ca;
    --tr-border: rgba(125, 211, 252, 0.22);
    --tr-cyan: #38bdf8;
    --tr-blue: #2563eb;
    --tr-green: #34d399;
    --tr-warning: #fbbf24;
    --tr-danger: #fb7185;
}

* {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
    color: var(--tr-text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background:
        radial-gradient(
            circle at 14% 8%,
            rgba(14, 165, 233, 0.17),
            transparent 30%
        ),
        radial-gradient(
            circle at 88% 12%,
            rgba(37, 99, 235, 0.17),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            #020b16,
            #031528 55%,
            #020811
        );
}

button,
a {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.tr-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.tr-topbar {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding:
        max(0.8rem, env(safe-area-inset-top))
        clamp(1rem, 3vw, 2.2rem)
        0.8rem;
    border-bottom: 1px solid rgba(125, 211, 252, 0.12);
    background: rgba(2, 11, 22, 0.78);
    backdrop-filter: blur(18px);
}

.tr-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.tr-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.tr-brand span {
    display: grid;
    gap: 0.08rem;
}

.tr-brand strong {
    font-size: 0.98rem;
}

.tr-brand small {
    color: var(--tr-muted);
    font-size: 0.72rem;
}

.tc-game-back {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-left: auto;
    padding: 0.65rem 0.9rem;
    color: #dbeafe;
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid var(--tr-border);
    border-radius: 13px;
    background: rgba(8, 47, 73, 0.58);
    transition:
        border-color 0.16s ease,
        background 0.16s ease;
}

.tc-game-back:hover {
    border-color: rgba(125, 211, 252, 0.48);
    background: rgba(8, 47, 73, 0.82);
}

.tr-top-actions {
    display: flex;
    gap: 0.55rem;
}

.tr-icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--tr-border);
    border-radius: 13px;
    color: var(--tr-text);
    background: rgba(8, 47, 73, 0.58);
    cursor: pointer;
}

.tr-main {
    width: 100%;
    flex: 1;
    display: grid;
    place-items: center;
    padding: clamp(0.8rem, 2.5vw, 2rem);
}

.tr-game-card {
    width: min(1180px, 100%);
    overflow: hidden;
    border: 1px solid var(--tr-border);
    border-radius: clamp(18px, 2vw, 28px);
    background:
        linear-gradient(
            180deg,
            rgba(8, 47, 73, 0.82),
            rgba(3, 23, 42, 0.94)
        );
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.tr-hud {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: rgba(125, 211, 252, 0.12);
}

.tr-hud-box {
    min-width: 0;
    min-height: 70px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.18rem;
    padding: 0.65rem;
    text-align: center;
    background: rgba(3, 23, 42, 0.95);
}

.tr-hud-box span {
    color: var(--tr-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.tr-hud-box strong {
    font-size: clamp(0.95rem, 1.8vw, 1.35rem);
    line-height: 1;
}

.tr-timer-track {
    height: 5px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.9);
}

.tr-timer-fill {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(
            90deg,
            var(--tr-danger),
            var(--tr-warning),
            var(--tr-green)
        );
    transform-origin: left center;
}

.tr-game-wrap {
    position: relative;
    width: 100%;
    height: min(68vh, 660px);
    min-height: 520px;
    overflow: hidden;
    isolation: isolate;
    touch-action: manipulation;
}

.tr-tank {
    position: absolute;
    inset: 0;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(
            180deg,
            #15648a,
            #0a6985 42%,
            #075570 76%,
            #053d55
        );
}

.tr-water-glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(
            circle at 50% -15%,
            rgba(186, 230, 253, 0.18),
            transparent 45%
        );
}

.tr-water-haze {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            rgba(99, 72, 32, 0.18),
            rgba(79, 58, 27, 0.24)
        );
    opacity: 0.8;
    transition: opacity 0.65s ease;
}

.tr-light-rays {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(
            102deg,
            transparent 9%,
            rgba(224, 242, 254, 0.08) 23%,
            transparent 39%
        ),
        linear-gradient(
            75deg,
            transparent 54%,
            rgba(224, 242, 254, 0.06) 68%,
            transparent 82%
        );
}

.tr-bubbles {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.tr-bubbles i {
    position: absolute;
    bottom: -20px;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(224, 242, 254, 0.5);
    border-radius: 50%;
    animation: trBubble 7s linear infinite;
}

.tr-bubbles i:nth-child(1) {
    left: 12%;
    animation-delay: -2s;
}

.tr-bubbles i:nth-child(2) {
    left: 29%;
    width: 5px;
    height: 5px;
    animation-delay: -4.5s;
}

.tr-bubbles i:nth-child(3) {
    left: 48%;
    animation-delay: -1.2s;
}

.tr-bubbles i:nth-child(4) {
    left: 67%;
    width: 11px;
    height: 11px;
    animation-delay: -5.4s;
}

.tr-bubbles i:nth-child(5) {
    left: 81%;
    width: 6px;
    height: 6px;
    animation-delay: -3.2s;
}

.tr-bubbles i:nth-child(6) {
    left: 91%;
    animation-delay: -0.4s;
}

@keyframes trBubble {
    from {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    12% {
        opacity: 0.65;
    }

    to {
        transform: translateY(-700px) translateX(18px);
        opacity: 0;
    }
}

.tr-substrate {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    height: 15%;
    background:
        radial-gradient(
            circle at 10px 9px,
            #b38a58 0 5px,
            transparent 6px
        )
        0 0 / 30px 24px,
        radial-gradient(
            circle at 20px 14px,
            #72543a 0 4px,
            transparent 5px
        )
        0 0 / 34px 28px,
        linear-gradient(
            180deg,
            #a2764b,
            #68482f
        );
}

.tr-fixable {
    position: absolute;
    z-index: 12;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
}

.tr-fixable::after {
    content: "";
    position: absolute;
    inset: -12px;
    border: 2px solid transparent;
    border-radius: 18px;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

.tr-fixable:hover::after {
    border-color: rgba(125, 211, 252, 0.7);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.tr-fixable:focus-visible {
    outline: none;
}

.tr-fixable:focus-visible::after {
    border-color: rgba(125, 211, 252, 0.7);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

@media (hover: none), (pointer: coarse) {
    .tr-fixable:hover::after,
    .tr-fixable:focus-visible::after {
        border-color: transparent;
        box-shadow: none;
    }
}

.tr-filter {
    top: 17%;
    right: 5%;
    width: 76px;
    height: 155px;
}

.tr-filter-body {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 54px;
    height: 126px;
    border: 3px solid #172b38;
    border-radius: 12px;
    background:
        linear-gradient(
            90deg,
            #213a49,
            #304d5c 45%,
            #172b38
        );
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.tr-filter-body::after {
    content: "";
    position: absolute;
    top: 28px;
    right: 10px;
    left: 10px;
    height: 4px;
    border-radius: 999px;
    background: rgba(2, 11, 22, 0.7);
    box-shadow:
        0 16px 0 rgba(2, 11, 22, 0.7),
        0 32px 0 rgba(2, 11, 22, 0.7),
        0 48px 0 rgba(2, 11, 22, 0.7);
}

.tr-filter-pipe {
    position: absolute;
    top: 0;
    right: 13px;
    width: 38px;
    height: 36px;
    border: 6px solid #213a49;
    border-bottom: 0;
    border-radius: 11px 11px 0 0;
}

.tr-filter-flow {
    position: absolute;
    top: 31px;
    left: 0;
    width: 33px;
    height: 8px;
    border-radius: 999px 0 0 999px;
    background: rgba(186, 230, 253, 0.28);
    animation: trWeakFlow 1.5s ease-in-out infinite;
}

@keyframes trWeakFlow {
    0%,
    100% {
        transform: scaleX(0.5);
        opacity: 0.35;
    }

    50% {
        transform: scaleX(0.8);
        opacity: 0.62;
    }
}

.tr-filter-fixed .tr-filter-flow {
    width: 58px;
    background: rgba(186, 230, 253, 0.82);
    animation: trStrongFlow 0.9s ease-in-out infinite;
}

@keyframes trStrongFlow {
    0%,
    100% {
        transform: scaleX(0.82);
    }

    50% {
        transform: scaleX(1);
    }
}

.tr-heater {
    top: 28%;
    left: 6%;
    width: 34px;
    height: 170px;
}

.tr-heater-glass {
    position: absolute;
    inset: 0;
    border: 3px solid rgba(203, 213, 225, 0.7);
    border-radius: 15px;
    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.1),
            rgba(15, 23, 42, 0.65)
        );
}

.tr-heater-light {
    position: absolute;
    top: 13px;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.8);
}

.tr-syphon {
    top: 0;
    right: 16%;
    width: 105px;
    height: 72px;
}

.tr-tap-body {
    position: absolute;
    top: 0;
    right: 34px;
    width: 58px;
    height: 34px;
    border: 3px solid #1e293b;
    border-radius: 8px 8px 12px 12px;
    background:
        linear-gradient(
            180deg,
            #94a3b8,
            #64748b 50%,
            #334155
        );
    box-shadow:
        0 7px 14px rgba(0, 0, 0, 0.28),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.tr-tap-spout {
    position: absolute;
    top: 18px;
    right: 0;
    width: 48px;
    height: 22px;
    border: 7px solid #64748b;
    border-left: 0;
    border-bottom: 0;
    border-radius: 0 12px 0 0;
}

.tr-tap-spout::after {
    content: "";
    position: absolute;
    top: 7px;
    right: -7px;
    width: 14px;
    height: 20px;
    border-radius: 0 0 6px 6px;
    background: #475569;
}

.tr-tap-handle {
    position: absolute;
    top: -13px;
    right: 44px;
    width: 40px;
    height: 10px;
    border-radius: 999px;
    background:
        linear-gradient(
            180deg,
            #cbd5e1,
            #64748b
        );
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.tr-tap-handle::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 9px;
    height: 14px;
    transform: translateX(-50%);
    border-radius: 0 0 5px 5px;
    background: #64748b;
}

.tr-water-stream {
    position: absolute;
    top: 39px;
    right: 0;
    width: 9px;
    height: 78px;
    opacity: 0;
    border-radius: 999px;
    background:
        linear-gradient(
            180deg,
            rgba(224, 242, 254, 0.98),
            rgba(56, 189, 248, 0.35)
        );
    box-shadow: 0 0 12px rgba(125, 211, 252, 0.75);
}

.tr-syphon-fixed .tr-tap-handle {
    transform: rotate(28deg);
    transform-origin: center;
}

.tr-syphon-fixed .tr-water-stream {
    animation: trWaterRun 1.1s ease-in-out;
}

@keyframes trWaterRun {
    0%,
    100% {
        opacity: 0;
        transform: scaleY(0.2);
        transform-origin: top;
    }

    20%,
    78% {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }
}

.tr-food {
    top: 8%;
    left: 46%;
    width: 52px;
    height: 68px;
    border: 3px solid #334155;
    border-radius: 9px;
    background:
        linear-gradient(
            180deg,
            #f59e0b,
            #b45309
        );
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.tr-food span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff7ed;
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    transform: rotate(-90deg);
}

.tr-plant {
    position: absolute;
    bottom: 11%;
    z-index: 6;
    width: 105px;
    height: 175px;
}

.tr-plant-left {
    left: 10%;
}

.tr-plant-right {
    right: 9%;
    transform: scaleX(-1);
}

.tr-plant i {
    position: absolute;
    bottom: 0;
    width: 18px;
    border-radius: 70% 30% 70% 30%;
    transform-origin: bottom center;
    background:
        linear-gradient(
            180deg,
            #4ade80,
            #15803d
        );
}

.tr-plant i:nth-child(1) {
    left: 10px;
    height: 135px;
    transform: rotate(-14deg);
}

.tr-plant i:nth-child(2) {
    left: 43px;
    height: 170px;
    transform: rotate(4deg);
}

.tr-plant i:nth-child(3) {
    left: 74px;
    height: 125px;
    transform: rotate(17deg);
}

.tr-rock {
    position: absolute;
    bottom: 12%;
    z-index: 7;
    border-radius: 55% 45% 28% 30%;
    background:
        linear-gradient(
            145deg,
            #6b7280,
            #334155 55%,
            #1e293b
        );
    box-shadow:
        inset 9px 9px 15px rgba(255, 255, 255, 0.08),
        0 12px 18px rgba(0, 0, 0, 0.25);
}

.tr-rock-one {
    left: 31%;
    width: 108px;
    height: 70px;
}

.tr-rock-two {
    right: 31%;
    width: 84px;
    height: 55px;
}

.tr-fish {
    position: absolute;
    z-index: 9;
    width: 86px;
    height: 42px;
    border-radius: 55% 45% 48% 52%;
    border: 0;
    transform-origin: center;
    animation: trFishDrift 4.6s ease-in-out infinite;
}

.tr-fish::before {
    content: "";
    position: absolute;
    top: 8px;
    left: -25px;
    width: 31px;
    height: 26px;
    clip-path: polygon(100% 50%, 0 0, 13% 50%, 0 100%);
    background: inherit;
}

.tr-fish::after {
    content: "";
    position: absolute;
    top: -10px;
    left: 33px;
    width: 27px;
    height: 18px;
    clip-path: polygon(0 100%, 53% 0, 100% 100%);
    background: inherit;
    filter: brightness(0.86);
}

.tr-fish i {
    position: absolute;
    top: 10px;
    right: 13px;
    width: 7px;
    height: 7px;
    border: 2px solid white;
    border-radius: 50%;
    background: #020617;
}

.tr-fish-blue {
    background:
        linear-gradient(
            135deg,
            #7dd3fc,
            #0284c7 55%,
            #075985
        );
}

.tr-fish-yellow {
    background:
        linear-gradient(
            135deg,
            #fde68a,
            #f59e0b 58%,
            #b45309
        );
}

.tr-fish-red {
    background:
        linear-gradient(
            135deg,
            #fda4af,
            #e11d48 58%,
            #881337
        );
}

.tr-fish-one {
    top: 28%;
    left: 24%;
}

.tr-fish-two {
    top: 53%;
    left: 49%;
    transform: scaleX(-1);
    animation-delay: -1.5s;
}

.tr-fish-three {
    top: 67%;
    left: 35%;
    transform: scale(0.82);
    animation-delay: -2.7s;
}

.tr-aggressor {
    top: 39%;
    right: 23%;
    filter: drop-shadow(0 0 11px rgba(251, 113, 133, 0.8));
    animation:
        trFishDrift 2.2s ease-in-out infinite,
        trAggressor 1.2s ease-in-out infinite;
}

.tr-aggressor-fixed {
    pointer-events: none;
    animation: trFishRemoved 0.75s ease forwards;
}

@keyframes trFishDrift {
    0%,
    100% {
        margin-top: 0;
    }

    50% {
        margin-top: -9px;
    }
}

@keyframes trAggressor {
    0%,
    100% {
        margin-right: 0;
    }

    50% {
        margin-right: 30px;
    }
}

@keyframes trFishRemoved {
    to {
        opacity: 0;
        transform: translateX(180px) scale(0.65);
    }
}

.tr-stress-lines {
    position: absolute;
    top: 29%;
    right: 31%;
    z-index: 11;
    display: flex;
    gap: 12px;
    color: #fecdd3;
    font-size: 1.45rem;
    font-weight: 1000;
    text-shadow: 0 0 10px rgba(251, 113, 133, 0.8);
    transition: opacity 0.35s ease;
}

.tr-stress-lines span:nth-child(2) {
    transform: translateY(-9px);
}

.tr-stress-hidden {
    opacity: 0;
}

.tr-status-strip {
    position: absolute;
    left: 50%;
    bottom: 3%;
    z-index: 15;
    width: min(86%, 650px);
    padding: 0.68rem 0.9rem;
    transform: translateX(-50%);
    text-align: center;
    color: #e0f2fe;
    font-size: 0.78rem;
    line-height: 1.35;
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-radius: 999px;
    background: rgba(2, 11, 22, 0.74);
    backdrop-filter: blur(8px);
}

.tr-floating-message {
    position: absolute;
    top: 18%;
    left: 50%;
    z-index: 24;
    max-width: min(80%, 460px);
    padding: 0.75rem 1rem;
    transform: translate(-50%, -12px);
    opacity: 0;
    pointer-events: none;
    text-align: center;
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 800;
    border: 1px solid rgba(125, 211, 252, 0.32);
    border-radius: 14px;
    background: rgba(2, 11, 22, 0.88);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.tr-floating-message-active {
    opacity: 1;
    transform: translate(-50%, 0);
}

.tr-floating-message-good {
    border-color: rgba(52, 211, 153, 0.55);
}

.tr-floating-message-bad {
    border-color: rgba(251, 113, 133, 0.58);
}

.tr-screen {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: none;
    place-items: center;
    padding: 1rem;
    background:
        radial-gradient(
            circle at center,
            rgba(8, 47, 73, 0.5),
            rgba(2, 11, 22, 0.84)
        );
    backdrop-filter: blur(7px);
}

.tr-screen-active {
    display: grid;
}

.tr-screen-card {
    width: min(470px, 100%);
    display: grid;
    justify-items: center;
    gap: 1rem;
    padding: clamp(1.25rem, 4vw, 2.4rem);
    text-align: center;
    border: 1px solid rgba(125, 211, 252, 0.26);
    border-radius: 24px;
    background:
        linear-gradient(
            180deg,
            rgba(8, 47, 73, 0.97),
            rgba(3, 23, 42, 0.98)
        );
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tr-screen-card h1,
.tr-screen-card h2,
.tr-screen-card p {
    margin: 0;
}

.tr-screen-card h1 {
    font-size: clamp(2.1rem, 8vw, 4rem);
    line-height: 0.96;
    letter-spacing: -0.055em;
    background:
        linear-gradient(
            135deg,
            #f8fafc,
            #7dd3fc 58%,
            #60a5fa
        );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tr-screen-card h2 {
    font-size: clamp(1.7rem, 6vw, 2.7rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.tr-screen-card p {
    max-width: 40ch;
    color: #c6d6e4;
    line-height: 1.55;
}

.tr-kicker {
    color: #7dd3fc;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tr-controls,
.tr-symptom-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.tr-controls span,
.tr-symptom-list span {
    padding: 0.36rem 0.65rem;
    border: 1px solid rgba(125, 211, 252, 0.14);
    border-radius: 999px;
    color: var(--tr-muted);
    font-size: 0.72rem;
    background: rgba(2, 11, 22, 0.3);
}

.tr-symptom-list span {
    color: #fecdd3;
    border-color: rgba(251, 113, 133, 0.24);
    background: rgba(159, 18, 57, 0.18);
}

.tr-best {
    color: var(--tr-muted);
    font-size: 0.9rem;
}

.tr-best strong {
    color: var(--tr-text);
}

.tr-primary-button,
.tr-secondary-button {
    min-width: min(210px, 100%);
    min-height: 52px;
    padding: 0.8rem 1.4rem;
    font-weight: 800;
    border-radius: 15px;
    cursor: pointer;
}

.tr-primary-button {
    color: #f8fafc;
    border: 1px solid rgba(125, 211, 252, 0.45);
    background:
        linear-gradient(
            135deg,
            #0284c7,
            #2563eb
        );
}

.tr-secondary-button {
    color: #dbeafe;
    border: 1px solid rgba(125, 211, 252, 0.2);
    background: rgba(2, 11, 22, 0.42);
}

.tr-confirm-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.tr-confirm-actions button {
    min-width: 0;
}

.tr-countdown {
    font-size: clamp(3rem, 12vw, 5rem);
    line-height: 1;
    color: #7dd3fc;
}

.tr-stars {
    color: #fbbf24;
    font-size: clamp(2rem, 8vw, 3.2rem);
    letter-spacing: 0.12em;
}

.tr-final-score {
    display: grid;
    justify-items: center;
    gap: 0.14rem;
}

.tr-final-score span,
.tr-results-grid span {
    color: var(--tr-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tr-final-score strong {
    font-size: clamp(2rem, 7vw, 3rem);
}

.tr-results-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.tr-results-grid > div {
    display: grid;
    gap: 0.25rem;
    padding: 0.8rem;
    border: 1px solid rgba(125, 211, 252, 0.14);
    border-radius: 14px;
    background: rgba(2, 11, 22, 0.32);
}

.tr-game-footer {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--tr-muted);
    font-size: 0.77rem;
    background: rgba(3, 23, 42, 0.96);
}

.tr-game-footer b {
    color: #dbeafe;
}

.tr-staging-badge {
    padding: 0.28rem 0.55rem;
    border: 1px solid rgba(52, 211, 153, 0.28);
    border-radius: 999px;
    color: #a7f3d0;
    background: rgba(6, 95, 70, 0.2);
}

.tr-tank-clean .tr-water-haze {
    opacity: 0.1;
}

.tr-filter-healthy .tr-filter-flow {
    width: 56px;
    opacity: 0.82;
    background: rgba(186, 230, 253, 0.78);
    animation: trStrongFlow 0.9s ease-in-out infinite;
}

.tr-heater-fault .tr-heater-light {
    background: #fb7185;
    box-shadow: 0 0 14px rgba(251, 113, 133, 0.9);
    animation: trHeaterWarning 0.65s steps(2, end) infinite;
}

.tr-heater-fixed .tr-heater-light,
.tr-heater-healthy .tr-heater-light {
    background: #34d399;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.8);
    animation: none;
}

.tr-food-fault {
    transform: rotate(8deg);
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.78));
    animation: trFoodWarning 1.1s ease-in-out infinite;
}

.tr-food-fixed {
    transform: rotate(0);
    filter: none;
    animation: none;
}

.tr-aggressor-healthy {
    filter: none;
    animation: trFishDrift 4.6s ease-in-out infinite;
}

.tr-water-healthy {
    opacity: 0.12;
}

@keyframes trStrongFlow {
    0%,
    100% {
        transform: scaleX(0.82);
    }

    50% {
        transform: scaleX(1);
    }
}

@keyframes trHeaterWarning {
    0%,
    45% {
        opacity: 1;
    }

    46%,
    100% {
        opacity: 0.25;
    }
}

@keyframes trFoodWarning {
    0%,
    100% {
        margin-top: 0;
    }

    50% {
        margin-top: 4px;
    }
}

@media (max-width: 620px) {
    body {
        background: #020b16;
    }

    .tr-topbar {
        min-height: 58px;
        padding:
            max(0.55rem, env(safe-area-inset-top))
            0.72rem
            0.55rem;
    }

    .tr-brand img {
        width: 35px;
        height: 35px;
    }

    .tr-brand small {
        display: none;
    }

    .tr-icon-button {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .tc-game-back {
        min-height: 38px;
        padding: 0.5rem 0.65rem;
        border-radius: 11px;
    }

    .tc-game-back span:last-child {
        display: none;
    }


    .tr-main {
        display: block;
        padding: 0;
    }

    .tr-game-card {
        width: 100%;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .tr-hud-box {
        min-height: 58px;
        padding: 0.45rem 0.25rem;
    }

    .tr-hud-box span {
        font-size: 0.55rem;
    }

    .tr-game-wrap {
        height: calc(100dvh - 175px);
        min-height: 500px;
    }

    .tr-status-strip {
        bottom: 2.5%;
        width: 92%;
        padding: 0.58rem 0.7rem;
        font-size: 0.67rem;
        border-radius: 14px;
    }

    .tr-filter {
        right: 3%;
        transform: scale(0.86);
        transform-origin: top right;
    }

    .tr-heater {
        left: 3%;
        transform: scale(0.86);
        transform-origin: top left;
    }

    .tr-syphon {
        right: 11%;
        transform: scale(0.82);
        transform-origin: bottom right;
    }

    .tr-food {
        top: 7%;
        left: 42%;
        transform: scale(0.84);
    }

    .tr-fish-one {
        left: 22%;
    }

    .tr-fish-two {
        left: 44%;
    }

    .tr-aggressor {
        right: 18%;
    }

    .tr-game-footer {
        padding:
            0.65rem
            0.7rem
            max(0.65rem, env(safe-area-inset-bottom));
    }

    .tr-game-footer > span:first-child {
        display: none;
    }

    .tr-staging-badge {
        margin-left: auto;
    }

    .tr-screen {
        position: fixed;
        padding:
            max(0.75rem, env(safe-area-inset-top))
            0.75rem
            max(0.75rem, env(safe-area-inset-bottom));
    }

    .tr-screen-card {
        max-height: calc(100dvh - 1.5rem);
        overflow-y: auto;
        padding: 1.25rem;
        border-radius: 20px;
    }

    .tr-confirm-actions {
        grid-template-columns: 1fr;
    }
}


/* -------------------------------------------------
   TanksConnected arcade standalone viewport owner
-------------------------------------------------- */

@media (display-mode: standalone) and (max-width: 720px) {
    html,
    body {
        width: 100%;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .tr-shell {
        width: 100%;
        height: 100svh;
        min-height: 0;
        max-height: 100svh;
        overflow: hidden;
    }

    .tr-topbar {
        flex: 0 0 auto;
        padding-top: max(
            0.55rem,
            env(safe-area-inset-top, 0px)
        );
    }

    .tr-main {
        flex: 1 1 auto;
        min-height: 0;
        display: block;
        overflow: hidden;
        padding: 0;
    }

    .tr-game-card {
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border: 0;
        border-radius: 0;
    }

    .tr-hud {
        flex: 0 0 auto;
    }

    .tr-game-wrap {
        flex: 1 1 0;
        width: 100%;
        height: 0;
        min-height: 0;
        max-height: none;
        overflow: hidden;
    }

    .tr-game-footer {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
