* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background-color: #000000;
    overflow: hidden;
    position: relative;
    font-family: "Times New Roman", Times, Georgia, serif;
}

/* Pulsante Trash in alto a destra */
.trash-badge-btn {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 998;
    background: #ffff00;
    border: 3px dashed #ff0000;
    padding: 6px 12px;
    cursor: pointer;
    font-family: "Comic Sans MS", "Impact", sans-serif;
    font-weight: 900;
    box-shadow: 0 0 12px #ffff00, inset 0 0 6px rgba(255, 0, 0, 0.4);
    transform: rotate(2deg);
    transition: transform 0.1s ease, filter 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.trash-badge-btn:hover {
    transform: scale(1.1) rotate(-1deg);
    filter: brightness(1.2);
}

.trash-badge-btn:active {
    transform: scale(0.95);
}

.badge-blink {
    color: #ff0000;
    font-size: clamp(0.75rem, 2.5vw, 0.95rem);
    text-shadow: 1px 1px 0 #000000;
    animation: textFlash 0.4s infinite alternate;
    display: inline-block;
}

@keyframes textFlash {
    0% { color: #ff0000; }
    100% { color: #0000ff; }
}

.container {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Gestione Pagine */
.page {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 28px;
    width: 100%;
    max-width: 1200px;
    animation: pageAppear 0.2s steps(4, end);
}

.page.active {
    display: flex;
}

@keyframes pageAppear {
    0% { opacity: 0; transform: scale(0.97); }
    100% { opacity: 1; transform: scale(1); }
}

.photo {
    width: auto;
    height: auto;
    max-width: 85vw;
    max-height: 50vh;
    max-height: 50dvh;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-select: none;
}

.quote {
    color: #ffffff;
    font-size: clamp(1.4rem, 4vw, 2.6rem);
    font-style: italic;
    line-height: 1.35;
    letter-spacing: 0.03em;
    text-align: center;
    max-width: 680px;
    user-select: none;
}

/* Layout Desktop / PC */
@media (min-width: 768px) {
    .page {
        flex-direction: row;
        gap: 60px;
        padding: 40px;
    }

    .photo {
        max-width: 45vw;
        max-height: 75vh;
        max-height: 75dvh;
    }

    .quote {
        text-align: left;
        font-size: clamp(1.8rem, 3.2vw, 3rem);
    }
}

/* Navigazione Frecce Spesse a Matita - Videogiochi 2010 */
.pencil-nav {
    position: fixed;
    bottom: 28px;
    right: 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 997;
}

.pencil-arrow-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease, filter 0.1s ease;
}

.pencil-arrow-icon {
    width: 68px;
    height: 52px;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.7));
    transform-origin: center;
    transition: transform 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Effetto wobble / hover stile videogame anni 2010 */
.pencil-arrow-btn:hover:not(:disabled) .pencil-arrow-icon {
    transform: scale(1.18) rotate(-4deg);
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.95));
}

.pencil-arrow-btn#next-btn:hover:not(:disabled) .pencil-arrow-icon {
    transform: scale(1.18) rotate(4deg);
}

.pencil-arrow-btn:active:not(:disabled) .pencil-arrow-icon {
    transform: scale(0.92) rotate(0deg);
}

.pencil-arrow-btn:disabled {
    opacity: 0.18;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .trash-badge-btn {
        top: 12px;
        right: 12px;
        padding: 4px 8px;
    }

    .pencil-nav {
        bottom: 18px;
        right: 18px;
        gap: 12px;
    }

    .pencil-arrow-icon {
        width: 52px;
        height: 40px;
    }
}

/* =========================================================
   STILE PUBBLICITÀ TRASH ANNI 2010 (POP-UP ADWARE / SPAM)
   ========================================================= */
.fake-ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.82);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 16px;
    animation: adPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fake-ad-overlay.hidden,
.ad-body.hidden {
    display: none !important;
}

