* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: #122033;
    background:
        radial-gradient(circle at top left, rgba(255, 241, 121, 0.85), transparent 32%),
        radial-gradient(circle at top right, rgba(255, 120, 90, 0.35), transparent 28%),
        linear-gradient(135deg, #0f5c83 0%, #124559 38%, #071d2b 100%);
}

.arena-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 32px;
}

.arena-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px 24px;
    border-radius: 28px;
    background: rgba(255, 248, 214, 0.9);
    box-shadow: 0 18px 45px rgba(2, 15, 24, 0.28);
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-image {
    width: 92px;
    height: 92px;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.22));
}

.brand h1,
.panel h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
}

.arena-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.arena-nav a,
button {
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.arena-nav a {
    color: #fff8ef;
    background: linear-gradient(135deg, #db5a42, #b23a48);
    box-shadow: 0 10px 20px rgba(178, 58, 72, 0.28);
}

button {
    color: #fff9f0;
    background: linear-gradient(135deg, #1f8f7c, #1a5f7a);
    box-shadow: 0 10px 20px rgba(12, 68, 87, 0.24);
}

.arena-nav a:hover,
button:hover:not(:disabled) {
    transform: translateY(-2px);
}

button.secondary {
    color: #123;
    background: linear-gradient(135deg, #f2d28b, #f6edc8);
    box-shadow: 0 10px 20px rgba(80, 58, 18, 0.18);
}

button.special {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    box-shadow: 0 10px 22px rgba(124, 58, 237, 0.28);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.arena-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
}

.panel {
    padding: 24px;
    border-radius: 28px;
    background: rgba(255, 252, 244, 0.93);
    box-shadow: 0 24px 60px rgba(4, 20, 31, 0.28);
}

.player-panel,
.players-panel,
.inbox-panel {
    min-height: 280px;
}

.battle-panel {
    grid-column: 1 / -1;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7b4b2a;
}

.player-card,
.fighter-card,
.challenge-card,
.player-row,
.recent-match-card {
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(20, 52, 64, 0.1);
}

.player-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
}

.player-card img,
.fighter-art {
    width: 110px;
    height: 110px;
    object-fit: contain;
}

.player-stats {
    display: grid;
    gap: 10px;
}

.player-stats p {
    margin: 0;
}

.stat-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-pill,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #e9f3f5;
    color: #143948;
    font-size: 0.92rem;
    font-weight: 700;
}

.badge.muted {
    background: #eef0f4;
    color: #5b6470;
}

.status-text,
.helper-text {
    margin: 14px 0 0;
    line-height: 1.5;
}

.server-config {
    margin-top: 16px;
}

.server-config label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.server-config-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.server-config-row input {
    flex: 1 1 260px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(20, 52, 64, 0.18);
    border-radius: 16px;
    font: inherit;
    background: #fff;
}

.server-config-row input:focus {
    outline: 2px solid rgba(31, 143, 124, 0.25);
    border-color: #1f8f7c;
}

.helper-text {
    color: #44515f;
}

.list-stack {
    display: grid;
    gap: 12px;
}

.empty-state {
    padding: 18px;
    border-radius: 18px;
    background: rgba(233, 241, 245, 0.75);
    color: #55616f;
}

.player-row,
.challenge-card,
.recent-match-card {
    padding: 16px;
}

.player-row {
    display: grid;
    gap: 10px;
}

.row-top,
.challenge-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.player-row p,
.challenge-card p,
.recent-match-card p {
    margin: 0;
}

.meta-line {
    color: #566472;
    font-size: 0.95rem;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button-row button,
.battle-actions button {
    min-width: 120px;
}

.subsection {
    margin-top: 22px;
}

.battle-stage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
    position: relative;
    overflow: hidden;
}

.empty-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 230px;
    padding: 24px;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 236, 189, 0.85), rgba(255, 255, 255, 0.9)),
        url("cool fight scene.jpg") center/cover;
}

