/* MINISTRY OF MINOR THINGS — RECEPTION GAME: PIXEL SCENE AND CONTROLS */
/* Rules for each selector are grouped with its responsive variants. */

.game {
    background: #000;
    border: 5px solid var(--blue);
    box-shadow: inset 2px 2px var(--signal),
        8px 8px var(--void);
    outline: 2px solid var(--steel);
    --game-menu-size: clamp(0.94rem, 1.4vw, 1.25rem);
    --game-status-size: clamp(0.88rem, 1.35vw, 1.1875rem);
    --game-dialogue-size: clamp(1.1875rem, 2vw, 1.5625rem);
    --game-button-size: clamp(1.125rem, 1.6vw, 1.25rem);
    --game-caption-size: clamp(1rem, 1.35vw, 1.125rem);
    --game-menu-title-size: clamp(0.625rem, 0.9vw, 0.8125rem);
    --game-speaker-size: clamp(0.625rem, 0.8vw, 0.75rem);
    font-family: var(--font-terminal, "Ministry", monospace);
}

@media (max-width: 700px) {
    .game {
        border-width: 3px;
        box-shadow: 0 0 0 2px #555,
                4px 4px #000;
    }
}

.game-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--blue);
    color: var(--paper);
    padding: 8px 12px;
    gap: 10px;
    border-bottom: 2px solid var(--steel);
}

@media (max-width: 700px) {
    .game-menu {
        padding: 8px 6px;
        flex-wrap: wrap;
    }
}

.game-menu > span {
    font-weight: bold;
    font-family: var(--font-display, monospace);
    font-size: var(--game-menu-title-size);
    line-height: 1.6;
    letter-spacing: 0;
}

.game-menu nav {
    display: flex;
    gap: 22px;
}

@media (max-width: 700px) {
    .game-menu nav {
        gap: 12px;
        flex-wrap: wrap;
    }
}

.game-menu button {
    border: 0;
    background: none;
    color: var(--paper);
    padding: 0;
}

.game-menu button:hover {
    background: var(--amber);
    color: var(--navy);
}

.status {
    display: flex;
    justify-content: space-between;
    background: var(--navy);
    color: var(--silver);
    padding: 7px 12px;
    border-bottom: 3px solid var(--void);
    font-size: var(--game-status-size);
    line-height: 1.2;
}

@media (max-width: 700px) {
    .status {
        padding: 6px;
    }
}

.status span:nth-child(2) {
    color: var(--amber);
}

.status-end {
    color: var(--silver);
}

@media (max-width: 380px) {
    .status-end {
        display: none;
    }
}

.scene {
    position: relative;
    width: 100%;
    aspect-ratio: 640 / 360;
    container-type: inline-size;
    overflow: hidden;
    background: var(--navy);
    cursor: crosshair;
    --scene-sign-title: 1.5cqw;
    --scene-sign-subtitle: 1.8cqw;
    --scene-department-label: 2.5625cqw;
    --scene-department-subtitle: 1.4cqw;
    --scene-department-status: 1.8375cqw;
    --scene-character-label: 2.4cqw;
    --scene-room-caption: 1.09375cqw;
    --scene-hit-area-label: 2.4cqw;
    font-family: var(--font-terminal, "Ministry", monospace);
}

.scene > img,
.scene > canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    object-fit: fill;
}

.scene > canvas {
    opacity: 0;
}

.scene.ready > canvas {
    opacity: 1;
}

.scene.ready > img {
    opacity: 0;
}

.wall-sign {
    position: absolute;
    top: 14%;
    left: 30%;
    width: 40%;
    text-align: center;
    pointer-events: none;
}

.wall-sign-title {
    color: var(--amber);
    line-height: 1.5;
    letter-spacing: 0.05em;
    font-family: var(--font-display, monospace);
    font-size: var(--scene-sign-title);
}

