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

html, body {
    background: #0a0a0a;
    color: #e0e0e0;
    font-family: 'Georgia', serif;
    min-height: 100vh;
    overflow-x: hidden;
}

#container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    position: relative;
}

/* Intro */
#intro {
    text-align: center;
    padding: 80px 20px;
}

#intro h1 {
    font-size: 2rem;
    font-weight: normal;
    letter-spacing: 0.15em;
    color: #666;
    margin-bottom: 50px;
}

#intro-text {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #888;
    max-width: 450px;
    margin: 0 auto 50px;
}

#intro-text p {
    margin-bottom: 1.2em;
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

#intro-text p:nth-child(1) { animation-delay: 0.2s; }
#intro-text p:nth-child(2) { animation-delay: 0.6s; }
#intro-text p:nth-child(3) { animation-delay: 1.0s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

#begin-btn {
    background: transparent;
    border: 1px solid #444;
    color: #777;
    padding: 14px 50px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.8s ease 1.4s forwards;
}

#begin-btn:hover {
    border-color: #666;
    color: #aaa;
}

/* Portrait phase */
#portrait {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

#form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

#form {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #3a3a3a, #1a1a1a);
    box-shadow:
        0 0 60px rgba(100, 100, 100, 0.2),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
    animation: glow 3s ease-in-out infinite alternate;
    transition: all 1s ease;
}

@keyframes glow {
    from { box-shadow: 0 0 60px rgba(100, 100, 100, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.3); }
    to { box-shadow: 0 0 80px rgba(100, 100, 100, 0.25), inset 0 0 30px rgba(0, 0, 0, 0.3); }
}

#form-label {
    margin-top: 30px;
    font-size: 1rem;
    color: #555;
    font-style: italic;
    opacity: 0;
    animation: fadeIn 1s ease 0.5s forwards;
}

#portrait-hint {
    font-size: 0.9rem;
    color: #444;
    margin-top: 40px;
    opacity: 0;
    animation: fadeIn 1s ease 1.5s forwards;
}

/* Reveal phase */
#reveal {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

#reveal-form-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

#reveal-form {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #3a3a3a, #1a1a1a);
    position: relative;
    overflow: hidden;
}

#holes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hole {
    position: absolute;
    background: #0a0a0a;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.6s ease;
}

.hole.visible {
    transform: scale(1);
}

.hole-1 { width: 30px; height: 30px; top: 25%; left: 20%; }
.hole-2 { width: 25px; height: 25px; top: 15%; left: 55%; }
.hole-3 { width: 35px; height: 35px; top: 50%; left: 60%; }
.hole-4 { width: 28px; height: 28px; top: 65%; left: 30%; }
.hole-5 { width: 22px; height: 22px; top: 40%; left: 35%; }

#reveal-text {
    font-size: 1rem;
    color: #888;
    margin-bottom: 30px;
    min-height: 60px;
}

#reveal-text p {
    margin-bottom: 0.8em;
}

#absence-list {
    max-width: 400px;
    margin: 0 auto 40px;
    text-align: left;
}

.absence-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #111;
    border-left: 2px solid #333;
    color: #666;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.5s ease;
}

.absence-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.absence-item .label {
    color: #886644;
    font-style: italic;
    margin-bottom: 4px;
}

#continue-reveal {
    background: transparent;
    border: 1px solid #333;
    color: #666;
    padding: 10px 30px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

#continue-reveal.visible {
    opacity: 1;
}

#continue-reveal:hover {
    border-color: #555;
    color: #999;
}

/* Inversion phase */
#inversion {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

#inversion-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

#punch-card {
    width: 240px;
    height: 140px;
    background: #0a0a0a;
    border: 1px solid #333;
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 6px;
    padding: 12px;
}

.punch {
    background: #222;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.punch.lit {
    background: #886644;
    box-shadow: 0 0 8px rgba(136, 102, 68, 0.5);
}

#inversion-text {
    font-size: 1rem;
    line-height: 1.9;
    color: #888;
    max-width: 500px;
    margin: 0 auto 40px;
}

#inversion-text p {
    margin-bottom: 1.2em;
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

#continue-inversion {
    background: transparent;
    border: 1px solid #333;
    color: #666;
    padding: 10px 30px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

#continue-inversion.visible {
    opacity: 1;
}

#continue-inversion:hover {
    border-color: #555;
    color: #999;
}

/* Reflection phase */
#reflection {
    display: none;
    text-align: center;
    padding: 80px 20px;
}

#reflection-text {
    font-size: 1rem;
    line-height: 2;
    color: #888;
    max-width: 520px;
    margin: 0 auto 50px;
}

#reflection-text p {
    margin-bottom: 1.5em;
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

#reflection-text p.emphasis {
    color: #aaa;
    font-style: italic;
}

#reflection-text p.question {
    color: #666;
    font-size: 0.95rem;
}

#restart-btn {
    background: transparent;
    border: 1px solid #333;
    color: #555;
    padding: 10px 30px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

#restart-btn.visible {
    opacity: 1;
}

#restart-btn:hover {
    border-color: #555;
    color: #888;
}

/* Mobile */
@media (max-width: 600px) {
    #container {
        padding: 30px 15px;
    }

    #intro h1 {
        font-size: 1.6rem;
    }

    #form, #reveal-form {
        width: 160px;
        height: 160px;
    }

    #punch-card {
        width: 200px;
        height: 120px;
    }

    .absence-item {
        font-size: 0.85rem;
    }
}
