.coppi-shell {
    --coppi-ink: #edf8fb;
    --coppi-muted: #a9c2cd;
    --coppi-panel: rgba(5, 18, 27, 0.88);
    --coppi-panel-solid: #0c1d27;
    --coppi-line: rgba(143, 213, 225, 0.26);
    --coppi-accent: #ffb845;
    --coppi-accent-2: #73dfbd;
    --coppi-danger: #ff786d;
    position: relative;
    width: min(1600px, calc(100% - 24px));
    margin: 28px auto;
    overflow: hidden;
    border: 1px solid rgba(167, 226, 236, 0.18);
    border-radius: 30px;
    background: #07141d;
    color: var(--coppi-ink);
    box-shadow: 0 30px 90px rgba(2, 12, 19, 0.3);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    isolation: isolate;
}

.coppi-shell::before {
    position: absolute;
    z-index: -1;
    inset: -35% 48% auto -10%;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 145, 184, 0.25), rgba(56, 145, 184, 0));
    content: "";
    pointer-events: none;
}

.coppi-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.55fr);
    gap: 32px;
    align-items: end;
    padding: clamp(28px, 4vw, 58px);
    background:
        linear-gradient(120deg, rgba(4, 15, 23, 0.96), rgba(12, 54, 78, 0.9)),
        radial-gradient(circle at 76% 24%, rgba(255, 185, 69, 0.2), transparent 34%);
    border-bottom: 1px solid var(--coppi-line);
}

.coppi-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
    color: #8fe6d0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.coppi-kicker::before {
    width: 28px;
    height: 2px;
    background: currentColor;
    content: "";
}

.coppi-hero h1 {
    max-width: 900px;
    margin: 0;
    color: #fff;
    font-size: clamp(2.65rem, 7vw, 6.2rem);
    font-weight: 850;
    letter-spacing: -0.055em;
    line-height: 0.88;
    text-wrap: balance;
}

.coppi-hero p {
    max-width: 760px;
    margin: 22px 0 0;
    color: #c8e0e8;
    font-size: clamp(1rem, 1.6vw, 1.22rem);
    line-height: 1.7;
}

.coppi-owner {
    position: relative;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--coppi-line);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
    color: #d9edf2;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.coppi-owner::after {
    position: absolute;
    inset: auto -25px -42px auto;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 184, 69, 0.13);
    content: "";
}

.coppi-owner-label {
    display: block;
    margin-bottom: 8px;
    color: var(--coppi-accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.coppi-owner strong {
    display: block;
    color: #fff;
    font-size: 1.12rem;
}

.coppi-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px clamp(16px, 3vw, 34px);
    overflow-x: auto;
    border-bottom: 1px solid var(--coppi-line);
    background: #091923;
    scrollbar-width: thin;
}

.coppi-nav a {
    flex: 0 0 auto;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #bcd2da;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    transition: 160ms ease;
}

.coppi-nav a:hover,
.coppi-nav a:focus-visible {
    border-color: var(--coppi-line);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.coppi-game-stage {
    position: relative;
    min-height: 520px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #081722;
}

.coppi-game-stage::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(circle at center, transparent 54%, rgba(0, 8, 14, 0.28) 100%);
    content: "";
    pointer-events: none;
}

.coppi-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
}

.coppi-start-panel {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: min(510px, calc(100% - 32px));
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid rgba(163, 225, 235, 0.32);
    border-radius: 24px;
    background: linear-gradient(150deg, rgba(7, 22, 32, 0.96), rgba(8, 34, 47, 0.91));
    box-shadow: 0 24px 70px rgba(0, 9, 15, 0.54), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    transform: translate(-50%, -50%);
    backdrop-filter: blur(18px);
}

.coppi-start-panel[hidden],
.coppi-hud[hidden],
.coppi-controls[hidden],
.coppi-touch[hidden] {
    display: none !important;
}

.coppi-panel-eyebrow {
    margin: 0 0 7px;
    color: var(--coppi-accent-2);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.coppi-start-panel h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.55rem, 4vw, 2.2rem);
    letter-spacing: -0.03em;
}

