body {
    background-color: #fff;
    color: #202124;
    font-family: arial, sans-serif;
    margin: 0;
    transition: background-color 1s ease-in-out, color 1s ease-in-out;
}

#app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.header-links a {
    color: #000000de;
    text-decoration: none;
    font-size: 13px;
}

.header-links a:hover {
    text-decoration: underline;
}

#user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

#login-screen, #search-page {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 20vh;
}

#login-screen h1 {
    font-weight: normal;
}

#password-input, #search-input {
    width: 100%;
    max-width: 580px;
    padding: 10px 20px;
    border-radius: 24px;
    border: 1px solid #dfe1e5;
    font-size: 16px;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    margin-bottom: 1.5rem;
}

#search-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%239aa0a6' d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
}

#password-input:focus, #search-input:focus {
    outline: none;
    box-shadow: 0 1px 6px rgba(32,33,36,.28);
    border-color: rgba(223,225,229,0);
}

#login-button, #search-buttons button, #restart-button, #next-day-button {
    background-color: #f8f9fa;
    border: 1px solid #f8f9fa;
    border-radius: 4px;
    color: #3c4043;
    font-family: arial,sans-serif;
    font-size: 14px;
    margin: 11px 4px;
    padding: 0 16px;
    line-height: 27px;
    height: 36px;
    min-width: 54px;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

#login-button:hover, #search-buttons button:hover, #restart-button:hover, #next-day-button:hover {
    box-shadow: 0 1px 1px rgba(0,0,0,.1);
    background-color: #f8f9fa;
    border: 1px solid #dadce0;
    color: #202124;
}

#search-buttons {
    display: flex;
    justify-content: center;
}

#search-results {
    margin-top: 2rem;
    font-size: 14px;
    color: #4d5156;
    width: 100%;
    max-width: 600px;
    text-align: left;
}

#search-results h3 {
    font-weight: normal;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.image-results {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.image-results img {
    max-width: 180px;
    max-height: 180px;
    object-fit: cover;
    border: 1px solid #dfe1e5;
    border-radius: 8px;
}

#next-day-button {
    margin-top: 2rem;
}

.hidden {
    display: none !important;
}

/* Phase styling */
.phase-4, .phase-4 body {
    background-color: #f0f0f0;
}
.phase-4 #search-logo {
    filter: brightness(0.9);
}

.phase-5 {
    animation: glitch 1s infinite;
}
.phase-5 #search-logo {
    animation: bloody-glitch 1s infinite alternate;
}

@keyframes bloody-glitch {
    0% { filter: brightness(1); transform: none; }
    20% { filter: brightness(0.9) hue-rotate(0deg); transform: translate(-2px, 2px) skewX(5deg); }
    40% { filter: brightness(0.8) hue-rotate(10deg); text-shadow: -2px 0 red; transform: translate(2px, -2px) skewY(-5deg); }
    60% { filter: brightness(1); transform: none; }
    80% { filter: brightness(0.95) hue-rotate(-5deg); transform: translate(1px, -1px); }
    100% { filter: brightness(1); transform: none; }
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 3px); }
    40% { transform: translate(3px, -3px); }
    60% { transform: translate(-3px, 3px); }
    80% { transform: translate(3px, -3px); }
    100% { transform: translate(0); }
}

.phase-6, .phase-6 body {
    background: url('/5bf612f09cd851bbbffd60d173331019.jpg') center/cover fixed;
    color: #ffcccc;
}

.phase-6 #user-profile, .phase-6 .header-links {
    opacity: 0.2;
}

.phase-6 #search-input {
    background-color: #331111;
    color: #ffcccc;
    border-color: #660000;
}

.phase-6 #search-buttons button {
    background-color: #440000;
    border-color: #660000;
    color: #ffaaaa;
}

#disclaimer-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 200;
    padding: 2rem;
}

#disclaimer-screen h1 {
    color: #f00;
    margin-bottom: 1rem;
}

#disclaimer-screen p {
    margin-bottom: 2rem;
    max-width: 600px;
}

#disclaimer-continue {
    background-color: #440000;
    border: 1px solid #660000;
    border-radius: 4px;
    color: #ffaaaa;
    font-size: 16px;
    padding: 10px 20px;
    cursor: pointer;
}

#disclaimer-continue:hover {
    background-color: #660000;
}

#eyes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    overflow: hidden;
}

.eye {
    position: absolute;
    width: 75px;
    height: 50px;
    background: url('/dhue8bn-6dae10ed-cbe8-4066-b34f-28d942f69a54.png') center/cover;
    border-radius: 50%;
    overflow: hidden;
    animation: eye-blink 5s infinite ease-in-out;
}

@keyframes eye-blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

.eye::before {
    content: none;
}

#game-over-screen, #ending-screen {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #000;
    color: red;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
}

#ending-screen {
    color: white;
}

#game-over-screen h1, #ending-screen h1 {
    font-size: 4rem;
    animation: flicker 1.5s infinite alternate;
}

@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
      text-shadow:
      0 0 4px #fff,
      0 0 11px #fff,
      0 0 19px #fff,
      0 0 40px #f09,
      0 0 80px #f09,
      0 0 90px #f09,
      0 0 100px #f09,
      0 0 150px #f09;
  }
  20%, 24%, 55% {        
      text-shadow: none;
  }
}

.eye-jumpscare {
    width: 80vmin;
    height: 50vmin;
    background: url('/dhue8bn-6dae10ed-cbe8-4066-b34f-28d942f69a54.png') center/cover no-repeat;
    border-radius: 50%;
    position: relative;
    animation: zoom-in 0.5s ease-out;
}
.eye-jumpscare::before {
    content: none;
}

@keyframes zoom-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes pupil-stare {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(0.8); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

#final-phase-text {
    text-align: center;
    color: #ffaaaa;
    font-size: 1.2rem;
}
#final-phase-text p {
    margin: 0.5rem;
}
#final-phase-text ul {
    list-style: none;
    padding: 0;
}
#final-phase-text li {
    font-style: italic;
    color: #ff7777;
    text-decoration: line-through;
}
#final-phase-text li.pending {
    text-decoration: none;
    color: #cc0000;
}

#interruption-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 300;
    padding: 2rem;
    backdrop-filter: blur(5px);
}

#chibi-girl {
    max-width: 300px;
    margin-bottom: 2rem;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

#interruption-text {
    font-size: 1.5rem;
    color: #ffcccc;
    text-shadow: 0 0 5px #f09, 0 0 10px #f09;
}