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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    min-height: 100vh;
    overflow: hidden;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#writers-ocean {
    width: 100%;
    height: 100%;
    position: relative;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 70%);
}

h1 {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 10px rgba(255,255,255,0.2); }
    to { text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 20px rgba(255,255,255,0.4); }
}

.writer-figure {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
    z-index: 10; /* Real writers in front */
}

.writer-figure.nudge-active:not(.search-mode .writer-figure) {
    animation: nudge 2s ease-in-out;
    z-index: 15;
}

/* Disable nudge during search mode */
.search-mode .writer-figure.nudge-active {
    animation: gentleWander 8s ease-in-out infinite !important;
}

@keyframes nudge {
    0% { 
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    25% { 
        transform: scale(1.15) rotate(-3deg);
        filter: brightness(1.3);
    }
    50% { 
        transform: scale(1.2) rotate(3deg);
        filter: brightness(1.4);
    }
    75% { 
        transform: scale(1.15) rotate(-2deg);
        filter: brightness(1.3);
    }
    100% { 
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
}

.writer-figure.spark-active:not(.search-mode .writer-figure) {
    animation: spark 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 15;
}

/* Disable spark during search mode */
.search-mode .writer-figure.spark-active {
    animation: gentleWander 8s ease-in-out infinite !important;
}

@keyframes spark {
    0% { 
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }
    50% { 
        transform: scale(1.06);
        filter: brightness(1.25);
        box-shadow: 0 0 12px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 215, 0, 0.25);
    }
    100% { 
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* NPC styling */
.npc-figure {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
    z-index: 5; /* NPCs in background */
}

.npc-figure:hover {
    transform: scale(1.1);
}

.npc-figure .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.npc-figure .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure:hover {
    transform: scale(1.1);
}

.writer-figure.found .writer-avatar::after {
    content: '📖';
    position: absolute;
    right: -10px;
    top: -10px;
    font-size: 0.8em;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes smoothDrift {
    0% { transform: translateX(0px) translateY(0px); }
    25% { transform: translateX(30px) translateY(-15px); }
    50% { transform: translateX(-20px) translateY(-8px); }
    75% { transform: translateX(25px) translateY(-12px); }
    100% { transform: translateX(0px) translateY(0px); }
}

@keyframes smoothDriftReverse {
    0% { transform: translateX(0px) translateY(0px); }
    25% { transform: translateX(-30px) translateY(-12px); }
    50% { transform: translateX(20px) translateY(-18px); }
    75% { transform: translateX(-25px) translateY(-6px); }
    100% { transform: translateX(0px) translateY(0px); }
}

@keyframes gentleWander {
    0% { transform: translateX(0px) translateY(0px) scale(1); }
    20% { transform: translateX(150px) translateY(-80px) scale(1.05); }
    40% { transform: translateX(-120px) translateY(-60px) scale(0.95); }
    60% { transform: translateX(180px) translateY(-100px) scale(1.08); }
    80% { transform: translateX(-90px) translateY(-120px) scale(0.98); }
    100% { transform: translateX(0px) translateY(0px) scale(1); }
}

@keyframes smoothRoam {
    0% { transform: translateX(0px) translateY(0px) scale(1); }
    25% { transform: translateX(-160px) translateY(-70px) scale(1.02); }
    50% { transform: translateX(140px) translateY(-110px) scale(0.96); }
    75% { transform: translateX(-100px) translateY(-90px) scale(1.04); }
    100% { transform: translateX(0px) translateY(0px) scale(1); }
}

@keyframes calmDrift {
    0% { transform: translateX(0px) translateY(0px) scale(1); }
    30% { transform: translateX(200px) translateY(-50px) scale(1.06); }
    60% { transform: translateX(-170px) translateY(-130px) scale(0.94); }
    100% { transform: translateX(0px) translateY(0px) scale(1); }
}

@keyframes peacefulGlide {
    0% { transform: translateX(0px) translateY(0px) scale(1); }
    33% { transform: translateX(-180px) translateY(-40px) scale(1.03); }
    66% { transform: translateX(160px) translateY(-140px) scale(0.97); }
    100% { transform: translateX(0px) translateY(0px) scale(1); }
}

.writer-figure,
.npc-figure {
    animation: smoothDrift 8s ease-in-out infinite;
}

.writer-figure:nth-child(even),
.npc-figure:nth-child(even) {
    animation: smoothDriftReverse 9s ease-in-out infinite;
}

.writer-figure:nth-child(3n),
.npc-figure:nth-child(3n) {
    animation-duration: 7s;
    animation-delay: 1s;
}

.writer-figure:nth-child(4n),
.npc-figure:nth-child(4n) {
    animation-duration: 10s;
    animation-delay: 2s;
}

.writer-figure:nth-child(5n),
.npc-figure:nth-child(5n) {
    animation-duration: 8.5s;
    animation-delay: 0.5s;
}

.search-mode .writer-figure,
.search-mode .npc-figure {
    animation: gentleWander 8s ease-in-out infinite;
}

.search-mode .writer-figure:nth-child(odd) {
    animation: smoothRoam 9s ease-in-out infinite;
    animation-delay: 1s;
}

.search-mode .writer-figure:nth-child(3n) {
    animation: calmDrift 7s ease-in-out infinite;
    animation-delay: 2s;
}

.search-mode .writer-figure:nth-child(5n) {
    animation: peacefulGlide 8.5s ease-in-out infinite;
    animation-delay: 1.5s;
}

.search-mode .writer-figure:nth-child(7n) {
    animation: gentleWander 7.5s ease-in-out infinite;
    animation-delay: 0.5s;
    animation-direction: reverse;
}

.search-mode .npc-figure:nth-child(even) {
    animation: smoothRoam 8.2s ease-in-out infinite;
    animation-delay: 1.8s;
}

.search-mode .npc-figure:nth-child(4n) {
    animation: calmDrift 9.5s ease-in-out infinite;
    animation-delay: 0.8s;
    animation-direction: reverse;
}

.search-mode .npc-figure:nth-child(3n+1) {
    animation: peacefulGlide 7.8s ease-in-out infinite;
    animation-delay: 2.2s;
}

.search-mode .npc-figure:nth-child(6n) {
    animation: gentleWander 8.8s ease-in-out infinite;
    animation-delay: 1.3s;
}

.search-mode .npc-figure:nth-child(5n+2) {
    animation: smoothRoam 7.2s ease-in-out infinite;
    animation-delay: 0.3s;
    animation-direction: reverse;
}

.writer-avatar {
    font-size: 3rem;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
}

.writer-image {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
}

.writer-figure[data-writer="hermans"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="hermans"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="multatuli"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="multatuli"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="annie"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="annie"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="haasse"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="haasse"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="reve"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="reve"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="cats"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="cats"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="vondel"] .writer-image {
    width: 105px;
    height: 128px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="vondel"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 105px;
    height: 128px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="hooft"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="hooft"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="couperus"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="couperus"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="roemer"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="roemer"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="leuwsha"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="leuwsha"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-figure[data-writer="algalidi"] .writer-image {
    width: 120px;
    height: 150px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    display: block;
}

.writer-figure[data-writer="algalidi"] .writer-avatar {
    background: transparent;
    box-shadow: none;
    width: 120px;
    height: 150px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.writer-name {
    margin-top: 10px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-size: 0.9rem;
}

#pencil-nudge {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    cursor: pointer;
    animation: wiggle 2s ease-in-out infinite;
    z-index: 1000; /* Much higher z-index to stay above all figures */
}

@keyframes wiggle {
    0%, 7% { transform: translate(-50%, -50%) rotateZ(0); }
    15% { transform: translate(-50%, -50%) rotateZ(-15deg); }
    20% { transform: translate(-50%, -50%) rotateZ(10deg); }
    25% { transform: translate(-50%, -50%) rotateZ(-10deg); }
    30% { transform: translate(-50%, -50%) rotateZ(6deg); }
    35% { transform: translate(-50%, -50%) rotateZ(-4deg); }
    40%, 100% { transform: translate(-50%, -50%) rotateZ(0); }
}

.pencil {
    font-size: 4rem;
    position: relative;
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 3px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

#pencil-nudge p {
    color: white;
    margin-top: 10px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.hidden {
    display: none !important;
}

#thank-you-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 2.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#poll-frame, #results-frame, #reward-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 2.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.frame-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 99;
    transition: opacity 1.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: none;
}

.thank-you-content {
    text-align: left;
    margin-top: 20px;
}

.thank-you-content p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.participation-info {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.participation-info li {
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.5;
}

.dilemma-intro {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
}

.dilemma-intro h2 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
}

.dilemma-intro p {
    margin: 8px 0;
    font-size: 1rem;
}

.dilemma-intro p:first-of-type {
    font-weight: bold;
    font-size: 1.1rem;
}

.reflection-note {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    margin-bottom: 20px;
}

.reflection-note p {
    margin: 0;
    color: #555;
    font-style: italic;
    text-align: center;
}

.continue-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.2rem;
    cursor: pointer;
    margin: 20px auto 0;
    display: block;
    transition: all 0.3s ease;
}

.continue-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.frame-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    max-width: 600px;
    text-align: center;
    animation: slideInFromRight 1.2s ease-out;
    transform: translateX(0);
    transition: transform 1.2s ease-in-out, opacity 1.2s ease-in-out;
}

#reward-frame .frame-content {
    max-width: 550px;
    width: 80%;
    padding: 20px;
    max-height: 85vh;
    overflow-y: auto;
}

.frame-content.frame-out {
    animation: slideOutToLeft 1.2s ease-in forwards;
}

@keyframes slideInFromRight {
    0% { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    100% { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes slideOutToLeft {
    0% { 
        transform: translateX(0); 
        opacity: 1; 
    }
    100% { 
        transform: translateX(-100%); 
        opacity: 0; 
    }
}

@keyframes floatGently {
    0%, 100% { transform: translateY(0px) rotateZ(0deg); }
    50% { transform: translateY(-10px) rotateZ(1deg); }
}

/* Remove floating animation to prevent movement during reading */

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.poll-option {
    padding: 20px 25px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.poll-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.option-label {
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 15px;
    display: inline-block;
    text-shadow: none;
}

.book-stacks {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    align-items: flex-end;
    height: 200px;
}

.book-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stack-label {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.books {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    min-height: 120px;
    justify-content: flex-start;
}

.book {
    width: 60px;
    height: 10px;
    margin: 1px 0;
    border-radius: 2px;
    animation: bookFall 0.8s ease-out forwards;
    transform: translateY(-100px) rotateZ(15deg);
    opacity: 0;
}

.book:nth-child(odd) { 
    background: #ff6b6b; 
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.book:nth-child(even) { 
    background: #4ecdc4; 
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.book:nth-child(3n) { 
    background: #45b7d1; 
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

@keyframes bookFall {
    0% { 
        transform: translateY(-100px) rotateZ(15deg); 
        opacity: 0; 
    }
    70% { 
        transform: translateY(5px) rotateZ(-2deg); 
        opacity: 1; 
    }
    85% { 
        transform: translateY(-2px) rotateZ(1deg); 
    }
    100% { 
        transform: translateY(0) rotateZ(0deg); 
        opacity: 1; 
    }
}

.percentage {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-top: 10px;
}

.matched-writer {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

#writer-match {
    font-size: 2rem;
    margin: 10px 0;
}

#start-search {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

#start-search:hover {
    background: #218838;
    transform: translateY(-2px);
}

.kb-blog {
    margin: 30px 0;
    text-align: left;
}

.kb-blog h3 {
    text-align: center;
    color: #407EC9;
    margin-bottom: 15px;
}

.blog-question {
    background: #ffffff;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #407EC9;
    box-shadow: 0 4px 15px rgba(64, 126, 201, 0.1);
    flex: 1;
    min-width: 250px;
}

.blog-question h4 {
    margin: 0 0 10px 0;
    color: #407EC9;
    font-size: 1.3rem;
}

.question-subtitle {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 0.95rem;
    font-style: italic;
}

#user-wish {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    line-height: 1.3;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#user-wish:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.2);
}

.wish-stats {
    text-align: right;
    margin: 8px 0;
    font-size: 0.9rem;
}

#wish-char-count {
    font-weight: bold;
    color: #28a745;
}

#submit-wish {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-weight: bold;
}

#submit-wish:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

#submit-wish:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.previous-wishes {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #9CDBD9;
    flex: 1;
    min-width: 250px;
}

.previous-wishes h4 {
    margin: 0 0 15px 0;
    color: #333;
}

#wishes-list {
    max-height: 140px;
    overflow-y: auto;
}

.wish-item {
    background: white;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    border-left: 3px solid #C89DDB;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.wish-item:hover {
    transform: translateX(5px);
}

.wish-text {
    color: #333;
    line-height: 1.5;
    margin-bottom: 8px;
}

.wish-author {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    text-align: right;
}

.wish-author::before {
    content: "— ";
}

.empty-wishes {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

#finish-experience {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px auto 0;
    transition: all 0.3s ease;
}

#finish-experience:hover {
    background: #218838;
    transform: scale(1.05);
}

.checkmark {
    font-size: 1.5rem;
}

#writer-info {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    opacity: 0;
    animation: fadeInOverlay 0.6s ease-out forwards;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.info-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    position: relative;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    animation: gentlePopIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s forwards;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
}

@keyframes gentlePopIn {
    0% { 
        transform: scale(0.8) translateY(20px); 
        opacity: 0; 
    }
    60% { 
        transform: scale(1.02) translateY(-2px); 
        opacity: 0.9; 
    }
    100% { 
        transform: scale(1) translateY(0); 
        opacity: 1; 
    }
}

/* Add subtle floating animation after popup appears */
.info-content::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    border-radius: 17px;
    z-index: -1;
    opacity: 0;
    animation: subtleGlow 3s ease-in-out 1s infinite alternate;
}

@keyframes subtleGlow {
    0% { opacity: 0; }
    50% { opacity: 0.3; }
    100% { opacity: 0; }
}

/* Add gentle breathing animation to content */
.info-content h3 {
    animation: gentleBreath 4s ease-in-out infinite;
}

@keyframes gentleBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: rotate(90deg) scale(1.1);
}

