html { background-color: #000; }
body {
    color: #ff8c00; /* NERV Orange */
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px 0;
    box-sizing: border-box;
    text-transform: uppercase;
    overflow-y: auto; /* 모바일 스크롤 대응 */
    position: relative; /* 스태킹 컨텍스트 생성을 위해 추가 */
    z-index: 0; /* 스태킹 컨텍스트 생성을 위해 추가 */
}

#bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('NERV_Logo.webp');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: -1; /* body 스태킹 컨텍스트의 맨 뒤로 보냄 */
    pointer-events: none;
}

.container {
    border: 2px solid #ff8c00;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    background: rgba(20, 20, 20, 0.9);
    box-shadow: 0 0 15px #ff4500;
    position: relative;
}

h1 {
    color: #ff0000; /* Emergency Red */
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 5px #ff0000;
    border-bottom: 1px solid #ff0000;
    padding-bottom: 10px;
}
h1 a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.btn {
    background: #000;
    color: #ff8c00;
    border: 1px solid #ff8c00;
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: all 0.3s;
    font-family: inherit;
}

@media (hover: hover) {
    .btn:hover {
        background: #ff8c00;
        color: #000;
    }
}
.btn:active {
    background: #ff8c00;
    color: #000;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #555;
    color: #555;
}
.btn:disabled:hover {
    background: #000;
    color: #555;
}

.hidden {
    display: none;
}

.question-box {
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.options {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, 1fr); /* 2열 배치 */
}
.options .btn {
    margin-top: 0;
    height: 100%;
}

input[type="text"] {
    background: #000;
    border: 1px solid #ff8c00;
    color: #ff8c00;
    padding: 10px;
    width: calc(100% - 24px);
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 10px;
}

textarea {
    background: #000;
    border: 1px solid #ff8c00;
    color: #ff8c00;
    padding: 10px;
    width: calc(100% - 24px);
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 10px;
    resize: vertical;
}
.guestbook-form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.guestbook-form > input[type="text"] {
    width: 20%;
    margin-bottom: 0;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 0.8rem;
}
.guestbook-form > textarea {
    flex-grow: 1;
    width: auto;
    margin-bottom: 0;
    resize: none;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 0.8rem;
}
.guestbook-form > .btn {
    width: auto;
    margin-top: 0;
    padding: 4px 10px;
    font-size: 0.8rem;
}

.gb-entry {
    border-bottom: 1px solid #331a00;
    padding: 10px 0;
    font-size: 0.9rem;
}
.gb-header {
    color: #ff4500;
    font-weight: bold;
    margin-bottom: 5px;
}
.gb-date {
    font-size: 0.7rem;
    color: #666;
    float: right;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ff8c00;
    padding: 8px;
    text-align: center;
}

th {
    background-color: #331a00;
}

.decoration {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 20px;
    height: 20px;
    border-top: 2px solid #ff0000;
    border-left: 2px solid #ff0000;
}

#lang-selector {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    z-index: 10;
}
#lang-selector a {
    color: #ff8c00;
    text-decoration: none;
    padding: 0 5px;
    font-size: 1rem;
}
#lang-selector a:hover { color: #ff0000; }

.counter-container {
margin: 10px auto;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #ff8c00;
    padding: 5px 15px;
    font-size: 0.9rem;
width: fit-content;
}
.counter-item {
    margin: 0 10px;
}

/* 깜빡임 효과 */
@keyframes blink {
    0% { opacity: 1; color: #ff0000; }
    50% { opacity: 0.5; color: #ffff00; }
    100% { opacity: 1; color: #ff0000; }
}
.blink {
    animation: blink 0.5s infinite;
    font-weight: bold;
}

/* 모바일 대응 */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
        width: 95%;
    }
    h1 {
        font-size: 1.5rem;
    }
    .btn {
        font-size: 1rem;
        padding: 12px;
    }
}

#ui-chat {
    display: block;
    width: fit-content;
    text-align: center;
    margin: 20px auto 10px;
    border: 1px dashed #ff8c00;
    padding: 10px;
    color: #ff8c00;
    text-decoration: none;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.9);
    transition: all 0.3s;
    white-space: nowrap;
}
#ui-chat:hover {
    background: #ff8c00;
    color: #000;
}

/* 인트로 애니메이션 */
#intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
#intro-logo {
    width: 60%;
    max-width: 400px;
    animation: intro-effect 0.5s forwards;
}
@keyframes intro-effect {
    0% { opacity: 0; transform: scale(0.5); }
    20% { opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 20px #ff0000); }
    40% { opacity: 0.5; transform: scale(1); }
    60% { opacity: 1; filter: drop-shadow(0 0 10px #ff0000); }
    100% { opacity: 1; }
}

#flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0);
    pointer-events: none;
    z-index: 9998;
    transition: background-color 0.1s;
}
#flash-overlay.active {
    background-color: rgba(255, 0, 0, 0.4);
}

/* 콤보 효과 */
#combo-box {
    position: absolute;
    top: 60px;
    right: 20px;
    text-align: right;
    pointer-events: none;
    z-index: 5;
}
.combo-count {
    font-size: 1.5rem;
    color: #ffff00;
    font-weight: bold;
    text-shadow: 0 0 5px #ff4500;
}
.combo-message {
    font-size: 0.9rem;
    color: #ff0000;
    font-weight: bold;
    margin-top: 2px;
    text-shadow: 0 0 2px #000;
}
#sortie-display {
    text-align: right;
    color: #ff8c00;
    font-size: 0.9rem;
    margin-bottom: 10px;
    border-bottom: 1px solid #331a00;
    padding-bottom: 5px;
}
@keyframes pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1.2); opacity: 1; }
}