/* Play module: world map board */
.play-module .perso-module-head {
    align-items: center;
}

.play-head-tools {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.play-create-token {
    cursor: pointer;
}

.play-create-token.is-active {
    border-color: rgba(250, 204, 21, 0.82);
    background: rgba(250, 204, 21, 0.14);
}

.play-world-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 0.9rem;
    align-items: start;
}

.play-world-board-wrap {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(250, 204, 21, 0.25);
    background: rgba(6, 8, 12, 0.76);
    padding: 0.45rem;
}

.play-world-viewport {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: min(78vh, 900px);
    overflow: auto;
    border: 1px solid rgba(250, 204, 21, 0.14);
    background: rgba(4, 6, 10, 0.85);
    cursor: grab;
}

.play-world-stage {
    width: 100%;
    height: 100%;
}

.play-world-viewport.is-dragging-pan {
    cursor: grabbing;
    user-select: none;
}

.play-world-board {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(40, minmax(0, 1fr));
    grid-template-rows: repeat(40, minmax(0, 1fr));
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15)),
        url('/worldmap.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid rgba(250, 204, 21, 0.16);
}

.play-world-board.is-placement-mode {
    background-image:
        linear-gradient(45deg, rgba(250, 204, 21, 0.08) 25%, transparent 25%, transparent 50%, rgba(250, 204, 21, 0.08) 50%, rgba(250, 204, 21, 0.08) 75%, transparent 75%, transparent),
        linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)),
        url('/worldmap.png');
    background-size: 10px 10px, 100% 100%, 100% 100%;
    background-repeat: repeat, no-repeat, no-repeat;
    background-position: 0 0, center, center;
}

.play-placement-hint {
    margin: 0 0 0.4rem;
    font-family: 'Orbitron', 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(250, 204, 21, 0.95);
}

.play-world-cell {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.06);
    padding: 0;
    border-radius: 0;
    cursor: pointer;
    overflow: hidden;
}

.play-world-cell.has-match {
    background: rgba(0, 0, 0, 0.18);
}

.play-world-cell.is-pending-placement {
    outline: 1px solid rgba(74, 222, 128, 0.9);
    outline-offset: -1px;
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.35);
}

.play-world-cell.is-click-anim::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(250, 204, 21, 0.82);
    pointer-events: none;
    animation: playCellPulse 260ms ease-out;
}

@keyframes playCellPulse {
    0% {
        opacity: 0.95;
        transform: scale(0.94);
    }
    100% {
        opacity: 0;
        transform: scale(1.05);
    }
}

.play-world-flag {
    width: 12px;
    height: 12px;
    color: rgba(250, 204, 21, 0.92);
}

.play-tooltip {
    position: fixed;
    z-index: 1200;
    min-width: 190px;
    border: 1px solid rgba(250, 204, 21, 0.3);
    background: rgba(8, 10, 14, 0.96);
    padding: 0.45rem 0.55rem;
    pointer-events: none;
}

.play-tooltip p {
    margin: 0;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    color: rgba(241, 245, 249, 0.9);
}

.play-tooltip p + p {
    margin-top: 0.16rem;
}

.play-editor-sidebar {
    position: sticky;
    top: 82px;
}

.play-editor-sidebar.is-disabled {
    opacity: 0.52;
    filter: grayscale(0.2);
}

.play-editor-sidebar .map-sidebar-block {
    min-height: 220px;
}

.play-editor-coords {
    margin: 0;
    font-size: 0.68rem;
    color: rgba(250, 204, 21, 0.9);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.play-editor-status {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: rgba(250, 204, 21, 0.95);
    text-transform: uppercase;
}

.play-editor-actions {
    display: grid;
    gap: 0.42rem;
}

.play-placement-actions {
    position: absolute;
    right: 0.8rem;
    bottom: 0.8rem;
    display: flex;
    gap: 0.4rem;
    z-index: 3;
}

.play-zoom-actions {
    position: absolute;
    left: 0.8rem;
    bottom: 0.8rem;
    display: flex;
    gap: 0.4rem;
    z-index: 3;
}

.play-zoom-btn {
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
    padding: 0.35rem;
}

.play-placement-btn {
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
    padding: 0.35rem;
}

.play-placement-btn span {
    display: none;
}

.play-join-block {
    min-height: auto;
}

.play-join-btn {
    width: 100%;
    justify-content: center;
}

.play-join-players {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: rgba(241, 245, 249, 0.9);
}

@media (max-width: 1300px) {
    .play-world-layout {
        grid-template-columns: 1fr;
    }

    .play-editor-sidebar {
        position: static;
    }
}

@media (max-width: 700px) {
    .play-world-viewport {
        max-height: min(72vh, 92vw);
    }

    .play-tooltip {
        display: none;
    }

    .play-placement-hint {
        font-size: 0.66rem;
        letter-spacing: 0.05em;
    }

    .play-placement-actions {
        right: 0.55rem;
        bottom: 0.55rem;
    }

    .play-zoom-actions {
        left: 0.55rem;
        bottom: 0.55rem;
    }
}

.play-lobby-module .play-lobby-layout {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    gap: 16px;
    padding: 12px;
}

.play-lobby-player {
    border: 1px solid rgba(255, 218, 79, 0.45);
    padding: 12px;
    background: linear-gradient(180deg, rgba(20, 19, 16, 0.78), rgba(10, 10, 8, 0.82));
}

.play-lobby-player.is-ready {
    box-shadow: inset 0 0 0 1px rgba(140, 255, 161, 0.4);
}

.play-lobby-player-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.play-lobby-player-head h3 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
}