.coppi-start-copy {
    margin: 9px 0 22px;
    color: var(--coppi-muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.coppi-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.coppi-field {
    display: block;
    margin: 0;
}

.coppi-field--wide {
    grid-column: 1 / -1;
}

.coppi-field-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    color: #d8e9ee;
    font-size: 0.78rem;
    font-weight: 750;
}

.coppi-field output {
    color: var(--coppi-accent);
    font-variant-numeric: tabular-nums;
}

.coppi-start-panel select {
    width: 100%;
    min-height: 46px;
    padding: 0 39px 0 13px;
    border: 1px solid rgba(148, 205, 215, 0.25);
    border-radius: 12px;
    background: rgba(1, 12, 19, 0.6);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.coppi-start-panel input[type="range"] {
    width: 100%;
    accent-color: var(--coppi-accent);
}

.coppi-primary,
.coppi-controls button,
.coppi-touch button {
    appearance: none;
    border: 0;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.coppi-primary {
    position: relative;
    width: 100%;
    min-height: 54px;
    margin-top: 22px;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffc65f, #f5a826);
    color: #271902;
    box-shadow: 0 11px 28px rgba(245, 168, 38, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.58);
    font-weight: 850;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.coppi-primary:hover,
.coppi-primary:focus-visible {
    box-shadow: 0 14px 35px rgba(245, 168, 38, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    transform: translateY(-1px);
}

.coppi-primary:active {
    transform: translateY(1px);
}

.coppi-start-tip {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 16px 0 0;
    color: #a8c5ce;
    font-size: 0.8rem;
    line-height: 1.45;
}

.coppi-start-tip::before {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--coppi-accent-2);
    box-shadow: 0 0 0 5px rgba(115, 223, 189, 0.1);
    content: "";
}

.coppi-hud {
    position: absolute;
    z-index: 4;
    top: 16px;
    right: 16px;
    left: 16px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    pointer-events: none;
}

.coppi-hud-item {
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid rgba(150, 214, 224, 0.22);
    border-radius: 12px;
    background: rgba(2, 15, 24, 0.64);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
}

.coppi-hud-item span {
    display: block;
    overflow: hidden;
    color: #91b7c0;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.coppi-hud-item strong {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #f2fbfb;
    font-size: clamp(0.76rem, 1.3vw, 1rem);
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coppi-controls {
    position: absolute;
    z-index: 5;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    max-width: min(690px, calc(100% - 32px));
}

.coppi-controls button {
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid rgba(153, 217, 227, 0.24);
    border-radius: 11px;
    background: rgba(3, 17, 26, 0.76);
    color: #eaf8fa;
    font-size: 0.76rem;
    font-weight: 750;
    backdrop-filter: blur(10px);
    transition: 150ms ease;
}

.coppi-controls button:hover,
.coppi-controls button:focus-visible {
    border-color: rgba(255, 190, 78, 0.7);
    background: rgba(13, 41, 53, 0.88);
    color: #fff;
}

.coppi-message {
    position: absolute;
    z-index: 7;
    top: 18%;
    left: 50%;
    max-width: min(560px, calc(100% - 34px));
    padding: 11px 16px;
    border: 1px solid rgba(255, 199, 95, 0.4);
    border-radius: 999px;
    background: rgba(3, 18, 27, 0.86);
    color: #fff4d6;
    box-shadow: 0 10px 30px rgba(0, 8, 14, 0.28);
    font-size: 0.86rem;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, -12px);
    transition: opacity 180ms ease, transform 180ms ease;
    backdrop-filter: blur(10px);
}

.coppi-message.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.coppi-touch {
    position: absolute;
    z-index: 6;
    right: auto;
    bottom: 15px;
    left: 15px;
    display: none;
    grid-template-columns: repeat(4, 54px);
    gap: 6px;
    touch-action: none;
}

.coppi-touch-group {
    display: contents;
}

.coppi-touch button {
    min-width: 54px;
    min-height: 46px;
    padding: 4px 7px;
    border: 1px solid rgba(156, 218, 227, 0.28);
    border-radius: 12px;
    background: rgba(3, 18, 28, 0.78);
    color: #f2fbfc;
    font-size: 0.72rem;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.coppi-touch button.is-active,
.coppi-touch button:active {
    border-color: var(--coppi-accent);
    background: rgba(255, 184, 69, 0.88);
    color: #241500;
}

.coppi-help {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: start;
    padding: 20px clamp(20px, 3vw, 38px);
    border-top: 1px solid var(--coppi-line);
    background: #0b202c;
}

.coppi-help-title {
    color: var(--coppi-accent);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.coppi-key-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: #bad1d8;
    font-size: 0.84rem;
}

.coppi-key-grid span {
    display: inline-flex;
    gap: 7px;
    align-items: center;
}

.coppi-key-grid kbd {
    min-width: 28px;
    padding: 4px 7px;
    border: 1px solid rgba(175, 225, 232, 0.22);
    border-bottom-color: rgba(175, 225, 232, 0.42);
    border-radius: 7px;
    background: #06141d;
    color: #fff;
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.05);
    font: 750 0.72rem ui-monospace, SFMono-Regular, Menlo, monospace;
    text-align: center;
}

.coppi-copyright {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 15px clamp(20px, 3vw, 38px) 20px;
    border-top: 1px solid rgba(153, 215, 224, 0.1);
    background: #071720;
    color: #8faab3;
    font-size: 0.76rem;
    line-height: 1.55;
}

.coppi-copyright::before {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--coppi-accent);
    content: "";
}

.coppi-info {
    --info-ink: #142b35;
    --info-muted: #607783;
    width: min(1120px, calc(100% - 28px));
    margin: 28px auto;
    overflow: hidden;
    border: 1px solid #dce9ed;
    border-radius: 26px;
    background: #f8fbfc;
    color: var(--info-ink);
    box-shadow: 0 24px 70px rgba(28, 63, 76, 0.1);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.coppi-info-hero {
    padding: clamp(30px, 5vw, 64px);
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 191, 83, 0.22), transparent 28%),
        linear-gradient(130deg, #0c2b3c, #17627a);
    color: #fff;
}

.coppi-info-kicker {
    display: block;
    margin-bottom: 10px;
    color: #84e3c7;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.coppi-info h1 {
    margin: 0;
    color: inherit;
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    letter-spacing: -0.05em;
    line-height: 0.94;
}

.coppi-info-hero p {
    max-width: 760px;
    margin: 18px 0 0;
    color: #c9e5ec;
    font-size: 1.06rem;
    line-height: 1.72;
}

.coppi-info-body {
    padding: clamp(24px, 4vw, 52px);
}

.coppi-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.coppi-card {
    padding: 22px;
    border: 1px solid #dce9ed;
    border-radius: 17px;
    background: #fff;
}

.coppi-card-number {
    display: inline-grid;
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
    place-items: center;
    border-radius: 10px;
    background: #e8f7f3;
    color: #16765d;
    font-weight: 850;
}

.coppi-card h2,
.coppi-card h3 {
    margin: 0 0 8px;
    color: #163340;
    font-size: 1.12rem;
}

.coppi-card p,
.coppi-card li,
.coppi-info-body p,
.coppi-info-body li {
    color: var(--info-muted);
    line-height: 1.7;
}

.coppi-card p:last-child,
.coppi-info-body p:last-child {
    margin-bottom: 0;
}

.coppi-callout {
    margin-top: 20px;
    padding: 20px 22px;
    border-left: 4px solid #f0ad34;
    border-radius: 0 14px 14px 0;
    background: #fff6e4;
    color: #65440e;
}

.coppi-page-owner {
    width: min(1120px, calc(100% - 28px));
    margin: 12px auto 32px;
    color: #71868e;
    font-size: 0.78rem;
    text-align: center;
}

@media (hover: none), (pointer: coarse) {
    .coppi-touch {
        display: grid !important;
    }

    .coppi-controls {
        bottom: 74px;
    }
}

@media (max-width: 960px) {
    .coppi-hero {
        grid-template-columns: 1fr;
    }

    .coppi-owner {
        max-width: 520px;
    }

    .coppi-hud {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    .coppi-shell {
        width: min(100%, calc(100% - 12px));
        margin: 12px auto;
        border-radius: 20px;
    }

    .coppi-hero {
        gap: 22px;
        padding: 28px 22px;
    }

    .coppi-hero h1 {
        font-size: clamp(2.6rem, 15vw, 4.6rem);
    }

    .coppi-game-stage {
        min-height: 690px;
        aspect-ratio: auto;
    }

    .coppi-start-panel {
        top: 52%;
        padding: 22px 18px;
    }

    .coppi-settings-grid {
        grid-template-columns: 1fr;
    }

    .coppi-field--wide {
        grid-column: auto;
    }

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

    .coppi-hud-item {
        padding: 7px 9px;
    }

    .coppi-controls {
        top: 180px;
        right: 10px;
        bottom: auto;
        max-width: 144px;
    }

    .coppi-controls button {
        flex: 1 1 66px;
        min-height: 37px;
        padding: 0 8px;
        font-size: 0.67rem;
    }

    .coppi-touch {
        right: 10px;
        bottom: 12px;
        left: 10px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .coppi-touch button {
        min-width: 0;
        min-height: 48px;
    }

    .coppi-help {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .coppi-key-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

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

@media (max-width: 430px) {
    .coppi-game-stage {
        min-height: 740px;
    }

    .coppi-hud {
        right: 8px;
        left: 8px;
    }

    .coppi-key-grid {
        grid-template-columns: 1fr;
    }

    .coppi-message {
        top: 27%;
        border-radius: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .coppi-primary,
    .coppi-controls button,
    .coppi-message,
    .coppi-nav a {
        transition: none;
    }
}


.coppi-game-stage:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
}

.coppi-game-stage:fullscreen .coppi-start-panel {
    width: min(540px, calc(100% - 32px));
}

.coppi-game-stage:fullscreen .coppi-hud,
.coppi-game-stage:fullscreen .coppi-controls,
.coppi-game-stage:fullscreen .coppi-touch,
.coppi-game-stage:fullscreen .coppi-message {
    z-index: 6;
}
