/* Alice Battlefield Styles (Reordered Conflict) */
#screen-alice-battle {
    background-color: #050508;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    font-family: 'serif', 'Pretendard', sans-serif;
    color: white;
    user-select: none;
    overflow: hidden;
    position: fixed !important;
    /* Force Fixed */
    top: 0;
    left: 0;
    z-index: 30000 !important;
    /* Highest Layer */
}

#alice-canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    /* Lightning on TOP */
    pointer-events: none;
    /* Click-through */
}

/* Debug Border - remove later */
#alice-game-ui {
    position: relative;
    z-index: 10;
    /* UI below canvas */
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    /* Container ignores clicks */
    padding: 20px;
    box-sizing: border-box;
    transition: opacity 1s ease;
    opacity: 1 !important;
    /* Safety fallback */
}

#screen-alice-battle .entity-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    pointer-events: auto;
    /* Enable interaction per area */
}

#screen-alice-battle .avatar {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 34px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

#screen-alice-battle .villain .avatar {
    border-color: #ff4d4d;
    color: #ff4d4d;
    box-shadow: 0 0 35px rgba(255, 0, 0, 0.4);
    animation: villainPulse 2s infinite ease-in-out;
}

@keyframes villainPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

#screen-alice-battle .warden .avatar {
    border-color: #4da6ff;
    color: #4da6ff;
    box-shadow: 0 0 35px rgba(77, 166, 255, 0.3);
}

#screen-alice-battle .card-container {
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

#screen-alice-battle .card {
    width: 72px;
    height: 100px;
    background: rgba(10, 10, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#screen-alice-battle .card:hover:not(.disabled) {
    transform: translateY(-5px);
    border-color: #00ffff;
    background: rgba(20, 20, 40, 1);
}

#screen-alice-battle .villain .card {
    cursor: default;
    pointer-events: none;
}

#screen-alice-battle .card.disabled {
    opacity: 0.2;
    cursor: not-allowed;
    filter: grayscale(1);
}

#screen-alice-battle .card i {
    font-size: 20px;
    margin-bottom: 2px;
}

#screen-alice-battle .card span {
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    opacity: 0.7;
}

#screen-alice-battle .card .power-val {
    margin-top: 5px;
    font-size: 13px;
    color: #00ffcc;
    font-family: monospace;
    font-weight: bold;
}

#screen-alice-battle .villain .card .power-val {
    color: #ff6666;
}

#screen-alice-battle .middle-text {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 550px;
    margin: 0 auto;
    text-align: center;
    opacity: 0.12;
    font-style: italic;
    line-height: 1.4;
    pointer-events: none;
    overflow: hidden;
    font-size: 14px;
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
}

#screen-alice-battle .status-bar {
    width: 140px;
    height: 8px;
    background: #111;
    border-radius: 4px;
    overflow: hidden;
}

#screen-alice-battle .hp {
    height: 100%;
    width: 100%;
    transition: width 0.3s ease-out;
}

#screen-alice-battle .villain .hp {
    background: #ff4d4d;
}

#screen-alice-battle .warden .hp {
    background: #4da6ff;
}

#screen-alice-battle .entity-name {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

#screen-alice-battle .battle-log {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 220px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
}

#alice-final-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    background: #000;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#alice-final-screen.active {
    display: flex;
    opacity: 1;
}

.story-container {
    max-width: 650px;
    line-height: 1.7;
    font-size: 17px;
    text-align: center;
    padding: 20px;
}

.story-clean {
    color: #ddd;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.story-corrupted {
    color: #ff4d4d;
    font-family: monospace;
    letter-spacing: -1px;
    background: rgba(255, 0, 0, 0.05);
    padding: 20px;
    border-radius: 8px;
}

.alice-rift {
    position: absolute;
    background: #fff;
    opacity: 0.5;
    z-index: 101;
    box-shadow: 0 0 8px #fff;
}

.result-header {
    font-size: 55px;
    margin-bottom: 20px;
    font-weight: 900;
    letter-spacing: 8px;
}

#alice-restart-btn {
    margin-top: 40px;
    padding: 12px 30px;
    background: transparent;
    border: 1px solid #555;
    color: white;
    cursor: pointer;
    border-radius: 4px;
}

#alice-restart-btn:hover {
    background: white;
    color: black;
}

@media (max-height: 600px) {
    #screen-alice-battle .middle-text {
        display: none;
    }
}