.wall-sign-subtitle {
    color: var(--silver);
    line-height: 1.6;
    letter-spacing: 0.03em;
    margin-top: 0.2cqw;
    font-size: var(--scene-sign-subtitle);
}

.hotspot {
    position: absolute;
    color: var(--navy);
    background: transparent;
    border: 0.3125cqw solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
    text-shadow: none;
    min-width: 0;
    min-height: 0;
    cursor: crosshair;
    padding: 0;
    outline-offset: -0.46875cqw;
    font-size: var(--scene-department-subtitle);
}

.hotspot > span {
    padding: 0.3125cqw 0.15625cqw;
    border: 0;
    white-space: nowrap;
    box-shadow: none;
    position: absolute;
    top: 0;
    color: var(--navy);
    width: 100%;
    font-size: var(--scene-department-label);
}

.hotspot > small {
    position: absolute;
    top: 2.5cqw;
    left: 0;
    width: 100%;
    color: var(--ink-blue);
    font-weight: normal;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    font-size: var(--scene-department-subtitle);
}

.hotspot b {
    color: var(--amber);
    font-weight: normal;
    padding: 0cqw 0.625cqw;
    margin-top: 6.43125cqw;
    white-space: nowrap;
    font-size: var(--scene-department-status);
}

.hotspot:hover,
.hotspot:focus-visible {
    border: 0.3125cqw dashed var(--amber);
    background: #feb80018;
}

.hotspot:hover span {
    color: var(--navy);
    background: var(--amber);
    text-shadow: none;
}

.hotspot[class*="department-"]:hover span {
    background: transparent;
    color: var(--copper);
}

.department-1 {
    left: 2.65625%;
    top: 26.66667%;
    width: 15.93750%;
    height: 42.77778%;
}

.department-2 {
    left: 22.34375%;
    top: 26.66667%;
    width: 15.93750%;
    height: 42.77778%;
}

.department-3 {
    left: 42.03125%;
    top: 26.66667%;
    width: 15.93750%;
    height: 42.77778%;
}

.department-4 {
    left: 61.71875%;
    top: 26.66667%;
    width: 15.93750%;
    height: 42.77778%;
}

.department-5 {
    left: 81.40625%;
    top: 26.66667%;
    width: 15.93750%;
    height: 42.77778%;
}

.department-2 b,
.department-3 b {
    color: var(--copper);
}

.clerk {
    position: absolute;
    left: 73%;
    top: 58.7%;
    width: 13%;
    height: 23%;
    z-index: 2;
    padding: 0;
    background: transparent;
    overflow: visible;
}

.clerk > img {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    transform: translateX(-50%);
    image-rendering: pixelated;
    pointer-events: none;
}

.clerk > span {
    position: absolute;
    top: 100%;
    left: 50%;
    width: auto;
    transform: translateX(-50%);
    padding: 1px 4px;
    color: var(--paper);
    background: var(--blue);
    border: 1px solid var(--amber);
    white-space: nowrap;
    pointer-events: none;
    text-transform: uppercase;
    font-size: var(--scene-character-label);
}

.clerk:hover > img {
    filter: none;
}

.plant {
    left: 22.5%;
    top: 70%;
    width: 13%;
    height: 30%;
}

.plant span,
.banana span,
.alarm span {
    opacity: 0;
    background: var(--navy);
    color: var(--amber);
    width: auto;
    z-index: 4;
    text-transform: uppercase;
    font-size: var(--scene-hit-area-label);
}

.plant:hover span,
.banana:hover span,
.alarm:hover span,
.hotspot:focus-visible span {
    opacity: 1;
}

.banana {
    left: 43%;
    top: 83%;
    width: 8%;
    height: 8%;
}

.banana span {
    top: -3.125cqw;
}

.alarm {
    left: 95%;
    top: 47%;
    width: 4%;
    height: 10%;
}

.alarm span {
    top: -3.75cqw;
}