/* Add smooth text reveal animation */
.info-content p {
    opacity: 0;
    transform: translateY(10px);
    animation: textReveal 0.6s ease-out forwards;
}

.info-content p:nth-child(2) { animation-delay: 0.3s; }
.info-content p:nth-child(3) { animation-delay: 0.5s; }
.info-content p:nth-child(4) { animation-delay: 0.7s; }

@keyframes textReveal {
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes gentlePopOut {
    0% { 
        transform: scale(1) translateY(0); 
        opacity: 1; 
    }
    100% { 
        transform: scale(0.9) translateY(15px); 
        opacity: 0; 
    }
}

@keyframes fadeOutOverlay {
    from { opacity: 1; }
    to { opacity: 0; }
}

.writer-figure.highlight {
    animation: highlight 1s ease-in-out infinite;
}

@keyframes highlight {
    0%, 100% { box-shadow: 0 0 0 rgba(255,255,0,0.7); }
    50% { box-shadow: 0 0 20px rgba(255,255,0,0.7); }
}

.writer-figure.highlight-active:not(.search-mode .writer-figure) {
    animation: writerHighlight 3s ease-in-out;
    z-index: 10;
}

/* Disable highlight during search mode */
.search-mode .writer-figure.highlight-active {
    animation: none !important;
}

@keyframes writerHighlight {
    0% { 
        transform: scale(1);
        filter: brightness(1) saturate(1);
        border: 0px solid transparent;
    }
    25% { 
        transform: scale(1.12);
        filter: brightness(1.4) saturate(1.3);
        border: 3px solid rgba(255, 255, 255, 0.8);
        border-radius: 15px;
    }
    75% { 
        transform: scale(1.12);
        filter: brightness(1.4) saturate(1.3);
        border: 3px solid rgba(255, 255, 255, 0.8);
        border-radius: 15px;
    }
    100% { 
        transform: scale(1);
        filter: brightness(1) saturate(1);
        border: 0px solid transparent;
    }
}

.search-active {
    cursor: crosshair;
}

@keyframes timerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes celebrationEntrance {
    0% { 
        transform: scale(0.5) rotateY(180deg); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.1) rotateY(90deg); 
        opacity: 0.7; 
    }
    100% { 
        transform: scale(1) rotateY(0deg); 
        opacity: 1; 
    }
}

@keyframes bounceIn {
    0% { 
        transform: scale(0.3) translateY(-100px); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.05) translateY(0); 
        opacity: 1; 
    }
    70% { 
        transform: scale(0.9); 
    }
    100% { 
        transform: scale(1); 
    }
}

@keyframes slideUp {
    0% { 
        transform: translateY(30px); 
        opacity: 0; 
    }
    100% { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

@keyframes fireworkBurst {
    0% { 
        transform: scale(0) rotate(0deg); 
        opacity: 1; 
    }
    50% { 
        transform: scale(3) rotate(180deg); 
        opacity: 0.8; 
    }
    100% { 
        transform: scale(5) rotate(360deg); 
        opacity: 0; 
    }
}



.celebration-fireworks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.celebration-content {
    position: relative;
    z-index: 2;
}

// Add floating animation with random delays
document.querySelectorAll('.writer-figure, .npc-figure').forEach((figure, index) => {
    figure.style.animationDelay = `${index * 0.3}s`;
});