.play-lobby-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.play-lobby-slot {
    min-height: 176px;
    border: 1px solid rgba(255, 218, 79, 0.45);
    padding: 8px;
    display: grid;
    gap: 8px;
    align-content: start;
    background: rgba(8, 8, 8, 0.62);
}

.play-lobby-slot.is-filled {
    cursor: pointer;
}

.play-lobby-slot-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    justify-items: center;
}

.play-lobby-slot-thumb {
    width: 84px;
    height: 108px;
    object-fit: cover;
    border: 1px solid rgba(250, 204, 21, 0.36);
    background: rgba(4, 4, 4, 0.7);
}

.play-lobby-slot-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 226, 138, 0.72);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.play-lobby-slot-name {
    font-size: 0.74rem;
    color: rgba(255, 231, 141, 0.94);
    min-height: 34px;
    line-height: 1.2;
    text-align: center;
}

.play-lobby-slot-trigger {
    width: 100%;
    min-height: 30px;
    padding: 0.32rem 0.4rem;
    font-size: 0.7rem;
}

.play-lobby-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.play-lobby-start {
    min-width: 220px;
    min-height: 64px;
    font-size: 1.2rem;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.08em;
}

.play-lobby-join-side {
    margin-top: 10px;
}

.play-lobby-persona-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.play-lobby-persona-choice {
    justify-content: flex-start;
    gap: 10px;
    min-height: 190px;
    padding: 10px;
    flex-direction: column;
    align-items: center;
}

.play-lobby-persona-choice.is-active {
    border-color: rgba(250, 204, 21, 0.78);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.36);
}

.play-lobby-persona-thumb {
    width: 100px;
    height: 128px;
    object-fit: cover;
    border: 1px solid rgba(250, 204, 21, 0.34);
    background: rgba(3, 4, 6, 0.82);
    flex: 0 0 auto;
}

.play-lobby-persona-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 232, 152, 0.78);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.play-lobby-persona-meta {
    display: grid;
    gap: 2px;
    text-align: center;
}

.play-lobby-persona-meta strong {
    color: rgba(255, 237, 170, 0.98);
    font-size: 0.78rem;
    line-height: 1.15;
}

.play-lobby-persona-meta small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.66rem;
    letter-spacing: 0.04em;
}

.play-lobby-sheet-panel {
    width: min(920px, 94vw);
    max-height: 90dvh;
}

.play-lobby-sheet-content {
    padding: 12px 14px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    display: grid;
    gap: 12px;
}

.play-lobby-sheet-top {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 12px;
}

.play-lobby-sheet-portrait {
    width: 130px;
    height: 170px;
    object-fit: cover;
    border: 1px solid rgba(250, 204, 21, 0.4);
    background: rgba(3, 4, 6, 0.9);
}

.play-lobby-sheet-portrait-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 231, 141, 0.72);
}

.play-lobby-sheet-main h3 {
    margin: 0 0 4px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.06em;
}

.play-lobby-sheet-sub {
    margin: 0 0 8px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.75rem;
}

.play-lobby-sheet-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    font-size: 0.74rem;
}

.play-lobby-sheet-attacks {
    display: grid;
    gap: 8px;
}

.play-lobby-sheet-attack {
    border: 1px solid rgba(250, 204, 21, 0.25);
    padding: 8px;
    background: rgba(6, 8, 10, 0.72);
}

.play-lobby-sheet-attack h4 {
    margin: 0 0 4px;
    font-size: 0.82rem;
    color: rgba(255, 236, 173, 0.96);
}

.play-lobby-sheet-attack p {
    margin: 0;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.78);
}

