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

:root {
    --font-display: "Press Start 2P", monospace;
}

body {
    background: #000;
    color: #fff;
    font-family: Helvetica, Arial, sans-serif;
}

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    gap: 1rem;
    padding: 2rem;
    box-sizing: border-box;
}

h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

#canvas-holder {
    position: relative;
    width: min(350px, 100%);
    aspect-ratio: 9 / 20;
    background: #000;
}

.press-start-prompt {
    position: absolute;
    top: 60%;
    left: 50%;
    z-index: 2;
    pointer-events: none;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.press-start-prompt.is-display-none {
    display: none;
}

.press-start-prompt__frame {
    position: relative;
    width: 0;
    height: 64px;
    padding: 5px;
    border: 4px solid #000;
    background: #fff;
    box-sizing: border-box;
    overflow: hidden;
    transition: width 0.6s ease;
}

.press-start-prompt__inner {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: var(--font-display);
    font-size: 16px;
    line-height: 1;
    text-align: center;
    box-sizing: border-box;
}

.press-start-prompt__label {
    position: absolute;
    left: 50%;
    display: block;
    width: var(--press-start-content-width, max-content);
    padding: 0 24px;
    transform: translateX(-50%);
    text-transform: uppercase;
}

.press-start-prompt.is-label-hidden .press-start-prompt__label {
    visibility: hidden;
}

canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    outline: 1px solid #1f1f1f;
}

.about-screen {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: none;
    flex-direction: column;
    background: #0d0d0d;
    font-family: var(--font-display);
    color: #ffffff;
}

.about-screen.is-visible {
    display: flex;
}

.about-screen__header {
    position: relative;
    flex: 0 0 auto;
    padding-top: 22px;
}

.about-back-icon {
    position: absolute;
    top: 22px;
    left: 24px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    line-height: 0;
    cursor: pointer;
}

.about-back-icon img {
    display: block;
    width: 100%;
    height: 100%;
}

.about-tabs {
    display: flex;
    width: min(300px, 84%);
    margin: 40px auto 0;
    border-bottom: 2px solid #3a3a3a;
}