.room-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    background: var(--navy);
    color: var(--silver);
    padding: 0.46875cqw 1.09375cqw;
    pointer-events: none;
    font-size: var(--scene-room-caption);
}

.department-2 b,
.department-3 b,
.department-4 b,
.department-5 b {
    color: var(--silver);
}

.narrator {
    border-block: 3px solid var(--silver);
    display: flex;
    padding: 13px 17px;
    gap: 17px;
    min-height: 120px;
    background: var(--navy);
    color: var(--paper);
    align-items: center;
    border: 3px solid var(--amber);
    margin: 8px;
    box-shadow: 3px 3px var(--void);
}

@media (max-width: 700px) {
    .narrator {
        padding: 10px;
        gap: 10px;
        min-height: 130px;
        margin: 5px;
    }
}

.narrator-icon {
    color: var(--amber);
    align-self: start;
    margin-top: 9px;
    font-size: 1.75rem;
}

@media (max-width: 700px) {
    .narrator-icon {
        font-size: 1.375rem;
    }
}

#speaker {
    color: var(--amber);
    letter-spacing: 1px;
    font-family: var(--font-display, monospace);
    font-size: var(--game-speaker-size);
    line-height: 1.5;
}

#dialogue {
    margin: 7px 0 0;
    line-height: 1.25;
    font-size: var(--game-dialogue-size);
}

@media (max-width: 700px) {
    #dialogue {
        line-height: 1.8;
    }
}

.continue {
    color: var(--amber);
    align-self: end;
    margin-left: auto;
    animation: blink 1.1s steps(1) infinite;
}

.controls {
    padding: 16px 18px 18px;
    background: var(--blue);
    position: relative;
    border-top: 5px solid var(--navy);
    box-shadow: inset 3px 3px var(--signal),
        inset -3px -3px var(--navy);
}

@media (max-width: 700px) {
    .controls {
        padding: 13px 10px;
    }
}

.verbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 700px) {
    .verbs {
        gap: 7px;
    }
}

.verbs button {
    border: 3px solid var(--amber);
    box-shadow: 3px 3px var(--void);
    background: var(--blue);
    color: var(--paper);
    padding: 10px clamp(8px, 2vw, 24px);
    min-height: 46px;
    font-size: var(--game-button-size);
    line-height: 1.1;
}

@media (max-width: 700px) {
    .verbs button {
        padding: 8px 13px;
        min-height: 42px;
        border-width: 2px;
    }
}

@media (max-width: 380px) {
    .verbs button {
        padding: 8px 10px;
    }
}

.verbs button.selected {
    box-shadow: inset 3px 3px var(--void);
    background: var(--navy);
    border-color: var(--amber);
    color: var(--amber);
}

.verbs button:last-child {
    margin-left: auto;
    color: var(--silver);
    border-color: var(--steel);
    font-size: var(--game-button-size);
}

@media (max-width: 700px) {
    .verbs button:last-child {
        padding: 8px 7px;
        font-size: var(--game-button-size);
    }
}

@media (max-width: 380px) {
    .verbs button:last-child {
        padding: 8px 5px;
    }
}

.verbs button:last-child:hover {
    background: var(--amber);
    color: var(--navy);
}

#action-hint {
    color: var(--paper);
    margin: 12px 0 8px;
    font-size: var(--game-caption-size);
}

.under-game {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0 30px;
    color: var(--muted-blue);
    gap: 20px;
    font-size: var(--game-caption-size);
}

.controls:before {
    content: "";
    height: 6px;
    position: absolute;
    left: 38%;
    right: 38%;
    top: -8px;
    background: repeating-linear-gradient(90deg, var(--amber) 0 8px, var(--navy) 8px 15px);
    border: 2px solid var(--void);
}

.verbs button:hover {
    background: var(--signal);
    color: var(--paper);
    border-color: var(--paper);
}

.under-game a {
    color: var(--amber);
}