.play-lobby-sheet-attack p + p {
    margin-top: 3px;
}

.play-lobby-sheet-lore h4 {
    margin: 0 0 4px;
    font-size: 0.8rem;
}

.play-lobby-sheet-lore p {
    margin: 0;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.78);
    white-space: pre-wrap;
}

@media (max-width: 760px) {
    .play-lobby-module .play-lobby-layout {
        grid-template-rows: auto auto auto;
        gap: 12px;
        padding: 8px 4px 12px;
    }

    .play-lobby-player-head {
        flex-direction: column;
        align-items: stretch;
    }

    .play-lobby-slots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .play-lobby-start {
        width: 100%;
        min-width: 0;
    }

    .play-lobby-persona-grid {
        grid-template-columns: 1fr;
    }

    .play-lobby-sheet-top {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .play-lobby-sheet-main {
        width: 100%;
    }

    .play-lobby-sheet-panel {
        width: 96vw;
        max-height: 92dvh;
        margin: 3vh auto 0;
    }

    .play-lobby-sheet-content {
        max-height: calc(92dvh - 72px);
        padding: 10px 10px 14px;
    }
}

.play-battle-root {
    position: relative;
    display: block;
    width: 100%;
    height: min(82vh, calc(100dvh - 132px));
    min-height: 440px;
    overflow: hidden;
    background: rgba(4, 6, 8, 0.92);
}

.play-battle-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.play-battle-attack-line {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: var(--play-battle-board-size, 100%);
    height: var(--play-battle-board-size, 100%);
    z-index: 11;
    pointer-events: none;
}

.play-battle-attack-line-path {
    fill: none;
    stroke: rgba(248, 113, 113, 0.95);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-dasharray: 5 4;
    animation: playBattleAttackDash 720ms linear infinite;
}

.play-battle-attack-line-path.is-attack-vector {
    stroke-width: 2.2;
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.9));
}

.play-battle-fx-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
}

.play-battle-fx-msg {
    position: absolute;
    left: 50%;
    top: 14px;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.08em;
    font-size: 0.62rem;
    color: rgba(231, 236, 245, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: rgba(3, 8, 16, 0.84);
    padding: 2px 8px;
    overflow: hidden;
    animation: playFxGlitchSlice 520ms steps(2, end) 1;
}

.play-battle-fx-msg::before,
.play-battle-fx-msg::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    padding: 2px 8px;
    pointer-events: none;
    opacity: 0;
}

.play-battle-fx-msg::before {
    color: rgba(125, 211, 252, 0.9);
    clip-path: inset(0 0 48% 0);
    animation: playFxSliceTop 520ms steps(2, end) 1;
}

.play-battle-fx-msg::after {
    color: rgba(248, 113, 113, 0.9);
    clip-path: inset(52% 0 0 0);
    animation: playFxSliceBottom 520ms steps(2, end) 1;
}

.play-battle-fx-msg.is-warning {
    color: rgba(250, 204, 21, 0.98);
    border-color: rgba(250, 204, 21, 0.5);
}

.play-battle-fx-msg.is-danger {
    color: rgba(248, 113, 113, 0.98);
    border-color: rgba(248, 113, 113, 0.55);
}

.play-battle-fx-msg.is-leaving {
    opacity: 0;
    transform: translate(-50%, -8px);
    transition: opacity 160ms linear, transform 160ms ease-out;
}

.play-battle-fx-msg.is-anchored {
    transform: translate(0, -50%);
}

.play-battle-fx-msg.is-anchored.is-leaving {
    transform: translate(0, calc(-50% - 6px));
}

.play-battle-fx-float {
    position: absolute;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.86rem;
    font-weight: 700;
    color: rgba(245, 248, 255, 0.96);
    text-shadow: 0 0 8px rgba(248, 250, 252, 0.45);
    animation: playFxFloatRise 1400ms cubic-bezier(0.2, 0.8, 0.2, 1) 1;
}

.play-battle-fx-float.is-hit {
    color: rgba(250, 204, 21, 0.98);
}

.play-battle-fx-float.is-crit {
    color: rgba(248, 113, 113, 0.98);
}

.play-battle-fx-float.is-miss {
    color: rgba(148, 163, 184, 0.95);
}

.play-battle-fx-float.is-status {
    color: rgba(96, 165, 250, 0.98);
}

.play-battle-fx-float.is-leaving {
    opacity: 0;
}

@keyframes playBattleAttackDash {
    to {
        stroke-dashoffset: -18;
    }
}

.play-battle-viewport {
    width: 100%;
    height: 100%;
    overflow: auto;
    cursor: grab;
}

