/* Card Battle Arena - Styles */
/* Separated from index.html on 2026-01-22 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MedievalSharp', serif;
    background: #0a0a0f;
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
}

/* Game Container with Background */
#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: url('./assets/gamebackground.png') center center / cover no-repeat;
}

/* Atmospheric Overlay */
#game-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Particle Canvas */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* ==================== TOP UI BAR ==================== */
.top-ui-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 15vh;
    /* background: url('./assets/uitop.png') center top / contain no-repeat; */
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.top-ui-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
}

/* Player Panel */
.player-panel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.5vh;
    margin-top: 5vh;
}

.player-avatar-frame {
    position: relative;
    width: 20vh;
    height: 20vh;
    background: url('./assets/playerui.png') center center / contain no-repeat;
    z-index: 10;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.player-avatar-img {
    width: 60%;
    height: 60%;
    overflow: hidden;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.player-avatar-img img {
    width: 25vh;
    height: 25vh;
    object-fit: cover;
    margin-top: 4vh;
}

.player-panel.right {
    flex-direction: row-reverse;
}

.player-stats {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0vh;
    margin-left: -6vh;
    z-index: 5;
    /* background: url('./assets/playerui.png') center center / contain no-repeat; */
    padding: 1.5vh 2vh;
    min-width: 30vh;
}

.player-panel.right .player-stats {
    margin-left: 0;
    margin-right: -6vh;
    align-items: end;
}

.player-name {
    font-family: 'Cinzel', serif;
    font-size: 2.5vh;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 0vh;
    letter-spacing: 0.5px;
    margin-left: 5vh;
    margin-top: 5vh;
}

.player-panel.right .player-name {
    text-align: right;
    margin-right: 5vh;
}

/* Health/Mana Bars */
.bar-container {
    position: relative;
    width: 50vh;
    height: 10vh;
    display: flex;
    align-items: center;
}

/* Flip bars for right player */
.player-panel.right .bar-container {
    transform: scaleX(-1);
}

/* Un-flip text so it's readable */
.player-panel.right .bar-text {
    transform: translate(-50%, -50%) scaleX(-1);
}

/* Mana bar specific sizing */
.bar-container.mana {
    width: 35vh;
    height: 7vh;
}


.bar-background {
    position: absolute;
    top: 50%;
    left: 15%;
    transform: translateY(-50%);
    width: 66%;
    height: 35%;
    background: #000;
    border-radius: 2px;
    z-index: 0;
}

.bar-fill {
    position: absolute;
    top: 50%;
    left: 15%;
    transform: translateY(-50%);
    width: calc(84% - 16%);
    height: 35%;
    border-radius: 2px;
    transition: width 0.3s ease;
    max-width: 66%;
    z-index: 1;
}

.health-fill {
    background: linear-gradient(180deg, #8b1a1a 0%, #660000 50%, #4a0000 100%);
    box-shadow: 0 0 8px rgba(139, 26, 26, 0.6);
}

.mana-fill {
    background: linear-gradient(180deg, #264cb4 0%, #122849 50%, #0c265a 100%);
    box-shadow: 0 0 8px rgba(24, 53, 112, 0.6);
}

.bar-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/healthbar.png') center center / 100% 100% no-repeat;
    pointer-events: none;
    z-index: 5;
}

.bar-container.mana .bar-frame {
    background: url('./assets/manabar.png') center center / 100% 100% no-repeat;
}

.bar-text {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.3vh;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    z-index: 10;
}

/* Round Counter */
.round-counter {
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    background: url('./assets/roundsUI.png') center center / contain no-repeat;
    width: 20vh;
    height: 20vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 110;
}

.round-label {
    font-size: 1rem;
    color: #c9a227;
    text-transform: uppercase;
}

.round-number {
    font-family: 'Cinzel', serif;
    font-size: 4vh;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* ==================== BATTLE ARENA ==================== */
.battle-arena {
    position: absolute;
    top: 100px;
    left: 0;
    right: 0;
    bottom: 6.25vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5.5%;
    z-index: 10;
}

/* VS Emblem */
.vs-emblem {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48vh;
    height: 48vh;
    z-index: 20;
}

.vs-emblem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(139, 105, 20, 0.8));
    animation: vsGlow 3s ease-in-out infinite;
}

@keyframes vsGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 20px rgba(139, 105, 20, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 40px rgba(255, 215, 0, 1));
    }
}

