:root {
    --bg-color: #2b1f47;
    --border-color: #fff;
    --text-color: #fff;
    --font-rpg: 'DotGothic16', sans-serif;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    font-family: var(--font-rpg);
    overflow: hidden;
}

#game-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ensure Phaser canvas doesn't blur on resize */
canvas {
    image-rendering: pixelated;
}

.hidden {
    display: none !important;
}

/* Dialog Box */
#ui-layer {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    z-index: 10;
}

#dialog-box {
    background: rgba(43, 31, 71, 0.85);
    border: 4px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    color: var(--text-color);
    box-shadow: 4px 4px 0 rgba(255,255,255,0.2);
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

#dialog-text {
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

#input-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.3s;
}

textarea {
    font-family: var(--font-rpg);
    font-size: 1.2rem;
    padding: 10px;
    background: #3d2b63;
    color: #fff;
    border: 2px solid #6c52a3;
    border-radius: 4px;
    resize: none;
}

textarea:focus {
    outline: none;
    border-color: #fff;
}

button {
    font-family: var(--font-rpg);
    font-size: 1.2rem;
    padding: 10px 20px;
    background: #2b1f47;
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    align-self: flex-end;
    transition: all 0.2s;
    border-radius: 4px;
}

button:hover {
    background: #fff;
    color: #2b1f47;
}

/* Matrix Overlay */
#matrix-layer, #report-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(43, 31, 71, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

@keyframes retroPop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.matrix-container, .report-container {
    background: #000;
    border: 4px solid #fff;
    border-radius: 0;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: retroPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: inset 0 0 0 2px #000, inset 0 0 0 6px #fff;
}

h2 {
    text-align: center;
    margin: 0;
    font-size: 2rem;
    border-bottom: 2px dashed #fff;
    padding-bottom: 10px;
}

.matrix-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 600px) {
    .matrix-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.matrix-cell {
    border: 2px solid #6c52a3;
    padding: 15px;
    background: #4b367c;
    border-radius: 6px;
    opacity: 0;
    animation: retroPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.matrix-cell h3 {
    margin: 0 0 10px 0;
    color: #f1c40f;
    font-size: 1.2rem;
}

.matrix-cell p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.5;
    color: #ddd;
}

.report-container {
    font-size: 1.2rem;
    line-height: 1.8;
}

#report-content .section {
    border: 2px dashed #fff;
    padding: 20px;
    background: transparent;
    border-radius: 0;
    margin-bottom: 15px;
    text-align: left;
    opacity: 0;
    animation: retroPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#report-content .section:nth-child(1) { animation-delay: 0.2s; }
#report-content .section:nth-child(2) { animation-delay: 0.4s; }
#report-content .section:nth-child(3) { animation-delay: 0.6s; }
#report-content .section:nth-child(4) { animation-delay: 0.8s; }
#report-content .section:nth-child(5) { animation-delay: 1.0s; }
#report-content .section:nth-child(6) { animation-delay: 1.2s; }

#report-content h3 {
    color: #f1c40f;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid #fff;
    padding-bottom: 8px;
    text-shadow: 2px 2px 0px #000;
}

#report-content p {
    line-height: 1.8;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #fff;
}

#report-content strong {
    color: #f1c40f;
    font-weight: bold;
    text-shadow: 1px 1px 0px #000;
}
