/* Mécanique propre à ce proto.
   Le décor commun (fond, typo, écran de départ, bouton, révélation)
   vit dans ../../css/proto.css, chargé juste avant. */

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

.main-container {
    position: relative;
    width: 90vw;
    height: 90vh;
    max-width: 1400px;
    max-height: 900px;
    background: #fdfdfd; /* Off-white postcard paper */
    padding: 1.5rem; /* White border thickness */
    border-radius: 4px; /* Slight rounding for paper */
    box-shadow: 0 20px 50px rgba(0,0,0,0.15), 0 0 100px rgba(0,0,0,0.05); /* Soft drop shadow on light surface */
}

.inner-frame {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 2px;
    overflow: hidden;
    background: #000;
}

.reward {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    opacity: 0.5; /* Will be fully visible once scratched */
    transition: opacity 1s ease;
    padding: 2rem;
    text-align: center;
}

.reward.revealed {
    opacity: 1;
}

/* Le panneau reste invisible jusqu'au seuil de 95 %. La couche .reward est à
   opacity 0,5 dès le départ pour laisser deviner la photo, ce qui rendait aussi
   le titre lisible au premier coup de grattage au centre. */
.reward-panel {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.reward.revealed .reward-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.track-title {
    font-size: clamp(1.5rem, 6.5vw, 2.2rem);
    overflow-wrap: anywhere;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.track-artist {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.success-message {
    font-size: 1.2rem;
    color: var(--gold);
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.photo-credit {
    margin-top: 0.9rem;
    opacity: 0;
    transition: opacity 1.5s ease 0.5s; /* Delay appearance slightly */
}

.photo-credit a {
    color: rgba(255,255,255,0.9);
    text-decoration: underline;
}

.reward.revealed .success-message {
    opacity: 1;
    transform: translateY(0);
}

.reward.revealed .photo-credit {
    opacity: 1;
}

#scratchCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: crosshair;
}

#debugOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas */
    z-index: 10;
    display: flex;
    flex-direction: column;
}

#debugColumns {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
}

.debug-col {
    flex: 1;
    border-right: 1px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: flex-end;
    padding-bottom: 2rem;
    justify-content: center;
}
.debug-col:last-child {
    border-right: none;
}

.col-label {
    background: rgba(0,0,0,0.8);
    color: #0f0;
    font-size: 0.7rem;
    font-family: monospace;
    padding: 4px;
    border-radius: 4px;
    text-align: center;
    line-height: 1.2;
}

#debugStats {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.8);
    color: #0f0;
    padding: 10px;
    font-family: monospace;
    font-size: 0.9rem;
    border-radius: 5px;
}

#debugToggle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 20;
    outline: none;
}

/* Le panneau est en pointer-events: none pour laisser passer les gestes vers
   la zone de jeu. Le bouton, lui, doit les recevoir, et passer au-dessus des
   calques d'interaction (z-index 10 ailleurs dans ce fichier). */
.reward-cta {
    pointer-events: auto;
    position: relative;
    z-index: 40;
}