.about-tab {
    flex: 1 1 0;
    display: flex;
    justify-content: center;
    padding: 0 0 12px;
    margin-bottom: -2px;
    background: none;
    border: none;
    border-bottom: 4px solid transparent;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.about-tab.is-active {
    border-bottom-color: #ffffff;
}

.about-screen__scroll {
    flex: 1;
    overflow-y: auto;
    padding: 34px 16px 48px;
    box-sizing: border-box;
    text-align: center;
    -webkit-overflow-scrolling: touch;
}

.about-panel.is-hidden {
    display: none;
}

.about-links {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 48px;
}

.about-link {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: color 120ms ease;
}

.about-link:hover,
.about-link:focus-visible {
    color: #f46f99;
    outline: none;
}

.about-body p {
    margin: 0 0 1.8em;
    font-size: 13px;
    line-height: 1.5;
}

.about-body p:last-child {
    margin-bottom: 0;
}

.merch-heading {
    margin-bottom: 36px;
    font-size: 15px;
    line-height: 1.4;
}

.merch-heading p {
    margin: 0;
}

.merch-heading p.is-pink {
    color: #f46f99;
}

.merch-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.merch-item {
    display: block;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
}

.merch-item__card {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 332 / 268;
    box-sizing: border-box;
    padding: 30px;
    border: 4px solid #ffffff;
    background: #000000;
    overflow: hidden;
}

.merch-item__img {
    display: block;
    max-width: 90%;
    max-height: 90%;
}

.merch-item__caption {
    display: block;
    margin-top: 16px;
    font-size: 12px;
    line-height: 1.4;
    transition: color 120ms ease;
}

.merch-item:hover .merch-item__caption,
.merch-item:focus-visible .merch-item__caption {
    color: #f46f99;
    outline: none;
}

.about-screen__back {
    pointer-events: auto;
    border: 4px solid #e7e7e7;
    background: #0d0d0d;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1;
    padding: 16px 24px;
    cursor: pointer;
}

.settings-screen {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: none;
    flex-direction: column;
    background: #0d0d0d;
    font-family: var(--font-display);
    color: #ffffff;
}

.settings-screen.is-visible {
    display: flex;
}

.settings-screen__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

.settings-screen__icon {
    display: block;
    width: 36px;
    height: auto;
    margin: 4px 0 0;
}

.settings-rows {
    margin: auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.settings-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.settings-row__label {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.settings-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 62%;
    max-width: 217px;
    height: 10px;
    margin: 0;
    background: #343434;
    border: 3px solid rgba(52, 52, 52, 0.27);
    box-sizing: border-box;
    outline: none;
    cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 22px;
    background: url("assets/img/illustrations/illustration-stink-stamp.png") center / contain no-repeat;
    border: none;
    cursor: pointer;
}

.settings-slider::-moz-range-thumb {
    width: 24px;
    height: 22px;
    background: url("assets/img/illustrations/illustration-stink-stamp.png") center / contain no-repeat;
    border: none;
    border-radius: 0;
    cursor: pointer;
}

.settings-paddle-btn {
    width: 101px;
    height: 23px;
    padding: 0;
    background: none;
    border: none;
    box-sizing: border-box;
    cursor: pointer;
}

.settings-screen__footer {
    position: relative;
    z-index: 6;
    display: flex;
    justify-content: center;
    padding: 0 16px 40px;
}

.paddle-modal {
    position: absolute;
    /* Stop short of the footer so the panel centers over the same area as the
       settings controls (which sit above the Back button), instead of the whole
       screen — keeps the panel aligned over MUSIC/SFX/PADDLE. */
    top: 0;
    left: 0;
    right: 0;
    bottom: 90px;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.paddle-modal.is-visible {
    display: flex;
}

.paddle-modal__panel {
    width: min(284px, calc(100% - 32px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 24px;
    background: #0d0d0d;
    border: 4px solid #e7e7e7;
    box-sizing: border-box;
}

.paddle-modal__title {
    margin: 0;
    font-size: 16px;
    line-height: 1;
    color: #ffffff;
}

.paddle-modal__options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.paddle-option {
    position: relative;
    width: 101px;
    height: 23px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

/* The selection stamp sits to the right of the swatch without shifting it,
   so the swatches stay centered in the panel (matches the Figma layout). */
.paddle-option__marker {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 14px;
    width: 24px;
    height: auto;
    visibility: hidden;
}

.paddle-option.is-selected .paddle-option__marker {
    visibility: visible;
}

.paddle-swatch {
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.paddle-swatch--outlined {
    background: #000000;
    border: 3px solid #ffffff;
}

.paddle-swatch--solid {
    background: #ffffff;
    border-left: 1.5px solid #c1c1c1;
    border-top: 1.5px solid #c1c1c1;
}

.paddle-swatch--segmented {
    display: flex;
    gap: 2px;
    background: none;
}

.paddle-swatch--segmented i {
    flex: 1 0 0;
    background: #ffffff;
    border-left: 1.5px solid #c1c1c1;
    border-top: 1.5px solid #c1c1c1;
}

.popup-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
    box-sizing: border-box;
    z-index: 3;
}

.popup-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.popup-overlay.is-level-intro {
    /* Start below the top bar (TopBar.BAR_HEIGHT = 38px) so the tinted
       overlay doesn't clip into the bar's icons/score. */
    top: 38px;
    /* Flex centering with no horizontal padding so the auto-width panel
       stays centered on the canvas. The grid + side padding shrank the
       centering area below the panel's width (the pixel font makes it
       wide), which pinned the panel left and pushed it off-center. */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    background: rgba(13, 13, 13, 0.75);
    cursor: pointer;
}

.popup-panel {
    width: min(100%, 320px);
    padding: 1.5rem;
    border: 1px solid #ffffff;
    background: #111111;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

.popup-panel.is-level-intro {
    width: auto;
    padding: 20px 28px;
    border: 2.8px solid #ffffff;
    background: #0d0d0d;
    box-shadow: none;
    text-align: center;
    font-family: var(--font-display);
    color: #ffffff;
    font-size: 17px;
    line-height: 1.4;
}

.popup-title {
    margin: 0 0 0.75rem;
    font-size: 1.4rem;
}

.popup-panel.is-level-intro .popup-title {
    margin: 0;
    font-size: inherit;
    font-weight: normal;
    text-transform: uppercase;
    white-space: nowrap;
}

.popup-subtitle {
    display: none;
    margin: 0;
}

.popup-panel.is-level-intro .popup-subtitle {
    display: block;
    font-size: inherit;
    text-transform: uppercase;
    white-space: nowrap;
}

.popup-image {
    display: block;
    width: 100%;
    max-height: 220px;
    margin: 0 0 1rem;
    object-fit: contain;
    background: #000000;
}

.popup-message {
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.popup-panel.is-level-intro .popup-message,
.popup-panel.is-level-intro .popup-image,
.popup-panel.is-level-intro .popup-action {
    display: none;
}

.popup-action {
    border: 1px solid #ffffff;
    padding: 0.65rem 1rem;
    background: transparent;
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}
