#shadow-cave-container.shadow-wave-mounted {
    --sw-accent: #b72b36;
    --sw-soft: rgba(183, 43, 54, 0.25);
    min-height: 680px;
    padding: 0;
    overflow: hidden;
    background: #040304;
    color: #e8e2d8;
    font-family: "Cairo", sans-serif;
}

.sw-shell {
    position: relative;
    min-height: 680px;
    isolation: isolate;
    background: #050405 center / cover no-repeat;
}

.sw-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(2, 2, 3, 0.45), rgba(3, 2, 3, 0.92) 70%, #030203);
}

.sw-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(4, 3, 4, 0.9);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.sw-title {
    color: #f4dfb0;
    font-size: 1.25rem;
    font-weight: 900;
}

.sw-subtitle {
    color: #8f8580;
    font-size: 0.72rem;
}

.sw-resource {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d4af37;
    font-weight: 800;
    white-space: nowrap;
}

.sw-layer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: rgba(212, 175, 55, 0.18);
}

.sw-layer {
    position: relative;
    min-height: 210px;
    padding: 18px;
    border: 0;
    border-radius: 0;
    color: #fff;
    text-align: right;
    background: #0a080a center / cover no-repeat;
    cursor: pointer;
    overflow: hidden;
}

.sw-layer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.92));
}

.sw-layer > * { position: relative; z-index: 1; }
.sw-layer:hover:not(:disabled) { filter: brightness(1.14); }
.sw-layer:disabled { cursor: not-allowed; filter: grayscale(1) brightness(0.45); }

.sw-layer-index {
    color: var(--layer-color, #d4af37);
    font-size: 0.68rem;
    font-weight: 900;
}

.sw-layer-name {
    margin-top: 76px;
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    text-shadow: 0 2px 8px #000;
}

.sw-layer-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    color: #c2b9ae;
    font-size: 0.72rem;
}

.sw-expedition-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 260px;
    min-height: 620px;
}

.sw-party,
.sw-run-panel {
    background: rgba(3, 3, 4, 0.91);
    padding: 14px;
}

.sw-party { border-left: 1px solid rgba(212, 175, 55, 0.18); }
.sw-run-panel { border-right: 1px solid rgba(212, 175, 55, 0.18); }

.sw-section-title {
    margin-bottom: 10px;
    color: #d4af37;
    font-size: 0.78rem;
    font-weight: 900;
}

.sw-unit {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #171417;
}

.sw-unit img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border: 1px solid var(--unit-color, #777);
    border-radius: 50%;
}