.play-battle-viewport.is-dragging-pan {
    cursor: grabbing;
    user-select: none;
}

.play-battle-stage {
    position: relative;
    width: 100%;
    height: 100%;
}

.play-battle-board {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--play-battle-board-size, 100%);
    height: var(--play-battle-board-size, 100%);
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: repeat(var(--battle-width, 30), minmax(0, 1fr));
    grid-template-rows: repeat(var(--battle-height, 30), minmax(0, 1fr));
}

.play-battle-cell {
    position: relative;
}

.play-battle-cell.is-reachable::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(96, 165, 250, 0.88);
    background: rgba(59, 130, 246, 0.2);
    pointer-events: none;
    z-index: 2;
}

.play-battle-cell.is-attack-range::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(248, 113, 113, 0.92);
    background: rgba(239, 68, 68, 0.2);
    pointer-events: none;
    z-index: 2;
}

.play-battle-cell.is-attack-hover::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(252, 165, 165, 0.96);
    pointer-events: none;
    z-index: 2;
}

.play-battle-cell.is-attack-target::before {
    content: '';
    position: absolute;
    inset: 1px;
    border: 1px solid rgba(254, 202, 202, 0.95);
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.65);
    pointer-events: none;
    z-index: 2;
}

.play-battle-cell.is-target-lock::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(254, 226, 226, 0.92);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.45), inset 0 0 0 1px rgba(248, 113, 113, 0.45);
    z-index: 3;
}

.play-battle-cell.is-target-lock-pulse::after {
    animation: playTargetLockPulse 320ms ease-out 1;
}

.play-battle-cell.is-move-step::after {
    content: '';
    position: absolute;
    inset: 1px;
    border: 1px solid rgba(125, 211, 252, 0.86);
    background: repeating-linear-gradient(-45deg, rgba(56, 189, 248, 0.32) 0, rgba(56, 189, 248, 0.32) 4px, rgba(2, 132, 199, 0.18) 4px, rgba(2, 132, 199, 0.18) 8px);
    z-index: 3;
}

.play-battle-unit {
    position: absolute;
    inset: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    color: rgba(255, 239, 181, 0.95);
}

.play-battle-unit.is-active-unit {
    animation: battleUnitActivePulse 920ms ease-in-out infinite;
}

.play-battle-unit.is-selected {
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.8));
}

.play-battle-unit.is-select-pulse {
    animation: playSelectedPulse 320ms ease-out 1;
}

.play-battle-unit.is-hop-step {
    animation: playHopStep 150ms ease-out 1;
}

.play-battle-cell.is-impact-sword,
.play-battle-cell.is-impact-lance,
.play-battle-cell.is-impact-bow,
.play-battle-cell.is-impact-axe,
.play-battle-cell.is-impact-magic {
    animation: playImpactFlash 240ms linear 1;
}

.play-battle-cell.is-impact-axe {
    animation-duration: 300ms;
}

.play-battle-cell.is-impact-magic {
    filter: contrast(1.16) saturate(1.18);
}

.play-battle-fx-float.is-hit {
    animation-duration: 1200ms;
}

.play-battle-fx-float.is-crit {
    animation-duration: 1500ms;
}

.play-battle-fx-float.is-miss {
    animation-duration: 1300ms;
}

.play-battle-fx-float.is-status {
    animation-duration: 1600ms;
}

.play-battle-unit.is-p1 {
    color: rgba(96, 165, 250, 0.95);
}

.play-battle-unit.is-p2 {
    color: rgba(251, 113, 133, 0.95);
}

.play-battle-unit .lucide {
    width: 50%;
    height: 50%;
    color: inherit;
}

@keyframes battleUnitActivePulse {
    0% {
        transform: scale(0.92);
        opacity: 0.84;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.92);
        opacity: 0.84;
    }
}

@keyframes playSelectedPulse {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes playHopStep {
    0% { transform: translateY(0); }
    45% { transform: translateY(-16%); }
    100% { transform: translateY(0); }
}

@keyframes playImpactFlash {
    0% { filter: brightness(1.7); }
    100% { filter: brightness(1); }
}

@keyframes playTargetLockPulse {
    0% { opacity: 0.45; }
    100% { opacity: 1; }
}

@keyframes playFxFloatRise {
    0% { opacity: 0; transform: translate(-50%, -10%); }
    12% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -130%); }
}

@keyframes playFxGlitchSlice {
    0% { opacity: 0.2; filter: blur(0.7px); letter-spacing: 0.12em; }
    30% { opacity: 1; filter: none; letter-spacing: 0.08em; }
    60% { opacity: 0.85; filter: contrast(1.18); }
    100% { opacity: 1; filter: none; }
}

