:root {
    --cardboard: #c9a874;
    --cardboard-dark: #a9824f;
    --cardboard-shadow: #7d5e34;
    --ink: #2b2118;
    --paper: #f2ead9;
    --tape: #e8dcc0;
    --stamp: #b6432f;
}

* {
    box-sizing: border-box;
}

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

body {
    background: var(--paper);
    background-image: radial-gradient(circle at 1px 1px, rgba(43, 33, 24, 0.06) 1px, transparent 0);
    background-size: 22px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Courier New", Courier, monospace;
    color: var(--ink);
}

.scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 24px;
}

a.box-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.box {
    position: relative;
    width: min(72vw, 300px);
    height: min(72vw, 300px);
    background: linear-gradient(155deg, var(--cardboard) 0%, var(--cardboard-dark) 100%);
    border: 3px solid var(--cardboard-shadow);
    box-shadow:
        0 18px 0 -8px rgba(43, 33, 24, 0.18),
        0 20px 30px rgba(43, 33, 24, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

.box::before {
    /* vertical tape strip */
    content: "";
    position: absolute;
    top: -3px;
    bottom: -3px;
    left: 50%;
    width: 15%;
    transform: translateX(-50%);
    background: var(--tape);
    opacity: 0.85;
    border-left: 1px dashed rgba(43, 33, 24, 0.25);
    border-right: 1px dashed rgba(43, 33, 24, 0.25);
}

.box::after {
    /* horizontal flap seam */
    content: "";
    position: absolute;
    left: -3px;
    right: -3px;
    top: 50%;
    height: 3px;
    transform: translateY(-50%);
    background: var(--cardboard-shadow);
    opacity: 0.5;
}

.box-link:hover .box {
    transform: translateY(-4px);
    box-shadow:
        0 22px 0 -8px rgba(43, 33, 24, 0.18),
        0 26px 34px rgba(43, 33, 24, 0.28);
}

.box-link:active .box {
    transform: translateY(0);
}

.stamp {
    position: relative;
    z-index: 2;
    font-weight: 700;
    font-size: clamp(3rem, 14vw, 5rem);
    letter-spacing: 0.12em;
    color: var(--paper);
    text-shadow: 0 2px 0 rgba(43, 33, 24, 0.4);
    padding: 0.1em 0.3em;
    border: 4px solid var(--paper);
    transform: rotate(-3deg);
}

.corner-stamp {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 46px;
    height: 46px;
    border: 2px solid var(--stamp);
    border-radius: 50%;
    color: var(--stamp);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    text-align: center;
    line-height: 1.1;
    transform: rotate(8deg);
    opacity: 0.85;
}

.hint {
    font-size: 0.85rem;
    color: var(--cardboard-shadow);
    letter-spacing: 0.04em;
}

.scene.reveal {
    gap: 20px;
    text-align: center;
}

.message {
    font-weight: 700;
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    letter-spacing: 0.02em;
    max-width: 500px;
}

.frame {
    padding: 10px;
    background: var(--tape);
    border: 3px solid var(--cardboard-shadow);
    box-shadow: 0 12px 24px rgba(43, 33, 24, 0.25);
    transform: rotate(-1.5deg);
}

.frame img {
    display: block;
    max-width: min(80vw, 360px);
    height: auto;
    border: 2px solid var(--ink);
}

a.back-link {
    text-decoration: none;
    color: var(--cardboard-shadow);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    border-bottom: 1px dashed var(--cardboard-shadow);
}

a.back-link:hover {
    color: var(--stamp);
    border-bottom-color: var(--stamp);
}