.under-game a:hover {
    color: var(--paper);
}

dialog {
    width: min(720px, calc(100% - 24px));
    max-height: 86dvh;
    overflow: auto;
    background: var(--navy);
    color: var(--paper);
    border: 4px solid var(--amber);
    padding: 0;
    box-shadow: 0 0 0 3px var(--blue),
        8px 8px var(--void);
}

dialog::backdrop {
    background: #000b;
}

.dialog-bar {
    position: sticky;
    top: 0;
    background: var(--blue);
    color: var(--paper);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    z-index: 1;
    border-bottom: 2px solid var(--steel);
}

.dialog-bar button {
    color: var(--amber);
    background: none;
    border: 0;
    padding: 0 3px;
}

#panel-content {
    padding: 24px 28px;
}

@media (max-width: 700px) {
    #panel-content {
        padding: 20px;
    }
}

#panel-content h2 {
    color: var(--amber);
    text-shadow: 3px 3px var(--brown);
    line-height: 1.8;
    margin: 0 0 16px;
    font-size: var(--panel-display-size);
}

#panel-content h3 {
    color: var(--paper);
    margin: 22px 0 10px;
    line-height: 1.8;
    font-size: var(--panel-display-size);
}

#panel-content p {
    line-height: 1.75;
    font-size: var(--panel-copy-size);
}

@media (max-width: 700px) {
    #panel-content p {
        font-size: var(--panel-copy-size);
    }
}

#panel-content .small {
    color: #aaa;
    font-size: 0.9375rem;
}

.dialog-bottom {
    border-top: 2px solid var(--steel);
    text-align: center;
    padding: 13px;
}

.dialog-bottom button {
    background: none;
    border: 0;
    color: var(--amber);
}

.dialog-bottom button:hover {
    color: var(--silver);
}

.notice {
    border: 2px solid var(--steel);
    padding: 13px 16px;
    color: var(--paper);
    background: var(--blue);
    line-height: 1.7;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.modal-buttons button {
    color: #000;
    background: var(--amber);
    border: 2px outset var(--paper);
    padding: 10px 14px;
}

.modal-buttons button + button {
    background: #aaa;
}

.inventory-item {
    border: 2px solid var(--steel);
    margin: 10px 0;
    padding: 10px;
}

.inventory-item b {
    color: var(--amber);
}

.steps {
    counter-reset: step;
}

.steps p {
    border-bottom: 2px solid var(--steel);
    padding-bottom: 13px;
}

.steps b {
    color: var(--amber);
}

.game-section .game {
    max-width: 1200px;
    margin: auto;
    box-shadow: 12px 12px 0 var(--blue);
    border: 5px solid var(--steel);
    background: #000;
}

@media (max-width: 520px) {
    .game-section .game {
        border-width: 3px;
        box-shadow: 5px 5px var(--blue);
    }
}

.game-menu,
.game-menu button {
    font-size: var(--game-menu-size);
}

#panel {
    --panel-copy-size: 1.25rem;
    --panel-display-size: 0.75rem;
    font-family: var(--font-terminal, "Ministry", monospace);
    font-size: var(--panel-copy-size);
}

#panel button,
#panel input,
#panel p,
#panel a {
    font-family: var(--font-terminal, "Ministry", monospace);
}

#panel p,
#panel a {
    font-size: var(--panel-copy-size);
}

#panel-label,
#panel h2,
#panel h3 {
    font-family: var(--font-display, monospace);
    font-size: var(--panel-display-size);
    line-height: 1.8;
}

#panel .dialog-bar {
    font-size: 0.75rem;
}

#panel .dialog-bar button {
    font-size: 0.875rem;
}

#panel .dialog-bottom button {
    font-size: 1rem;
}

#panel .notice {
    font-size: 1.125rem;
}

#panel .modal-buttons button {
    font-size: 1.125rem;
}

#panel .inventory-item {
    font-size: 1.125rem;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}
