@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: #0a0a0f;
    color: #e0d8c8;
    height: 100vh;
    overflow: hidden;
}

.screen {
    display: none;
    height: 100vh;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ===== Language Selector ===== */
.lang-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.lang-btn {
    background: transparent;
    color: #5a5548;
    border: 1px solid #2a2520;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    color: #c8a84e;
    border-color: #c8a84e;
}

.lang-btn.active {
    color: #c8a84e;
    border-color: #c8a84e;
    background: rgba(200, 168, 78, 0.1);
}

/* ===== Title Screen ===== */
#title-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, #1a1520 0%, #0a0a0f 70%);
    text-align: center;
}

.title-content h1 {
    font-family: 'Noto Serif JP', serif;
    font-size: 3rem;
    color: #c8a84e;
    text-shadow: 0 0 30px rgba(200, 168, 78, 0.3);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3em;
}

.title-content .subtitle {
    font-size: 1rem;
    color: #8a8070;
    margin-bottom: 3rem;
    letter-spacing: 0.2em;
}

.title-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.btn-primary {
    background: linear-gradient(135deg, #c8a84e, #a08030);
    color: #1a1520;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.15em;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(200, 168, 78, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #8a8070;
    border: 1px solid #3a3530;
    padding: 0.7rem 2rem;
    font-size: 0.9rem;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    color: #c8a84e;
    border-color: #c8a84e;
}

/* ===== Case Select Screen ===== */
#case-select-screen {
    background: #0e0e14;
}

.case-select-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
}

.case-select-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #2a2520;
    margin-bottom: 1.5rem;
}

.case-select-header h2 {
    font-family: 'Noto Serif JP', serif;
    color: #c8a84e;
    font-size: 1.5rem;
    letter-spacing: 0.2em;
}

.case-replay-hint {
    color: #c8a84e;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    font-style: italic;
    opacity: 0.7;
}

.case-select-hint {
    color: #6a6050;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.case-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.case-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.2rem;
    background: #151520;
    border: 1px solid #2a2530;
    cursor: pointer;
    transition: all 0.2s;
}

.case-card:hover {
    border-color: #c8a84e;
    background: #1a1a28;
}

.case-card .case-number {
    font-size: 0.7rem;
    color: #5a5548;
    letter-spacing: 0.1em;
}

.case-card .case-title {
    font-size: 1.05rem;
    color: #e0d8c8;
    font-weight: 700;
}

.case-card .case-suspect {
    font-size: 0.8rem;
    color: #8a8070;
}

.case-select-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #2a2520;
    margin-top: 1.5rem;
}

/* ===== Briefing Screen ===== */
#briefing-screen {
    background: #0e0e14;
    padding: 2rem;
    overflow-y: auto;
}

.briefing-content {
    max-width: 700px;
    margin: 0 auto;
}

.briefing-header {
    text-align: center;
    border-bottom: 1px solid #2a2520;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.briefing-header h2 {
    font-family: 'Noto Serif JP', serif;
    color: #c8a84e;
    font-size: 1.5rem;
    letter-spacing: 0.2em;
}

.briefing-header .case-number {
    color: #6a6050;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.briefing-section {
    margin-bottom: 2rem;
}

.briefing-section h3 {
    color: #c8a84e;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
    border-left: 3px solid #c8a84e;
}

.briefing-section p,
.briefing-section li {
    color: #b0a890;
    line-height: 1.8;
    font-size: 0.95rem;
}

.briefing-section ul {
    list-style: none;
    padding-left: 1rem;
}

.briefing-section li::before {
    content: '▸ ';
    color: #c8a84e;
}

.suspect-profile {
    background: #151520;
    border: 1px solid #2a2530;
    padding: 1.5rem;
    margin-top: 1rem;
}

.suspect-profile .name {
    font-size: 1.2rem;
    color: #e0d8c8;
    font-weight: 700;
}

.suspect-profile .detail {
    color: #8a8070;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.briefing-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #2a2520;
}

/* ===== Interrogation Screen ===== */
#interrogation-screen {
    background: #0e0e14;
}

.interrogation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background: #12121a;
    border-bottom: 1px solid #2a2530;
    gap: 0.8rem;
}

.interrogation-header h3 {
    font-family: 'Noto Serif JP', serif;
    color: #c8a84e;
    font-size: 1rem;
    letter-spacing: 0.1em;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.contradiction-counter-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #8a8070;
    font-size: 0.8rem;
}

.counter-value {
    background: rgba(200, 168, 78, 0.1);
    border: 1px solid #3a3530;
    color: #c8a84e;
    padding: 0.2rem 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    min-width: 1.8rem;
    text-align: center;
    transition: all 0.3s;
}

.counter-bump {
    animation: bump 0.4s ease;
    border-color: #c8a84e;
    background: rgba(200, 168, 78, 0.25);
}

@keyframes bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Contradiction subtle notification */
.contradiction-notif {
    position: fixed;
    top: 4rem;
    right: 1.5rem;
    background: rgba(200, 168, 78, 0.9);
    color: #0a0a0f;
    padding: 0.5rem 1.2rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    border-left: 3px solid #c8a84e;
    transform: translateX(100%);
}

.contradiction-notif.show {
    animation: contradictionSlide 2s ease forwards;
}