/* Character Card */
.character-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 15;
}

.character-card {
    position: relative;
    width: 40vh;
    height: 60vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.character-card.left.attacking {
    animation: cardAttackRight 0.4s ease;
}

.character-card.right.attacking {
    animation: cardAttackLeft 0.4s ease;
}

.character-card.damaged {
    animation: cardDamage 0.3s ease;
}

@keyframes cardAttackRight {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(40px) scale(1.05);
    }
}

@keyframes cardAttackLeft {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-40px) scale(1.05);
    }
}

@keyframes cardDamage {

    0%,
    100% {
        transform: translateX(0);
        filter: brightness(1);
    }

    25% {
        transform: translateX(-8px);
        filter: brightness(1.5) hue-rotate(-30deg);
    }

    75% {
        transform: translateX(8px);
        filter: brightness(0.7);
    }
}

/* ==================== BOTTOM UI ==================== */
.bottom-ui {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 5%;
    z-index: 100;
}

.item-slots {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.6vh;
    padding: 0;
    margin-bottom: 3vh;
    /* Container size determined by grid content */
}

/* Removed overlay from container */

.item-slot {
    position: relative;
    width: 8vh;
    height: 9vh;
    background: rgba(0, 0, 0, 1);
    border-radius: 0;
    /* No border on container */
}

/* Frame overlay for EACH slot */
.item-slot::after {
    content: '';
    position: absolute;
    inset: -2px;
    /* Slight overlap to cover edges */
    background: url('./assets/bottomitemsUI.png') center center / 100% 100% no-repeat;
    z-index: 10;
    pointer-events: none;
}

.item-slot img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    /* Fit inside ring */
    height: 80%;
    object-fit: contain;
    z-index: 1;
    /* Behind frame */
}

/* Battle Log - Outer Frame */
.battle-log {
    position: absolute;
    width: 55vh;
    height: 40vh;
    background: url('./assets/chatbox.png') center center / 100% 100% no-repeat;
    padding: 10vh 10vh;
    z-index: 50;
    bottom: -5vh;
    left: 0;
    right: 0;
    margin: auto;
}

/* Battle Log - Inner Scrollable Content */
.battle-log-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.battle-log-content::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.log-entry {
    font-family: 'Cinzel', serif;
    font-size: 1.4vh;
    padding: 0.5vh 0;
    color: #2c1a0b;
    /* Dark brown for parchment text */
    text-shadow: none;
    font-weight: 700;
    line-height: 1.4;
}

.log-entry .player-a {
    color: #0066cc;
    /* Stronger Blue */
    font-weight: 800;
}

.log-entry .player-b {
    color: #d32f2f;
    /* Stronger Red */
    font-weight: 800;
}

.log-entry .damage {
    color: #e65100;
    /* Dark Orange/Gold */
    font-weight: 900;
}

.log-entry .critical {
    color: #9c27b0;
    font-weight: 900;
    text-shadow: 0 0 5px rgba(156, 39, 176, 0.3);
}

.log-entry .system-msg {
    color: #1a1a1a;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==================== EFFECTS LAYER ==================== */
#effects-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200;
}

.projectile {
    position: absolute;
    width: 8vh;
    height: 8vh;
    border-radius: 50%;
    z-index: 201;
    filter: drop-shadow(0 0 20px rgba(255, 150, 0, 1));
}

.projectile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: projectileSpin 0.3s linear infinite;
}