.live-stage {
    min-height: 370px;
    padding: 28px;
    background:
        radial-gradient(circle at 50% 20%, rgba(255, 190, 92, 0.22), transparent 30%),
        linear-gradient(180deg, rgba(7, 29, 43, 0.2), rgba(7, 29, 43, 0.6)),
        url("cool fight scene.jpg") center/cover;
}

.stage-atmosphere,
.stage-gridlines,
.attack-fx,
.center-emblem {
    position: absolute;
    pointer-events: none;
}

.stage-atmosphere {
    inset: 0;
    background:
        radial-gradient(circle at 18% 18%, rgba(67, 217, 173, 0.2), transparent 26%),
        radial-gradient(circle at 84% 22%, rgba(255, 87, 87, 0.2), transparent 24%),
        radial-gradient(circle at 50% 90%, rgba(255, 214, 92, 0.14), transparent 34%);
    animation: stagePulse 5.2s ease-in-out infinite;
}

.stage-gridlines {
    inset: 0;
    opacity: 0.28;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, transparent 5%, black 30%, black 75%, transparent 100%);
}

.center-emblem {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 118px;
    height: 118px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    text-align: center;
    color: #fff8ef;
    background: radial-gradient(circle, rgba(255, 163, 66, 0.92), rgba(184, 54, 70, 0.92));
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.09), 0 24px 48px rgba(0, 0, 0, 0.34);
    z-index: 2;
}

.center-emblem span {
    display: block;
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1;
}

.center-emblem small {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.fighter-card {
    padding: 18px;
    display: grid;
    gap: 12px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(242, 246, 247, 0.92));
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.fighter-top {
    display: flex;
    gap: 16px;
    align-items: center;
}

.fighter-info p {
    margin: 0;
}

.fighter-name {
    font-size: 1.2rem;
    font-weight: 800;
}

.fighter-aura {
    position: absolute;
    inset: -20% auto auto -10%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    opacity: 0.22;
    filter: blur(12px);
    background: radial-gradient(circle, rgba(255, 175, 65, 0.85), transparent 70%);
}

.fighter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.stance-line {
    margin-top: 6px;
    color: #a04b2c;
    font-weight: 700;
}

.health-track {
    width: 100%;
    height: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: #d9e3e8;
}

.health-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
    transition: width 0.25s ease;
}

.special-track {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(78, 91, 126, 0.16);
}

.special-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #22d3ee, #facc15);
    transition: width 0.25s ease;
}

.self-fighter {
    border-color: rgba(31, 143, 124, 0.28);
}

.turn-focus {
    box-shadow: 0 0 0 3px rgba(255, 184, 77, 0.35), 0 18px 36px rgba(0, 0, 0, 0.2);
}

.is-attacking {
    animation: fighterAttack 0.65s ease;
}

.is-hit {
    animation: fighterHit 0.62s ease;
}

.is-victorious {
    box-shadow: 0 0 0 3px rgba(255, 213, 102, 0.5), 0 20px 40px rgba(167, 98, 13, 0.24);
}

.is-defeated {
    filter: grayscale(0.5) saturate(0.7);
}

.attack-fx {
    inset: 0;
    z-index: 3;
}

.attack-slash,
.special-blast,
.impact-ring,
.damage-burst {
    position: absolute;
    opacity: 0;
}

.attack-slash {
    top: 50%;
    left: 16%;
    width: 68%;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(108, 239, 255, 0), rgba(108, 239, 255, 0.9), rgba(255, 240, 176, 0.95), rgba(255, 86, 86, 0));
    box-shadow: 0 0 28px rgba(108, 239, 255, 0.72);
    transform-origin: center;
}

.special-blast {
    top: 50%;
    left: 50%;
    width: 220px;
    height: 220px;
    margin-left: -110px;
    margin-top: -110px;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 245, 176, 0.98) 0%, rgba(88, 28, 135, 0.88) 38%, rgba(34, 211, 238, 0.22) 62%, rgba(34, 211, 238, 0) 100%);
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.45);
}

