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

#chronos-raid-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #08081a;
    z-index: 20000;
    display: none;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    color: white;
    font-family: 'Noto Sans KR', sans-serif;
}

.raid-background-fx {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(74, 25, 112, 0.5) 0%, rgba(0, 0, 0, 1) 70%);
    opacity: 0.8;
    animation: backgroundPulse 10s infinite alternate;
}

@keyframes backgroundPulse {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

#raid-header {
    width: 100%;
    padding: 15px;
    text-align: center;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#raid-title {
    font-size: 2em;
    font-weight: bold;
    color: #b388ff;
    text-shadow: 0 0 10px #b388ff;
}

#raid-phase-info {
    font-size: 1.2em;
    margin-top: 5px;
    color: #ffcc00;
}

#raid-boss-hp-container {
    width: 60%;
    height: 30px;
    background-color: #333;
    border-radius: 15px;
    margin-top: 10px;
    overflow: hidden;
    position: relative;
    border: 2px solid #b388ff;
    margin-left: auto;
    margin-right: auto;
}

#raid-boss-hp-bar {
    height: 100%;
    background: linear-gradient(to right, #ff416c, #ff4b2b);
    transition: width 0.05s linear;
    width: 100%;
}

#raid-boss-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1em;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

#raid-phase-timer {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    z-index: 3;
    text-shadow: 2px 2px 5px black;
    transition: color 0.3s;
}

#timer-gauge-container {
    position: absolute;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 20px;
    background-color: rgba(50, 50, 50, 0.8);
    border-radius: 10px;
    overflow: hidden;
    z-index: 3;
    display: none;
}

#timer-gauge-bar {
    height: 100%;
    transition: width 0.1s linear, background-color 0.3s;
    background-color: #4caf50;
    width: 100%;
}

#raid-participant-list {
    position: absolute;
    top: 160px;
    left: 10px;
    width: 220px;
    height: calc(100% - 180px);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 15px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#raid-participant-list h3 {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #b388ff;
    padding-bottom: 10px;
    font-size: 1.2em;
}

#participant-list-container {
    flex-grow: 1;
    overflow-y: auto;
}