@keyframes projectileSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.damage-number {
    position: absolute;
    font-family: 'Cinzel', serif;
    font-size: 3.5vh;
    font-weight: 900;
    color: #ff4444;
    text-shadow: 0 0 10px #ff0000, 2px 2px 0 #000, -2px -2px 0 #000;
    animation: damageFloat 1s ease-out forwards;
    z-index: 210;
}

.damage-number.critical {
    font-size: 5vh;
    color: #ff00ff;
    text-shadow: 0 0 20px #ff00ff, 3px 3px 0 #000;
}

@keyframes damageFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5);
    }

    20% {
        transform: translateY(-20px) scale(1.3);
    }

    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.8);
    }
}

.hit-effect {
    position: absolute;
    width: 20vh;
    height: 20vh;
    background: radial-gradient(circle, rgba(255, 150, 0, 0.9) 0%, rgba(255, 50, 0, 0.5) 30%, transparent 70%);
    border-radius: 50%;
    animation: hitExpand 0.5s ease-out forwards;
    z-index: 205;
}

@keyframes hitExpand {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.shake {
    animation: screenShake 0.4s ease-in-out;
}

@keyframes screenShake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-5px, 3px);
    }

    40% {
        transform: translate(5px, -3px);
    }

    60% {
        transform: translate(-5px, -3px);
    }

    80% {
        transform: translate(5px, 3px);
    }
}

/* ==================== LOADING SCREEN ==================== */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0515 0%, #150a20 50%, #0a0515 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 105, 20, 0.3);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #ffd700;
    letter-spacing: 3px;
}

.loading-progress {
    width: 200px;
    height: 8px;
    background: rgba(139, 105, 20, 0.3);
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b6914, #ffd700);
    width: 0%;
    transition: width 0.3s ease;
}

/* ==================== RESULT SCREEN ==================== */
#result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/gamebackground.png') center center / cover no-repeat;
    z-index: 900;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
}

#result-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 20%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
}

#result-overlay.show {
    display: flex;
}

/* Fade-out transition for result screen */
#result-overlay.fade-out {
    animation: fadeOutResult 0.8s ease forwards;
}

@keyframes fadeOutResult {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

.result-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20vh;
    z-index: 510;
    margin-bottom: 5vh;
    position: relative;
}

.result-card-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.6s ease;
}

#result-overlay.show .result-card-container {
    opacity: 1;
    transform: scale(1);
}

.result-banner {
    position: relative;
    width: 55vh;
    height: 24vh;
    margin-bottom: -6vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-banner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

.result-banner.loser img {
    filter: drop-shadow(0 0 20px rgba(139, 26, 26, 0.8));
}

.result-card {
    width: 45vh;
    height: 66vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    transition: filter 1s ease 0.5s;
}

/* Grey out and darken the loser card */
.result-card.loser {
    filter: grayscale(100%) brightness(0.5);
}

.play-again-btn {
    margin-top: -7vh;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.6s ease 0.8s, transform 0.2s ease;
    z-index: 510;
}

/* Removed conflicting rule that forced opacity: 1 too early */
/* #result-overlay.show .play-again-btn { opacity: 1; } */

.play-again-btn:hover {
    transform: scale(1.1);
}

.play-again-btn img {
    width: 40vh;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.6));
}



/* ==================== RESPONSIVE ==================== */
/* Only keep minimal breakpoints for extreme cases */

@media (max-width: 600px) {

    /* Mobile adjustments */
    .character-card {
        width: 18vh;
        height: 26vh;
    }

    .bar-text {
        font-size: 0.7vh;
    }

    .player-name {
        font-size: 1vh;
    }
}

/* ==================== INTRO PLAY SCREEN ==================== */
#intro-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/gamebackground.png') center center / cover no-repeat;
    z-index: 900;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#intro-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 20%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
}

/* Decorative top border frame */
.intro-top-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 18vh;
    background: url('./assets/uitop.png') center top / contain no-repeat;
    z-index: 905;
}