@keyframes playFxSliceTop {
    0% { opacity: 0; transform: translateX(0); }
    20% { opacity: 0.9; transform: translateX(-2px); }
    45% { opacity: 0.45; transform: translateX(1px); }
    70% { opacity: 0.7; transform: translateX(-1px); }
    100% { opacity: 0; transform: translateX(0); }
}

@keyframes playFxSliceBottom {
    0% { opacity: 0; transform: translateX(0); }
    18% { opacity: 0.85; transform: translateX(2px); }
    42% { opacity: 0.35; transform: translateX(-1px); }
    68% { opacity: 0.65; transform: translateX(1px); }
    100% { opacity: 0; transform: translateX(0); }
}

.play-battle-board.is-impact-freeze {
    animation: playImpactFreeze 80ms steps(2, end) 1;
}

@keyframes playImpactFreeze {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(calc(-50% + 1px), calc(-50% - 1px)) scale(1.004); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.play-battle-menu-panel[hidden] {
    display: none;
}

.play-battle-turn-order[hidden] {
    display: none;
}

.play-battle-turn-order {
    position: absolute;
    left: 10px;
    top: 44px;
    z-index: 12;
    min-width: 230px;
    max-width: min(42vw, 360px);
    border: 1px solid rgba(250, 204, 21, 0.28);
    background: rgba(8, 10, 13, 0.9);
    padding: 8px 10px;
    display: grid;
    gap: 6px;
    pointer-events: auto;
}

.play-battle-history-inline-row {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 13;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: min(92vw, 980px);
    pointer-events: auto;
}

.play-battle-history-toggle {
    min-height: 28px;
    padding-inline: 0.45rem;
    flex: 0 0 auto;
}

.play-battle-history-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    border: 1px solid rgba(250, 204, 21, 0.22);
    background: rgba(8, 10, 13, 0.86);
    padding: 3px 6px;
    max-width: min(86vw, 900px);
    overflow: hidden;
}

.play-battle-history-inline-item {
    max-width: min(28vw, 260px);
    padding: 2px 5px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.38);
    color: rgba(226, 232, 240, 0.84);
    font-size: 0.58rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.play-battle-history-inline-item.is-empty {
    max-width: none;
    border-style: dashed;
    color: rgba(200, 208, 220, 0.72);
}

.play-battle-history {
    position: absolute;
    left: 10px;
    top: 44px;
    z-index: 12;
    width: min(460px, calc(100% - 20px));
    max-height: min(44vh, 300px);
    border: 1px solid rgba(250, 204, 21, 0.28);
    background: rgba(8, 10, 13, 0.9);
    padding: 8px 10px;
    display: grid;
    gap: 6px;
    pointer-events: auto;
    overflow: auto;
}

.play-battle-history.is-hidden {
    display: none;
}

.play-battle-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(250, 204, 21, 0.96);
}

.play-battle-history-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.play-battle-history-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
    font-size: 0.64rem;
    color: rgba(236, 240, 245, 0.86);
}

.play-battle-history-item.is-empty {
    grid-template-columns: 1fr;
    color: rgba(200, 208, 220, 0.78);
}

.play-battle-history-revision {
    color: rgba(250, 204, 21, 0.88);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.04em;
}

.play-battle-history-summary {
    color: rgba(236, 240, 245, 0.86);
}

.play-battle-attack-preview {
    position: absolute;
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
    z-index: 14;
    width: min(520px, calc(100% - 20px));
    border: 1px solid rgba(250, 204, 21, 0.34);
    background: rgba(8, 10, 13, 0.95);
    padding: 10px;
    display: grid;
    gap: 8px;
    pointer-events: auto;
}

.play-battle-attack-preview.is-hidden {
    display: none;
}

.play-battle-attack-preview header strong {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    color: rgba(255, 234, 168, 0.97);
}

.play-battle-attack-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
}

.play-battle-attack-preview-grid p,
.play-battle-attack-preview-meta p {
    margin: 0;
    font-size: 0.67rem;
    color: rgba(242, 245, 249, 0.86);
}

.play-battle-preview-calc {
    color: rgba(170, 178, 191, 0.72);
    font-size: 0.58rem;
    letter-spacing: 0.02em;
}

.play-battle-attack-preview-hp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.play-battle-attack-preview-hp-track {
    position: relative;
    height: 12px;
    border: 1px solid rgba(250, 204, 21, 0.3);
    background: rgba(24, 24, 24, 0.72);
    overflow: hidden;
}

.play-battle-attack-preview-hp-current {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: rgba(34, 197, 94, 0.34);
}