.participant-entry {
    padding: 6px 0;
    font-size: 0.95em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.participant-status {
    font-weight: bold;
    font-size: 0.85em;
    padding: 2px 5px;
    border-radius: 4px;
}
.status-cursed { background-color: #ff3b30; color: white; }
.status-stunned { background-color: #ffcc00; color: black; }
.status-decoder { background-color: #00ff00; color: black; }
.status-lost { background-color: #999999; color: white; }

#raid-arena {
    position: relative;
    width: 100%;
    flex-grow: 1;
    margin: 10px 0;
    z-index: 1;
}

.raid-player {
    position: absolute;
    color: white;
    font-weight: bold;
    white-space: nowrap;
    transition: top 0.05s linear, left 0.05s linear, opacity 0.3s, filter 0.3s;
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.player-name {
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    font-size: 1.1em;
}

.raid-player.cursed .player-name {
    color: #ff3b30;
    text-shadow: 0 0 8px #ff3b30;
    border: 3px solid #4a1a4c;
    background-color: rgba(10, 0, 10, 0.7);
    position: relative;
    z-index: 14;
}

.raid-player.cursed {
    position: relative;
    padding-bottom: 25px;
}
.raid-player.cursed::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translateX(-50%);
    background-image: url('/image/curse_shackles.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    animation: cursedPulse 1.5s infinite alternate ease-in-out;
    z-index: 155;
}

.raid-player.cursed .player-name {
    position: relative;
    z-index: 16;
    margin-top: 35px;
}

@keyframes cursedPulse {
    from {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.attack-fx {
    position: absolute;
    width: 100px;
    height: 120px;
    background-color: rgba(255, 165, 0, 0.7);
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.raid-player.attacking .attack-fx {
    animation: attackFade 0.3s forwards;
}

@keyframes attackFade {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.2); }
}

.raid-player[data-direction="up"] .attack-fx {
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, 0);
}
.raid-player[data-direction="down"] .attack-fx {
    top: 100%;
    left: 50%;
    transform: translate(-50%, 0);
}
.raid-player[data-direction="left"] .attack-fx {
    width: 120px;
    height: 100px;
    right: 100%;
    top: 50%;
    transform: translate(0, -50%);
}
.raid-player[data-direction="right"] .attack-fx {
    width: 120px;
    height: 100px;
    left: 100%;
    top: 50%;
    transform: translate(0, -50%);
}

.bullet {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: #00ff99;
    border-radius: 50%;
    box-shadow: 0 0 15px #00ff99;
    transform: translate(-50%, -50%);
    z-index: 5;
    transition: top 0.05s linear, left 0.05s linear;
    pointer-events: none;
}

.raid-boss {
    position: absolute;
    width: 200px;
    height: 200px;
    background-color: #6a0dad;
    border: 5px solid #b388ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    transform: translate(-50%, -50%);
    z-index: 8;
    transition: top 0.05s linear, left 0.05s linear;
    pointer-events: none;
}
.raid-boss::after {
    content: "크로노스";
}

.player-rescue-status {
    font-size: 0.9em;
    color: #ff9500;
    margin-top: 3px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

.player-buffs {
    display: flex;
    gap: 5px;
    margin-top: 3px;
}

.buff-icon {
    font-size: 1em;
    padding: 2px 5px;
    border-radius: 3px;
}

.buff-light { background-color: #ffff99; color: black; box-shadow: 0 0 8px #ffff99; }
.buff-dark { background-color: #9933ff; color: white; box-shadow: 0 0 8px #9933ff; }

#raid-announcement {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2em;
    font-weight: bold;
    color: #ffcc00;
    text-shadow: 0 0 15px #ffcc00, 0 0 5px black;
    z-index: 20;
    padding: 25px 50px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    display: none;
    text-align: center;
    max-width: 80%;
    animation: announcementFade 5s ease-out forwards;
}

.boss-dialogue {
    color: #b388ff;
    font-style: italic;
    margin-bottom: 15px;
    font-size: 1.1em;
}

@keyframes announcementFade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    10% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
    90% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

#ddr-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    display: none;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 30px 50px;
    border-radius: 20px;
    box-shadow: 0 0 30px #b388ff;
}

#ddr-timer-container {
    width: 400px;
    height: 25px;
    background-color: #555;
    border-radius: 15px;
    margin-bottom: 25px;
    overflow: hidden;
}

#ddr-timer {
    height: 100%;
    transition: width 0.05s linear, background-color 0.3s;
    background-color: #ffcc00;
    width: 100%;
}

#ddr-sequence {
    display: flex;
    gap: 20px;
}

.ddr-arrow {
    font-size: 4.5em;
    opacity: 0.5;
    transition: opacity 0.1s, transform 0.1s;
    background: #555;
    padding: 15px;
    border-radius: 15px;
}

.ddr-arrow.active {
    opacity: 1;
    transform: scale(1.2);
    color: #00ff00;
    background: #228822;
    box-shadow: 0 0 15px #00ff00;
}

.ddr-arrow.fail {
    opacity: 1;
    transform: scale(0.8);
    color: #ff0000;
    background: #882222;
}

#dark-altar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background-image: url('/image/dark_altar.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-weight: bold;
    box-shadow: none;
    cursor: pointer;
    z-index: 9;
}

.abyssal-wraith {
    position: absolute;
    border-radius: 50%;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: top 0.05s linear, left 0.05s linear, transform 0.2s;
    transform: translate(-50%, -50%);
    z-index: 7;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
}

.wraith-hp {
    position: absolute;
    bottom: -20px;
    font-weight: bold;
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 1em;
    text-shadow: none;
}


@keyframes flashRed {
    0% { filter: brightness(1); }
    50% { filter: brightness(2) sepia(1) hue-rotate(-50deg) saturate(5); }
    100% { filter: brightness(1); }
}

.wraith-normal {
    background-image: url('/image/wraith_normal.png');
    width: 90px;
    height: 90px;
}

.decoder-highlight .player-name {
    border: 3px solid #00ff00 !important;
    box-shadow: 0 0 20px #00ff00 !important;
    color: #00ff00 !important;
}

#simon-says-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    display: none;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 15px;
}

#simon-says-status {
    font-size: 1.5em;
    margin-bottom: 25px;
    text-align: center;
}

#simon-says-board {
    display: grid;
    grid-template-columns: 130px 130px;
    grid-template-rows: 130px 130px;
    gap: 20px;
}

.simon-button {
    width: 130px;
    height: 130px;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.1s;
    user-select: none;
}

#simon-red { background-color: red; border-top-left-radius: 130px; }
#simon-blue { background-color: blue; border-top-right-radius: 130px; }
#simon-green { background-color: green; border-bottom-left-radius: 130px; }
#simon-yellow { background-color: yellow; border-bottom-right-radius: 130px; }

.simon-button.active {
    opacity: 1;
    box-shadow: 0 0 30px white;
}

.p6-quadrant {
    position: absolute;
    width: 50%;
    height: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    box-sizing: border-box;
    pointer-events: none;
}

.p6-NW { top: 0; left: 0; }
.p6-NE { top: 0; right: 0; }
.p6-SW { bottom: 0; left: 0; }
.p6-SE { bottom: 0; right: 0; }