/* Intro content container */
.intro-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5vh;
    z-index: 910;
}

/* Preview Character Cards - Match Battle Cards */
.intro-card {
    position: relative;
    width: 35vh;
    height: 52vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}



/* VS Emblem - Intro */
.intro-vs-emblem {
    width: 36vh;
    height: 36vh;
    z-index: 920;
    filter: drop-shadow(0 0 30px rgba(139, 105, 20, 0.9));
    animation: introVsGlow 3s ease-in-out infinite;
}

.intro-vs-emblem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes introVsGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 30px rgba(139, 105, 20, 0.9));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 50px rgba(255, 215, 0, 1));
        transform: scale(1.05);
    }
}

/* Play Now Button */
.intro-play-btn {
    position: absolute;
    bottom: 0;
    /* left: 50%;
transform: translateX(-50%); */
    cursor: pointer;
    z-index: 930;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.intro-play-btn:hover {
    transform: translateX(-50%) scale(1.1);
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.9));
}

.intro-play-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.intro-play-btn img {
    width: 40vh;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.6));
}

/* Mist/Fog Effects */
.intro-mist {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(0deg, rgba(100, 120, 140, 0.3) 0%, transparent 100%);
    pointer-events: none;
    z-index: 903;
}

/* Fade-out transition */
#intro-screen.fade-out {
    animation: fadeOutIntro 0.8s ease forwards;
}

@keyframes fadeOutIntro {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideOutUp {
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0%);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0%);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0%);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0%);
        opacity: 1;
    }
}

.slide-out-up {
    animation: slideOutUp 0.8s ease forwards;
}

.slide-in-down {
    animation: slideInDown 0.8s ease forwards;
}

.slide-out-down {
    animation: slideOutDown 0.8s ease forwards;
}

.slide-in-up {
    animation: slideInUp 0.8s ease forwards;
}