.play-battle-attack-preview-hp-loss {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: repeating-linear-gradient(-45deg, rgba(239, 68, 68, 0.84) 0, rgba(239, 68, 68, 0.84) 5px, rgba(153, 27, 27, 0.96) 5px, rgba(153, 27, 27, 0.96) 10px);
}

.play-battle-attack-preview-hp-after {
    white-space: nowrap;
}

.play-battle-preview-hp-mini {
    font-size: 0.56rem;
    color: rgba(196, 203, 214, 0.78);
}

.play-battle-preview-hp-mini .is-damage {
    color: rgba(248, 113, 113, 0.92);
}

.play-battle-attack-preview footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.play-battle-turn-order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.84);
}

.play-battle-turn-order-head strong {
    color: rgba(250, 204, 21, 0.95);
}

.play-battle-turn-order-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 4px;
}

.play-battle-turn-item {
    display: grid;
    grid-template-columns: 14px 14px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-height: 20px;
    font-size: 0.68rem;
    color: rgba(245, 247, 251, 0.9);
    transition: transform 220ms ease, opacity 220ms ease, filter 220ms ease;
}

.play-battle-turn-item .lucide {
    width: 13px;
    height: 13px;
    color: rgba(250, 204, 21, 0.88);
}

.play-battle-turn-item.is-p1 .lucide {
    color: rgba(96, 165, 250, 0.95);
}

.play-battle-turn-item.is-p2 .lucide {
    color: rgba(251, 113, 133, 0.95);
}

.play-battle-turn-item.is-active {
    color: rgba(250, 204, 21, 0.98);
}

.play-battle-turn-item.is-dimmed {
    opacity: 0.35;
    filter: saturate(0.65);
}

.play-battle-turn-item.is-tie {
    opacity: 1;
    color: rgba(254, 240, 138, 0.96);
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.32);
}

.play-battle-turn-item.is-rolling .play-battle-turn-roll {
    color: rgba(253, 224, 71, 0.98);
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.42);
    animation: playBattleRollScan 120ms steps(2, end) infinite;
}

.play-battle-turn-item.is-reordering {
    transform: translateX(4px);
}

.play-battle-turn-chevron {
    text-align: center;
    color: rgba(250, 204, 21, 0.98);
}

.play-battle-turn-roll {
    min-width: 32px;
    text-align: right;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    color: rgba(189, 200, 218, 0.86);
}

.play-battle-turn-roll.is-empty {
    color: rgba(148, 163, 184, 0.54);
}

.play-battle-turn-order-empty {
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.72);
}

.play-battle-round-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 16;
    pointer-events: none;
    opacity: 0;
}

.play-battle-round-overlay strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    border: 1px solid rgba(250, 204, 21, 0.36);
    padding: 10px 14px;
    background: rgba(5, 6, 10, 0.86);
    color: rgba(254, 240, 138, 0.98);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.14em;
}

.play-battle-round-overlay.is-active {
    opacity: 1;
    animation: playBattleRoundIntro 760ms cubic-bezier(0.2, 0.7, 0.2, 1) 1;
}

.play-battle-round-intro {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 16;
    width: min(560px, calc(100% - 20px));
    border: 1px solid rgba(250, 204, 21, 0.36);
    background: linear-gradient(170deg, rgba(8, 10, 13, 0.96), rgba(15, 23, 42, 0.92));
    padding: 10px;
    display: grid;
    gap: 8px;
    pointer-events: auto;
}

.play-battle-round-intro.is-hidden {
    display: none;
}

.play-battle-round-intro-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.play-battle-round-intro-head strong {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    color: rgba(255, 239, 176, 0.98);
    text-transform: uppercase;
}

.play-battle-round-intro-head span {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(196, 203, 214, 0.84);
}

.play-battle-round-intro-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 4px;
}

.play-battle-round-intro-item {
    display: grid;
    grid-template-columns: 22px 14px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 6px;
    min-height: 22px;
    padding: 2px 4px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.28);
    font-size: 0.68rem;
    color: rgba(241, 245, 249, 0.9);
    transition: transform 220ms ease, opacity 220ms ease, filter 220ms ease, border-color 220ms ease;
}

.play-battle-round-intro-item.is-same-speed {
    margin-left: var(--play-round-intro-indent, 0px);
}

.play-battle-round-intro-item .lucide {
    width: 13px;
    height: 13px;
}

.play-battle-round-intro-item.is-p1 .lucide {
    color: rgba(96, 165, 250, 0.95);
}

.play-battle-round-intro-item.is-p2 .lucide {
    color: rgba(251, 113, 133, 0.95);
}