.p6-platform {
    position: absolute;
    width: 200px;
    height: 200px;
    background-image: url('/image/platform_inactive.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    transition: background-image 0.3s;
    pointer-events: none;
}

.p6-platform.active {
    background-image: url('/image/platform_success.png');
}

.p6-platform.p6-NW { top: 25%; left: 25%; transform: translate(-50%, -50%); }
.p6-platform.p6-NE { top: 25%; left: 75%; transform: translate(-50%, -50%); }
.p6-platform.p6-SW { top: 75%; left: 25%; transform: translate(-50%, -50%); }
.p6-platform.p6-SE { top: 75%; left: 75%; transform: translate(-50%, -50%); }

.player-red .player-name { border: 3px solid #ff4d4d; color: #ff4d4d; text-shadow: 0 0 5px #ff4d4d; }
.player-blue .player-name { border: 3px solid #4d4dff; color: #4d4dff; text-shadow: 0 0 5px #4d4dff; }

#p5-ui-container {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-radius: 10px;
    z-index: 15;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.p5-part1-ui {
    display: flex;
    gap: 50px;
    font-size: 1.5em;
    font-weight: bold;
}
.p5-score {
    display: flex;
    align-items: center;
    gap: 10px;
}
#p5-score-light { color: #ffff99; }
#p5-score-dark { color: #9933ff; }

.p5-part2-ui {
    display: flex;
    gap: 50px;
    align-items: flex-end;
    height: 120px;
}
.p5-size-gauge {
    width: 80px;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column-reverse;
}
.p5-size-bar {
    width: 100%;
    transition: height 0.3s ease-in-out, background-color 0.3s;
}
#p5-size-light-bar { background-color: #ffff99; }
#p5-size-dark-bar { background-color: #9933ff; }

.p8-core {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    animation: corePulse 3s infinite alternate;
    z-index: 5;
    transform: translate(-50%, -50%) scale(var(--core-scale, 1));
    transition: transform 0.5s ease-in-out;
}

@keyframes corePulse {
    from { box-shadow: 0 0 30px currentColor; }
    to { box-shadow: 0 0 60px currentColor; }
}

.core-light {
    top: 50%;
    left: 12.5%;
    background-color: #ffff99;
    color: #ffff99;
}
.core-dark {
    top: 50%;
    left: 87.5%;
    background-color: #9933ff;
    color: #9933ff;
}

.essence {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    animation: essenceFloat 2s infinite alternate;
    user-select: none;
    transform: translate(-50%, -50%);
    z-index: 5;
    transition: top 0.05s linear, left 0.05s linear;
    pointer-events: none;
}

@keyframes essenceFloat {
    from { transform: translate(-50%, -50%) translateY(0px); }
    to { transform: translate(-50%, -50%) translateY(-15px); }
}

.essence-light {
    background-image: url('/image/essence_light.png');
    background-color: transparent;
    box-shadow: none;
    background-size: contain;
    background-repeat: no-repeat;
}

.essence-dark {
    background-image: url('/image/essence_dark.png');
    background-color: transparent;
    box-shadow: none;
    background-size: contain;
    background-repeat: no-repeat;
}

.player-stunned {
    animation: stunShake 0.5s infinite;
    filter: grayscale(50%);
}

.player-stunned .player-name {
    color: #ffcc00 !important;
    border: 2px solid #ffcc00 !important;
}

@keyframes stunShake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-50%, -50%) rotate(-5deg); }
    75% { transform: translate(-50%, -50%) rotate(5deg); }
}

#raid-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 25000;
    display: none;
    justify-content: center;
    align-items: center;
    color: white;
}

.raid-result-content {
    background: #1c1f2d;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 900px;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px #b388ff;
}

#raid-result-title {
    font-size: 3em;
    text-align: center;
    margin-bottom: 20px;
}

.raid-result-success { color: #00ff00; text-shadow: 0 0 10px #00ff00; }
.raid-result-fail { color: #ff0000; text-shadow: 0 0 10px #ff0000; }

#raid-contribution-ranking {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th, .ranking-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #444;
}

.ranking-table th {
    background-color: #333;
    font-size: 1.2em;
}

.ranking-table tr:hover {
    background-color: #2a2d3d;
}

.rank-1 td { background-color: rgba(255, 215, 0, 0.2); }
.rank-2 td { background-color: rgba(192, 192, 192, 0.2); }
.rank-3 td { background-color: rgba(205, 127, 50, 0.2); }

#raid-result-close-btn {
    align-self: center;
    padding: 15px 40px;
    font-size: 1.5em;
    background-color: #b388ff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#participant-list-container::-webkit-scrollbar { width: 8px; }
#participant-list-container::-webkit-scrollbar-track { background: transparent; }
#participant-list-container::-webkit-scrollbar-thumb { background: #666; border-radius: 4px; }
#participant-list-container::-webkit-scrollbar-thumb:hover { background: #888; }