@keyframes adPopIn {
    0% { transform: scale(0.3) rotate(-6deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.fake-ad-window {
    width: 100%;
    max-width: 560px;
    background: #ffff00;
    border: 6px dashed #ff0000;
    box-shadow: 0 0 30px #ffff00, inset 0 0 15px rgba(255, 0, 0, 0.5);
    font-family: "Comic Sans MS", "Comic Sans", "Impact", "Arial Black", sans-serif;
    color: #000000;
    text-align: center;
    position: relative;
    user-select: none;
}

/* Barra del titolo stile finto Windows */
.ad-titlebar {
    background: linear-gradient(180deg, #0055ea 0%, #002288 100%);
    color: #ffffff;
    font-family: "Tahoma", "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: bold;
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #ff0000;
}

.ad-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ad-win-btn {
    background: #cc0000;
    color: #ffffff;
    border: 2px outset #ffffff;
    font-weight: bold;
    font-size: 13px;
    width: 22px;
    height: 22px;
    line-height: 1;
    cursor: pointer;
}

.ad-win-btn:active {
    border-style: inset;
}

/* Contenuto Pubblicità */
.ad-body {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ad-blink-banner {
    font-size: clamp(1.2rem, 4vw, 1.7rem);
    font-weight: 900;
    color: #ffffff;
    background-color: #ff0000;
    padding: 6px 14px;
    border: 3px solid #000000;
    animation: flashBlink 0.35s infinite alternate;
}

@keyframes flashBlink {
    0% { background-color: #ff0000; color: #ffffff; }
    100% { background-color: #0000ff; color: #ffff00; }
}

.ad-warning-text {
    font-size: clamp(1rem, 3.2vw, 1.3rem);
    font-weight: bold;
    color: #cc0000;
    text-transform: uppercase;
}

.ad-amount-badge {
    font-size: clamp(1.6rem, 5.5vw, 2.4rem);
    font-weight: 900;
    color: #008800;
    background: #ffffff;
    padding: 10px 20px;
    border: 4px solid #008800;
    text-shadow: 2px 2px 0px #ffff00;
    transform: rotate(-2deg);
    animation: pulseBadge 0.6s infinite alternate ease-in-out;
}

@keyframes pulseBadge {
    0% { transform: scale(0.96) rotate(-2deg); }
    100% { transform: scale(1.04) rotate(2deg); }
}

.ad-subtext {
    font-size: 12px;
    color: #333333;
    font-style: italic;
}

/* Pulsanti Azione */
.ad-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 380px;
    margin-top: 6px;
}

.ad-btn-pay {
    background: linear-gradient(180deg, #00ff00 0%, #008800 100%);
    color: #ffffff;
    border: 4px outset #ffffff;
    font-family: "Impact", "Arial Black", sans-serif;
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    padding: 14px 20px;
    cursor: pointer;
    text-shadow: 2px 2px 3px #000000;
    box-shadow: 0 6px 0 #004400;
    transition: transform 0.05s ease;
}

.ad-btn-pay:hover {
    filter: brightness(1.15);
}

.ad-btn-pay:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #004400;
    border-style: inset;
}

.ad-btn-no {
    background: #d4d0c8;
    color: #555555;
    border: 2px solid #808080;
    font-family: "Comic Sans MS", sans-serif;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 16px;
    cursor: pointer;
}

.ad-btn-no:hover {
    background: #e4e0d8;
    color: #000000;
}

/* Schermata "Broke ass" */
.broke-banner {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 900;
    color: #ff00ff;
    background: #000000;
    padding: 8px 16px;
    border: 3px solid #ffff00;
}

.broke-text {
    font-size: clamp(1.8rem, 6vw, 3rem);
    font-weight: 900;
    color: #ff0000;
    text-shadow: 3px 3px 0 #000000, -2px -2px 0 #ffff00;
    line-height: 1.2;
    padding: 10px;
    animation: textWobble 0.2s infinite;
}

@keyframes textWobble {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    25% { transform: translate(-2px, -1px) rotate(-1deg); }
    50% { transform: translate(2px, 0px) rotate(1deg); }
    75% { transform: translate(-1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -1px) rotate(-1deg); }
}

.ad-btn-dismiss {
    background: linear-gradient(180deg, #ff6600 0%, #cc3300 100%);
    color: #ffffff;
    border: 3px outset #ffffff;
    font-family: "Impact", sans-serif;
    font-size: 1.3rem;
    padding: 10px 24px;
    cursor: pointer;
    margin-top: 10px;
}

.ad-btn-dismiss:active {
    border-style: inset;
}