.play-battle-round-intro-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 16px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    color: rgba(250, 204, 21, 0.96);
}

.play-battle-round-intro-roll {
    text-align: right;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    color: rgba(196, 203, 214, 0.88);
}

.play-battle-round-intro-roll.is-empty {
    color: rgba(148, 163, 184, 0.56);
}

.play-battle-round-intro-item.is-dimmed {
    opacity: 0.34;
    filter: saturate(0.65);
}

.play-battle-round-intro-item.is-tie {
    border-color: rgba(250, 204, 21, 0.46);
    color: rgba(254, 240, 138, 0.98);
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.3);
}

.play-battle-round-intro-item.is-rolling .play-battle-round-intro-roll {
    color: rgba(253, 224, 71, 0.98);
    text-shadow: 0 0 9px rgba(250, 204, 21, 0.4);
    animation: playBattleRollScan 120ms steps(2, end) infinite;
}

.play-battle-round-intro-item.is-reordering {
    will-change: transform;
}

.play-battle-round-intro-empty {
    padding: 6px;
    border: 1px dashed rgba(148, 163, 184, 0.34);
    font-size: 0.64rem;
    color: rgba(196, 203, 214, 0.84);
}

.play-battle-round-intro-footer {
    display: flex;
    justify-content: flex-end;
}

.play-battle-round-intro-continue {
    min-height: 28px;
    min-width: 104px;
}

.play-battle-round-intro-continue.is-waiting {
    border-color: rgba(250, 204, 21, 0.5);
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.2) inset;
}

.play-battle-turn-controls {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 13;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.play-battle-move-counter {
    min-height: 30px;
    border: 1px solid rgba(250, 204, 21, 0.28);
    background: rgba(8, 10, 13, 0.9);
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.play-battle-move-counter strong {
    color: rgba(250, 204, 21, 0.98);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
}

.play-battle-attack-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: rgba(248, 250, 252, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.28);
}

.play-battle-attack-state.is-done {
    color: rgba(248, 113, 113, 0.92);
    border-color: rgba(239, 68, 68, 0.48);
    background: rgba(127, 29, 29, 0.2);
}

.play-battle-attack-state .lucide {
    width: 11px;
    height: 11px;
}

.play-battle-next-turn-btn {
    min-height: 30px;
    padding-inline: 0.55rem;
}

.play-battle-next-turn-btn.is-disabled {
    opacity: 0.62;
    color: rgba(255, 255, 255, 0.78);
    border-color: rgba(255, 255, 255, 0.22);
}

.play-battle-menu {
    position: absolute;
    top: 48px;
    right: 10px;
    z-index: 12;
    border: 1px solid rgba(250, 204, 21, 0.32);
    background: rgba(8, 10, 13, 0.88);
    padding: 8px 10px;
    min-width: 220px;
    display: grid;
    gap: 4px;
    pointer-events: auto;
}

.play-battle-menu h3 {
    margin: 0 0 2px;
    font-size: 0.86rem;
    font-family: 'Orbitron', sans-serif;
    color: rgba(255, 232, 150, 0.98);
}

.play-battle-menu p {
    margin: 0;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.8);
}

.play-battle-menu .perso-btn {
    margin-top: 6px;
}

.play-battle-zoom-actions {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 12;
    display: grid;
    gap: 6px;
    pointer-events: auto;
}

.play-battle-sheet {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 13;
    border: 1px solid rgba(250, 204, 21, 0.3);
    background: rgba(8, 10, 14, 0.94);
    padding: 8px 10px;
    pointer-events: auto;
    display: grid;
    gap: 8px;
    max-height: min(46vh, 360px);
    overflow: auto;
}

.play-battle-sheet.is-hidden {
    display: none;
}

.play-battle-sheet-close {
    min-height: 28px;
    min-width: 28px;
    padding: 0.2rem;
}

.play-battle-sheet-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.play-battle-sheet-head {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
}

.play-battle-sheet-portrait {
    width: 96px;
    height: 96px;
    border: 1px solid rgba(250, 204, 21, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 232, 150, 0.85);
    background: rgba(5, 7, 11, 0.85);
}

.play-battle-sheet-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-battle-sheet-summary h4 {
    margin: 0 0 2px;
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    color: rgba(255, 238, 176, 0.98);
    font-family: 'Orbitron', sans-serif;
}

.play-battle-sheet-summary p {
    margin: 0;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.74);
}

.play-battle-sheet-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 8px;
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.86);
}

.play-battle-sheet-hpbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.play-battle-sheet-hpbar-track {
    height: 12px;
    border: 1px solid rgba(250, 204, 21, 0.35);
    background: rgba(15, 15, 15, 0.7);
}