.sw-unit-name { color: #eee; font-size: 0.7rem; font-weight: 800; }
.sw-unit-role { color: #777; font-size: 0.58rem; }

.sw-hp-track {
    height: 6px;
    margin-top: 5px;
    background: #181318;
    overflow: hidden;
}

.sw-hp-fill { height: 100%; background: #8f2430; }
.sw-hp-text { margin-top: 2px; color: #81797a; font-size: 0.56rem; direction: ltr; text-align: right; }

.sw-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: 16px;
}

.sw-stats-band {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: rgba(2, 2, 3, 0.78);
    border: 1px solid rgba(212, 175, 55, 0.22);
}

.sw-stat {
    padding: 8px;
    text-align: center;
    border-left: 1px solid #211c1b;
}

.sw-stat:last-child { border-left: 0; }
.sw-stat span { display: block; color: #756d69; font-size: 0.58rem; }
.sw-stat b { display: block; margin-top: 2px; color: #f0dfba; font-size: 0.88rem; }

.sw-battle-runtime {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
    align-items: center;
    min-height: 48px;
    margin-top: 8px;
    padding: 7px 10px;
    border: 1px solid rgba(180, 39, 52, 0.55);
    background: rgba(5, 3, 4, 0.9);
}

.sw-battle-runtime.cooldown { border-color: rgba(212, 175, 55, 0.5); }
.sw-runtime-copy { min-width: 0; }
.sw-runtime-label { display: block; color: #f0d8aa; font-size: 0.72rem; }
.sw-runtime-detail { display: block; margin-top: 2px; color: #827976; font-size: 0.58rem; }

.sw-runtime-track {
    height: 7px;
    overflow: hidden;
    background: #191416;
    box-shadow: inset 0 0 5px #000;
}

.sw-runtime-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #6e111d, #d02c3f);
    transition: width 0.25s linear;
}

.sw-battle-runtime.cooldown .sw-runtime-fill { background: linear-gradient(90deg, #6f5818, #d4af37); }

.sw-encounter {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 310px;
    text-align: center;
}

.sw-monster-art {
    width: min(280px, 68%);
    height: 210px;
    object-fit: contain;
    filter: drop-shadow(0 18px 20px #000) drop-shadow(0 0 16px var(--sw-soft));
}

.sw-encounter.sw-colossus .sw-monster-art {
    width: min(480px, 92%);
    height: 330px;
    animation: swColossusBreath 2.4s ease-in-out infinite;
}

@keyframes swColossusBreath {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 18px 20px #000) drop-shadow(0 0 18px var(--sw-soft)); }
    50% { transform: scale(1.035); filter: drop-shadow(0 20px 24px #000) drop-shadow(0 0 32px var(--sw-accent)); }
}

.sw-enemy-kicker { color: var(--sw-accent); font-size: 0.65rem; font-weight: 900; }
.sw-enemy-name { color: #fff; font-size: 1.15rem; font-weight: 900; text-shadow: 0 2px 10px #000; }
.sw-enemy-parts { margin-top: 5px; color: #a59a94; font-size: 0.65rem; }

.sw-log {
    max-height: 170px;
    overflow-y: auto;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.72);
    border-top: 1px solid #221819;
    color: #c6bdba;
    font-size: 0.68rem;
    line-height: 1.65;
    scroll-behavior: smooth;
}

.sw-log-event { padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.035); }
.sw-log-event.intro { color: #d8c49c; font-weight: 800; }
.sw-log-event.victory { color: #77b885; font-weight: 800; }
.sw-log-event.defeat { color: #d65a64; font-weight: 800; }

.sw-controls {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 6px;
    padding-top: 10px;
}

.sw-btn {
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid #493237;
    border-radius: 4px;
    background: #100d0e;
    color: #cfc6c2;
    font-family: "Cairo", sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
}

.sw-btn:hover:not(:disabled), .sw-btn.active { border-color: var(--sw-accent); color: #fff; box-shadow: inset 0 0 12px var(--sw-soft); }
.sw-btn.primary { border-color: var(--sw-accent); color: #fff; background: rgba(93, 15, 25, 0.55); }
.sw-btn:disabled { opacity: 0.4; cursor: wait; }

.sw-reward-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #191619;
    color: #8d8581;
    font-size: 0.66rem;
}

.sw-reward-row b { color: #e1d2ad; }

.sw-pressure-track {
    height: 8px;
    margin: 8px 0 14px;
    background: #181318;
    overflow: hidden;
}

.sw-pressure-fill {
    height: 100%;
    background: linear-gradient(90deg, #58202a, #d02c3f);
}

.sw-checkpoint {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.88);
}

.sw-checkpoint-inner { width: min(680px, 100%); text-align: center; }
.sw-checkpoint-title { color: #d4af37; font-size: 1.15rem; font-weight: 900; }
.sw-choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }

.sw-choice {
    min-height: 128px;
    padding: 14px 10px;
    border: 1px solid #44383a;
    border-radius: 6px;
    background: #0c090a;
    color: #d8d0cc;
    cursor: pointer;
    font-family: "Cairo", sans-serif;
}

.sw-choice:hover { border-color: #d4af37; box-shadow: inset 0 0 18px rgba(212, 175, 55, 0.1); }
.sw-choice b { display: block; color: #f1dfb5; font-size: 0.82rem; }
.sw-choice span { display: block; margin-top: 6px; color: #8d8480; font-size: 0.65rem; line-height: 1.6; }

.sw-offline-report {
    margin: 8px 0;
    padding: 8px;
    border-right: 3px solid #d4af37;
    background: rgba(212, 175, 55, 0.08);
    color: #d8caab;
    font-size: 0.68rem;
}

@media (max-width: 980px) {
    .sw-layer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sw-expedition-layout { grid-template-columns: 1fr; }
    .sw-party { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 0; border-bottom: 1px solid #211c1b; }
    .sw-party .sw-section-title { grid-column: 1 / -1; }
    .sw-unit { grid-template-columns: 34px minmax(0, 1fr); padding: 4px; }
    .sw-unit img { width: 34px; height: 34px; }
    .sw-run-panel { border: 0; border-top: 1px solid #211c1b; }
}

@media (max-width: 620px) {
    .sw-layer-grid { grid-template-columns: 1fr; }
    .sw-layer { min-height: 160px; }
    .sw-layer-name { margin-top: 42px; }
    .sw-party { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sw-stats-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sw-controls { grid-template-columns: 1fr 1fr; }
    .sw-battle-runtime { grid-template-columns: 1fr; gap: 6px; }
    .sw-choice-grid { grid-template-columns: 1fr; }
    .sw-encounter.sw-colossus .sw-monster-art { height: 250px; }
}
