* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: #11222a;
    background:
        radial-gradient(circle at top left, rgba(255, 214, 102, 0.28), transparent 24%),
        radial-gradient(circle at bottom right, rgba(44, 169, 188, 0.20), transparent 26%),
        linear-gradient(180deg, #f7f2e8 0%, #ece4d7 100%);
}

.shell {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 40px;
}

.masthead,
.playfield-shell,
.controls-panel {
    border: 1px solid rgba(17, 34, 42, 0.12);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 60px rgba(35, 45, 54, 0.12);
}

.masthead {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    padding: 28px 30px;
}

.eyebrow,
.panel-eyebrow {
    margin: 0 0 10px;
    color: #1f7a67;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 600;
    letter-spacing: 0.02em;
}

h1 {
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    line-height: 0.95;
}

h2 {
    font-size: 1.8rem;
}

.intro,
.panel-copy {
    color: #5e6c73;
    line-height: 1.6;
}

.intro {
    max-width: 560px;
    margin: 14px 0 0;
}

.panel-copy {
    margin: 12px 0 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1f7a67, #6dc9b0);
    color: #f8fcfb;
    font-weight: 700;
    text-decoration: none;
}

.playfield-shell {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(260px, 1fr);
    gap: 22px;
    margin-top: 20px;
    padding: 20px;
    align-items: start;
}

.game-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

canvas {
    display: block;
    width: 300px;
    max-width: 100%;
    height: auto;
    border: 1px solid #111;
    border-radius: 20px;
    background: #ffffff;
}

.controls-panel {
    padding: 24px;
}

.control-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.control-row {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(17, 34, 42, 0.10);
    border-radius: 18px;
    background: rgba(247, 250, 250, 0.88);
}

.keycap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(17, 34, 42, 0.14);
    border-radius: 12px;
    background: #ffffff;
    font-weight: 700;
}

#playbutton {
    width: 140px;
    height: 52px;
    display: block;
    margin-top: 14px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    color: #f8fcfb;
    background: linear-gradient(135deg, #1f7a67, #6dc9b0);
    cursor: pointer;
}

#playbutton:disabled {
    cursor: default;
    opacity: 0.65;
}

@media (max-width: 820px) {
    .shell {
        width: min(100% - 18px, 1080px);
        padding-top: 18px;
        padding-bottom: 24px;
    }

    .masthead {
        align-items: start;
        flex-direction: column;
        padding: 22px;
    }

    .playfield-shell {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .controls-panel {
        padding: 18px;
    }
}