.slide-out-left {
    animation: slideOutLeft 0.8s ease forwards;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

.slide-out-right {
    animation: slideOutRight 0.8s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

/* Animation Delays */
.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

.delay-5 {
    animation-delay: 1.0s;
}

/* Initial Hidden State for Animatable Elements */
.anim-hidden {
    opacity: 0;
    /* Star hidden, animate in */
}

/* Responsive for Intro Screen */
/* Large Desktops */
@media (min-width: 1600px) {
    .intro-content {
        gap: 60px;
    }
}

/* Medium-Small Desktops */
@media (max-width: 1199px) and (min-width: 1024px) {
    .intro-content {
        gap: 35px;
    }
}

/* Tablets */
@media (max-width: 900px) {
    .intro-content {
        gap: 20px;
    }

    .intro-card {
        width: 180px;
        height: 260px;
    }

    .intro-vs-emblem {
        width: 120px;
        height: 120px;
    }

    .intro-play-btn img {
        width: 180px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .intro-content {
        gap: 10px;
    }

    .intro-card {
        width: 140px;
        height: 200px;
    }

    .intro-vs-emblem {
        width: 80px;
        height: 80px;
    }

    .intro-play-btn img {
        width: 140px;
    }
}

/* ==================== ORIENTATION OVERLAY ==================== */
#orientation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0515 0%, #150a20 50%, #0a0515 100%);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    gap: 3vh;
}

.orientation-icon {
    width: 20vh;
    height: 20vh;
    /* border: 4px solid #ffd700; */
    /* border-radius: 12px; */
    display: flex;
    justify-content: center;
    align-items: center;
    animation: rotateDevice 2s ease-in-out infinite;
    position: relative;
}

/* .orientation-icon::before {
content: '⟲';
font-size: 10vh;
color: #ffd700;
} */

@keyframes rotateDevice {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(90deg);
    }
}

.orientation-message {
    font-family: 'Cinzel', serif;
    font-size: 2.5vh;
    color: #ffd700;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Show overlay only in portrait mode */
@media (orientation: portrait) {

    .top-ui-container {
        margin-top: 22vh;
        flex-direction: column;
    }

    #orientation-overlay {
        display: none;
    }

    .intro-top-border {
        top: 80px !important;
    }

    .intro-vs-emblem {
        /* display: none; */
    }

    #intro-play-btn {
        bottom: 100px;
    }

    .vs-emblem {
        width: 20vh;
        height: 20vh;
    }

    .battle-arena {
        top: 0;
    }

    .item-slots {
        margin-bottom: 30vh;
    }

    .item-slot {
        width: 4vh;
        height: 4vh;
    }

    .player-panel {

        margin-top: 23vh;
    }

    .player-avatar-frame {
        width: 15vh;
        height: 15vh;
    }

    .player-stats {}

    .player-name {
        font-size: 2vh;
        margin-left: -10vh;
        margin-top: -26px;
    }

    .bar-container {
        width: 30vh;
        height: 6vh;
    }

    .bar-container.mana {
        width: 25vh;
        height: 4vh;
    }

    .round-counter {
        position: absolute;
        left: 50%;
        top: 94px;
        transform: translateX(-50%);
        background: url(./assets/roundsUI.png) center center / contain no-repeat;
        width: 10vh;
        height: 10vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 110;
    }

    .player-panel {
        margin-top: 0vh;
    }

    .player-panel.left {
        margin-left: -6vh;
    }

    .player-panel.right {
        margin-right: -6vh;
    }

    .player-panel.right .player-name {
        margin-right: -10vh;
    }

    .round-number {
        font-size: 2vh !important;
    }

    .round-label {
        font-size: .5rem !important;
    }

    .round-counter {
        left: 90% !important;
        top: 5% !important;
    }

    .intro-vs-emblem {
        position: absolute;
    }

    .intro-vs-emblem {
        width: 100px;
        height: 100px;
    }

    .intro-play-btn img {
        width: 162px;
    }

    .play-again-btn img {
        margin-top: 5vh;
        width: 29vh;
    }

    .result-banner {
        position: relative;
        width: 26vh;
        height: 22vh;
        margin-bottom: -6vh;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .result-card {
        width: 28vh;
        height: 40vh;
    }

    .result-content {
        gap: 1vh
    }

    .battle-log {
        background-position: center;
    }
}

/* ==================== MOBILE LANDSCAPE RESPONSIVENESS ==================== */
/* Optimized for mobile devices in landscape mode (max-height: 500px) */
/* Maintains all alignments while ensuring elements fit within viewport */

@media screen and (max-height: 500px) and (orientation: landscape) {

    /* Reduce top UI bar height */
    .top-ui-bar {
        height: 12vh;
        top: 5vh;
    }

    /* Scale down player panels */
    .player-panel {
        gap: 1vh;
        margin-top: 3vh;
    }

    .player-avatar-frame {
        width: 15vh;
        height: 15vh;
    }

    .player-avatar-img img {
        width: 20vh;
        height: 20vh;
        margin-top: 3vh;
    }

    .player-stats {
        min-width: 25vh;
        padding: 1vh 1.5vh;
        margin-left: -5vh;
    }

    .player-panel.right .player-stats {
        margin-right: -5vh;
    }

    .player-name {
        font-size: 2vh;
        margin-left: 4vh;
        margin-top: 3vh;
    }

    .player-panel.right .player-name {
        margin-right: 4vh;
    }

    /* Scale down health/mana bars */
    .bar-container {
        width: 40vh;
        height: 8vh;
    }

    .bar-container.mana {
        width: 28vh;
        height: 5.5vh;
    }

    .bar-text {
        font-size: 1.1vh;
    }

    /* Scale down round counter */
    .round-counter {
        width: 15vh;
        height: 15vh;
        top: 5px;
    }

    .round-number {
        font-size: 3vh;
    }

    .round-label {
        font-size: 0.8rem;
    }

    /* Adjust battle arena */
    .battle-arena {
        top: 70px;
        bottom: 15vh;
        padding: 0 4%;
    }

    /* Scale down character cards */
    .character-card {
        width: 33vh;
        height: 50vh;
    }

    /* Scale down VS emblem */
    .vs-emblem {
        width: 35vh;
        height: 35vh;
    }

    /* Reduce bottom UI height */
    .bottom-ui {
        height: 100px;
    }

    /* Scale down item slots */
    .item-slot {
        width: 8vh;
        height: 9vh;
    }

    .item-slots {
        gap: 0.4vh;
        margin-bottom: 2vh;
    }

    /* Scale down battle log */
    .battle-log {
        width: 45vh;
        height: 32vh;
        padding: 8vh 8vh;
        bottom: -4vh;
    }

    .log-entry {
        font-size: 1.2vh;
        padding: 0.3vh 0;
        line-height: 1.3;
    }

    /* Scale down effects */
    .projectile {
        width: 6vh;
        height: 6vh;
    }

    .damage-number {
        font-size: 2.8vh;
    }

    .damage-number.critical {
        font-size: 4vh;
    }

    .hit-effect {
        width: 15vh;
        height: 15vh;
    }

    /* Scale down result screen elements */
    .result-content {
        gap: 15vh;
        margin-bottom: 3vh;
    }

    .result-banner {
        width: 45vh;
        height: 20vh;
        margin-bottom: -5vh;
    }

    .result-card {
        width: 35vh;
        height: 52vh;
    }

    .play-again-btn {
        margin-top: -5vh;
    }

    .play-again-btn img {
        max-height: 12vh;
    }

    /* Scale down intro screen elements */
    .intro-card {
        width: 30vh;
        height: 45vh;
    }

    .intro-vs-emblem {
        width: 35vh;
        height: 35vh;
    }

    .intro-play-btn {
        bottom: 2vh;
    }

    .intro-play-btn img {
        max-height: 20vh;
        width: auto;
    }

    /* Optimize loading screen */
    .loading-spinner {
        width: 45px;
        height: 45px;
    }

    .loading-text {
        font-size: 1rem;
    }

    .loading-progress {
        width: 150px;
        height: 6px;
    }
}

/* Extra small mobile landscape (max-height: 400px) */
@media screen and (max-height: 400px) and (orientation: landscape) {

    .top-ui-bar {
        height: 10vh;
        top: 5vh;
    }

    .player-panel {
        margin-top: 2vh;
    }

    .player-avatar-frame {
        width: 12vh;
        height: 12vh;
    }

    .player-avatar-img img {
        width: 16vh;
        height: 16vh;
        margin-top: 2vh;
    }

    .player-stats {
        min-width: 20vh;
        margin-left: -4vh;
    }

    .player-panel.right .player-stats {
        margin-right: -4vh;
    }

    .player-name {
        font-size: 1.8vh;
        margin-left: 3vh;
        margin-top: 2vh;
    }

    .player-panel.right .player-name {
        margin-right: 3vh;
    }

    .bar-container {
        width: 32vh;
        height: 6vh;
    }

    .bar-container.mana {
        width: 22vh;
        height: 4.5vh;
    }

    .bar-text {
        font-size: 1vh;
    }

    .round-counter {
        width: 12vh;
        height: 12vh;
    }

    .round-number {
        font-size: 2.5vh;
    }

    .character-card {
        width: 25vh;
        height: 38vh;
    }

    .vs-emblem {
        width: 28vh;
        height: 28vh;
    }

    .battle-arena {
        top: 20px;
    }

    /* .battle-log {
        width: 39vh;
        height: 28vh;
        padding: 6vh 6vh;
    } */

    .log-entry {
        font-size: 1vh;
    }

    .item-slot {
        width: 7vh;
        height: 8vh;
    }
}