@keyframes contradictionSlide {
    0% { transform: translateX(100%); opacity: 0; }
    15% { transform: translateX(0); opacity: 1; }
    75% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.btn-back {
    background: transparent;
    color: #8a8070;
    border: 1px solid #3a3530;
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.btn-back:hover {
    color: #c8a84e;
    border-color: #c8a84e;
}

.btn-info {
    background: transparent;
    color: #8a8070;
    border: 1px solid #3a3530;
    padding: 0.3rem 0.6rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-info:hover {
    color: #c8a84e;
    border-color: #c8a84e;
}

.case-info-modal-body {
    max-height: 80vh;
    overflow-y: auto;
}

.case-info-content .briefing-section {
    margin-bottom: 1.2rem;
}

.case-info-content .briefing-section h3 {
    color: #c8a84e;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    border-left: 3px solid #c8a84e;
    font-family: 'Noto Sans JP', sans-serif;
}

.case-info-content .briefing-section p,
.case-info-content .briefing-section li {
    color: #b0a890;
    line-height: 1.7;
    font-size: 0.9rem;
}

.case-info-content ul {
    list-style: none;
    padding-left: 1rem;
}

.case-info-content li::before {
    content: '▸ ';
    color: #c8a84e;
}

.btn-accuse {
    background: #8b2020;
    color: #e0d8c8;
    border: none;
    padding: 0.5rem 1.5rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.1em;
}

.btn-accuse:hover:not(:disabled) {
    background: #a52828;
    box-shadow: 0 0 15px rgba(139, 32, 32, 0.5);
}

.btn-accuse:disabled {
    background: #2a1a1a;
    color: #5a4848;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-accuse.accuse-unlocked {
    animation: accusePulse 2s infinite;
    opacity: 1;
}

@keyframes accusePulse {
    0%, 100% { box-shadow: 0 0 5px rgba(200, 50, 50, 0.2); }
    50% { box-shadow: 0 0 20px rgba(200, 50, 50, 0.6); }
}

/* Replay hint in chat */
.replay-hint {
    background: linear-gradient(135deg, #1a1a25, #201a28) !important;
    border: 1px solid rgba(200, 168, 78, 0.3) !important;
    color: #c8a84e !important;
    font-style: italic;
}

#chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    padding: 1rem 1.2rem;
    max-width: 85%;
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.system-message {
    align-self: center;
    background: #1a1a25;
    color: #7a7568;
    font-size: 0.85rem;
    text-align: center;
    max-width: 90%;
    border: 1px solid #2a2530;
}

.player-message {
    align-self: flex-end;
    background: #1a2530;
    border: 1px solid #2a3540;
    color: #b0c8e0;
}

.suspect-message {
    align-self: flex-start;
    background: #201a18;
    border: 1px solid #3a2a20;
    color: #d0b898;
}

.message .label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
}

.player-message .label {
    color: #5a8ab0;
}

.suspect-message .label {
    color: #b07848;
}

.typing-indicator .dots {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: #12121a;
    border-top: 1px solid #2a2530;
}

#player-input {
    flex: 1;
    background: #1a1a25;
    border: 1px solid #2a2530;
    color: #e0d8c8;
    padding: 0.8rem 1rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.95rem;
    resize: none;
    outline: none;
}

#player-input:focus {
    border-color: #c8a84e;
}

#player-input::placeholder {
    color: #4a4540;
}

#send-btn {
    background: #c8a84e;
    color: #1a1520;
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

#send-btn:hover {
    background: #d8b85e;
}

#send-btn:disabled {
    background: #4a4030;
    cursor: not-allowed;
}

/* ===== Modals ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal {
    background: #151520;
    border: 1px solid #2a2530;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
}

.modal h3 {
    color: #c8a84e;
    font-family: 'Noto Serif JP', serif;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

.modal input[type="password"],
.modal textarea {
    width: 100%;
    background: #1a1a25;
    border: 1px solid #2a2530;
    color: #e0d8c8;
    padding: 0.8rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    outline: none;
}

.modal textarea {
    height: 120px;
    resize: vertical;
}

.modal input:focus,
.modal textarea:focus {
    border-color: #c8a84e;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal .hint {
    color: #6a6050;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

/* ===== Notification ===== */
#notification {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #c8a84e;
    color: #1a1520;
    padding: 0.7rem 2rem;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 200;
    transition: transform 0.3s;
}

#notification.show {
    transform: translateX(-50%) translateY(0);
}

/* ===== Judgment Banner ===== */
.judgment-banner {
    align-self: center;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 2.5rem;
    margin: 1rem 0;
    border: 2px solid;
    text-align: center;
}

.judgment-grade {
    font-family: 'Noto Serif JP', serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.judgment-verdict {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.judgment-success {
    border-color: #c8a84e;
    background: rgba(200, 168, 78, 0.1);
    color: #c8a84e;
}

.judgment-partial {
    border-color: #a08040;
    background: rgba(160, 128, 64, 0.1);
    color: #a08040;
}

.judgment-failure {
    border-color: #8b3030;
    background: rgba(139, 48, 48, 0.1);
    color: #c05050;
}

/* ===== Restart ===== */
.restart-btn {
    align-self: center;
    margin-top: 1rem;
    background: linear-gradient(135deg, #c8a84e, #a08030);
    color: #1a1520;
    border: none;
    padding: 0.8rem 2rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 0.1em;
}

.restart-btn:hover {
    box-shadow: 0 5px 20px rgba(200, 168, 78, 0.3);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0e0e14;
}

::-webkit-scrollbar-thumb {
    background: #2a2530;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3530;
}

/* ===== Responsive ===== */
/* Message Counter */
.message-counter-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #8a8070;
    font-size: 0.8rem;
}

.msg-value {
    background: rgba(78, 168, 200, 0.1);
    border-color: #2a3540;
    color: #5a8ab0;
}

.payment-price {
    color: #c8a84e;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 1rem 0;
    text-align: center;
}

.msg-remaining {
    color: #5a8ab0;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

@media (max-width: 600px) {
    .title-content h1 {
        font-size: 2rem;
    }

    .message {
        max-width: 95%;
    }

    .briefing-content {
        padding: 0 0.5rem;
    }
}