.impact-ring {
    top: 50%;
    left: 50%;
    width: 96px;
    height: 96px;
    margin-left: -48px;
    margin-top: -48px;
    border-radius: 50%;
    border: 6px solid rgba(255, 243, 181, 0.95);
    box-shadow: 0 0 34px rgba(255, 170, 48, 0.52);
}

.damage-burst {
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 16px;
    border-radius: 999px;
    color: #fffdf7;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(249, 115, 22, 0.95));
    box-shadow: 0 16px 28px rgba(100, 22, 14, 0.28);
}

.battle-stage.is-striking.fx-left-to-right .attack-slash {
    animation: slashLeftToRight 0.72s ease;
}

.battle-stage.is-striking.fx-right-to-left .attack-slash {
    animation: slashRightToLeft 0.72s ease;
}

.battle-stage.is-special-striking .attack-slash {
    animation-duration: 0.86s;
}

.battle-stage.is-special-striking .special-blast {
    animation: specialBlast 0.9s ease;
}

.battle-stage.is-striking .impact-ring {
    animation: impactRing 0.72s ease;
}

.battle-stage.is-special-striking .impact-ring {
    animation-duration: 0.9s;
}

.battle-stage.is-striking .damage-burst {
    animation: damageBurst 0.72s ease;
}

.battle-stage.is-special-striking .damage-burst {
    animation-duration: 0.9s;
}

.battle-stage.victory-flash::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 233, 163, 0.42), transparent 56%);
    animation: victoryFlash 1s ease;
    pointer-events: none;
}

.battle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.battle-log {
    display: grid;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
}

.log-entry {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(233, 241, 245, 0.8);
}

.log-entry.attack {
    border-left: 4px solid rgba(31, 143, 124, 0.7);
}

.log-entry.system {
    background: rgba(250, 226, 178, 0.72);
}

code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(18, 57, 72, 0.08);
}

@keyframes stagePulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.03); opacity: 1; }
}

@keyframes fighterAttack {
    0% { transform: translateX(0) scale(1); }
    35% { transform: translateX(18px) scale(1.03); }
    100% { transform: translateX(0) scale(1); }
}

@keyframes fighterHit {
    0%, 100% { transform: translateX(0); filter: saturate(1); }
    20% { transform: translateX(-10px); filter: saturate(1.6) brightness(1.05); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
}

@keyframes slashLeftToRight {
    0% { opacity: 0; transform: translate(-18%, -50%) rotate(-16deg) scaleX(0.2); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translate(18%, -50%) rotate(-6deg) scaleX(1.2); }
}

@keyframes slashRightToLeft {
    0% { opacity: 0; transform: translate(18%, -50%) rotate(16deg) scaleX(0.2); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translate(-18%, -50%) rotate(6deg) scaleX(1.2); }
}

@keyframes impactRing {
    0% { opacity: 0; transform: scale(0.2); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: scale(2.2); }
}

@keyframes specialBlast {
    0% { opacity: 0; transform: scale(0.2) rotate(0deg); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.45) rotate(90deg); }
}

@keyframes damageBurst {
    0% { opacity: 0; transform: translate(-50%, 18px) scale(0.5); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -28px) scale(1.06); }
}

@keyframes victoryFlash {
    0% { opacity: 0; }
    35% { opacity: 1; }
    100% { opacity: 0; }
}

@media (max-width: 980px) {
    .arena-grid {
        grid-template-columns: 1fr;
    }

    .battle-stage {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .arena-shell {
        width: min(100% - 20px, 1280px);
    }

    .arena-header,
    .panel-title-row,
    .fighter-top,
    .row-top,
    .challenge-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .player-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .center-emblem {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto;
        order: -1;
    }

    .fighter-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