.play-battle-sheet-hpbar-fill {
    display: block;
    height: 100%;
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(250, 204, 21, 0.86) 0,
            rgba(250, 204, 21, 0.86) 6px,
            rgba(161, 98, 7, 0.94) 6px,
            rgba(161, 98, 7, 0.94) 12px
        );
}

.play-battle-sheet-hpbar-text {
    justify-self: end;
    font-size: 0.67rem;
    color: rgba(255, 240, 190, 0.94);
    font-family: 'Orbitron', sans-serif;
}

.play-battle-sheet-tabs {
    display: grid;
    grid-template-columns: minmax(70px, auto) repeat(3, 34px);
    gap: 6px;
    align-items: center;
}

.play-battle-sheet-tab {
    min-height: 30px;
    justify-content: center;
    padding: 0.28rem;
}

.play-battle-sheet-tab .lucide {
    width: 14px;
    height: 14px;
}

.play-battle-sheet-tab.is-active {
    border-color: rgba(250, 204, 21, 0.75);
    color: #fde68a;
}

.play-battle-sheet-panel {
    margin-top: 6px;
    border-top: 1px solid rgba(250, 204, 21, 0.2);
    padding-top: 8px;
    display: grid;
    gap: 8px;
}

.play-battle-sheet-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.play-battle-sheet-info-grid p {
    margin: 0;
    font-size: 0.68rem;
}

.play-battle-sheet-attack-card {
    display: grid;
    gap: 4px;
}

.play-battle-sheet-attack-card h5 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: rgba(255, 238, 176, 0.96);
}

.play-battle-sheet-attack-card h5 .lucide {
    width: 14px;
    height: 14px;
}

.play-battle-sheet-attack-card p {
    margin: 0;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.82);
}

@keyframes playBattleRollScan {
    0% { opacity: 0.8; transform: translateX(0); filter: blur(0.2px); }
    45% { opacity: 1; transform: translateX(-1px); filter: contrast(1.1); }
    100% { opacity: 0.9; transform: translateX(1px); filter: none; }
}

@keyframes playBattleRoundIntro {
    0% { opacity: 0; transform: translate(-50%, -52%) scale(0.96); filter: blur(1px); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; }
    60% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -48%) scale(1.01); filter: blur(0.4px); }
}

@keyframes playBattleRoundReorder {
    0% { transform: translateX(0); }
    40% { transform: translateX(8px); }
    100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .play-battle-turn-item,
    .play-battle-turn-item.is-rolling .play-battle-turn-roll,
    .play-battle-round-overlay.is-active,
    .play-battle-round-intro-item,
    .play-battle-round-intro-item.is-rolling .play-battle-round-intro-roll,
    .play-battle-round-intro-item.is-reordering {
        animation: none;
        transition: none;
    }
}

@media (max-width: 760px) {
    .play-battle-root {
        min-height: 68dvh;
        height: calc(100dvh - 122px);
    }

    .play-battle-menu {
        left: 8px;
        right: 8px;
        top: 42px;
        min-width: 0;
    }

    .play-battle-turn-order {
        left: 8px;
        right: 8px;
        top: 42px;
        min-width: 0;
        max-width: none;
    }

    .play-battle-history-inline-row {
        left: 8px;
        top: 8px;
    }

    .play-battle-history-inline {
        display: none;
    }

    .play-battle-history-inline-item {
        max-width: min(36vw, 180px);
    }

    .play-battle-history {
        left: 8px;
        right: 8px;
        width: auto;
        top: 42px;
        max-height: min(42vh, 260px);
    }

    .play-battle-round-intro {
        width: calc(100% - 16px);
        padding: 8px;
    }

    .play-battle-round-intro-item {
        grid-template-columns: 20px 14px minmax(0, 1fr) 34px;
        font-size: 0.64rem;
    }

    .play-battle-round-intro-item.is-same-speed {
        margin-left: min(var(--play-round-intro-indent, 0px), 18px);
    }

    .play-battle-zoom-actions {
        left: 8px;
        bottom: 8px;
    }

    .play-battle-turn-controls {
        right: 8px;
        top: 8px;
    }

    .play-battle-sheet {
        left: 8px;
        right: 8px;
        bottom: 8px;
        max-height: min(44vh, 320px);
    }

    .play-battle-sheet-head {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .play-battle-sheet-portrait {
        width: 74px;
        height: 74px;
    }

    .play-battle-sheet-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .play-battle-sheet-info-grid {
        grid-template-columns: 1fr;
    }
}
