* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    padding: 16px;
    margin: 0;
    background-color: #000000;
    background-image: url('chaosbackground.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: #00ffff;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 0, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(0, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Welcome Screen */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    background-image: url('chaosbackground.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.welcome-content {
    background: linear-gradient(180deg, #1a0033 0%, #330066 100%);
    border: 6px outset #ff00ff;
    border-radius: 0;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-shadow: 
        inset 0 0 20px rgba(255, 0, 255, 0.3),
        0 0 30px rgba(0, 255, 255, 0.2);
}

.battle-log {
    background: linear-gradient(180deg, #000000 0%, #1a0033 100%);
    border: 4px inset #00ff00;
    border-radius: 0;
    padding: 10px 12px;
    margin: 0 auto;
    min-height: 0;
    height: auto;
    display: block;
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.2), 0 0 15px rgba(0, 255, 0, 0.3);
    overflow: hidden;
}

.log-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}

.log-content p {
    margin: 5px 0;
    line-height: 1.4;
}

.welcome-subtitle {
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 40px;
    text-shadow: 1px 1px 0px #000000;
}

.opponent-selection {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
}

.opponent-btn {
    background: linear-gradient(180deg, #330066 0%, #1a0033 100%);
    border: 4px outset #00ffff;
    border-radius: 0;
    padding: 30px 20px;
    width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.opponent-btn:hover {
    border-color: #ff00ff;
    transform: translateY(-2px);
    box-shadow: 
        inset 0 0 15px rgba(255, 0, 255, 0.3),
        0 0 20px rgba(0, 255, 255, 0.4);
}

.opponent-btn h3 {
    font-size: 24px;
    color: #00ffff;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0px #000000;
}

.opponent-btn p {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 15px;
}

.btn-icon {
    font-size: 32px;
    display: block;
}

.account-section, .lobby-section {
    margin-top: 30px;
}

.account-section h3, .lobby-section h3 {
    color: #00ffff;
    margin-bottom: 20px;
    font-size: 20px;
}

.username-display {
    margin-bottom: 20px;
    color: #00ffff;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.username-display span {
    color: #ffffff;
    font-weight: 700;
}

.guest-warning {
    margin-top: 15px;
    color: #ff6666;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.opponent-btn:disabled,
.opponent-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.4);
}

.join-btn, .lobby-btn, .cancel-btn {
    background: linear-gradient(180deg, #006600 0%, #003300 100%);
    border: 3px outset #00ff00;
    border-radius: 0;
    padding: 12px 24px;
    font-size: 16px;
    color: #00ff00;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    transition: all 0.3s ease;
}

.join-btn:hover:not(:disabled), .lobby-btn:hover, .cancel-btn:hover {
    border-color: #ff00ff;
    background: linear-gradient(180deg, #660066 0%, #330033 100%);
    color: #ff00ff;
}

.join-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lobby-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.join-game-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

#gameCodeInput {
    background: #000000;
    border: 3px inset #666666;
    border-radius: 0;
    padding: 10px;
    font-size: 16px;
    color: #00ffff;
    width: 120px;
    text-transform: uppercase;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
}

#gameCodeInput:focus {
    outline: none;
    border-color: #ff00ff;
    box-shadow: inset 0 0 10px rgba(255, 0, 255, 0.3);
}

.waiting-message {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(180deg, #333300 0%, #666600 100%);
    border: 3px outset #ffff00;
    border-radius: 0;
}

.waiting-message p {
    color: #ffff00;
    margin-bottom: 10px;
    font-size: 18px;
}

#gameCodeDisplay {
    font-size: 16px;
    margin-bottom: 15px;
}

.account-note {
    font-size: 14px;
    color: #cccccc;
    margin-top: 10px;
    font-style: italic;
}

.game-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Profile Container */
.profile-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.profile-mini {
    background: linear-gradient(135deg, #1a0033 0%, #330066 100%);
    border: 2px outset #ff00ff;
    border-radius: 9px;
    padding: 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    box-shadow: 0 3px 14px rgba(255, 0, 255, 0.35);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 210px;
}

.profile-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(255, 0, 255, 0.5);
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #00ffff;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.board-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 18px;
    align-items: start;
    width: 100%;
    margin: 0 auto;
}

.field-column {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field-log {
    width: 100%;
    display: flex;
    justify-content: center;
}

.action-column {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
        "actions actions actions cardinfo cardinfo cardinfo"
        "rules rules leaderboard leaderboard effects effects";
    gap: 14px;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .action-column {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-areas:
            "actions actions cardinfo cardinfo"
            "rules rules leaderboard leaderboard"
            "effects effects effects effects";
    }
}

@media (max-width: 900px) {
    .board-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .action-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "actions cardinfo"
            "rules rules"
            "leaderboard leaderboard"
            "effects effects";
    }
}

@media (max-width: 620px) {
    .action-column {
        grid-template-columns: 1fr;
        grid-template-areas:
            "actions"
            "cardinfo"
            "rules"
            "leaderboard"
            "effects";
    }

    .battle-log {
        width: 100%;
    }
}

.profile-info h3 {
    font-size: 16px;
    color: #00ffff;
    margin: 0 0 5px 0;
    font-weight: bold;
    text-shadow: 0 0 10px #00ffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-stats {
    font-size: 12px;
    color: #ffffff;
    margin: 0;
    display: flex;
    gap: 15px;
}

.profile-stats .wins {
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

.profile-stats .losses {
    color: #ff0080;
    text-shadow: 0 0 5px #ff0080;
}

.connect-wallet-btn-profile {
    background: linear-gradient(135deg, #9945ff 0%, #14f195 100%);
    border: 2px outset #9945ff;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    color: #ffffff;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.connect-wallet-btn-profile:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(153, 69, 255, 0.6);
}

.connect-wallet-btn-profile.connected {
    background: linear-gradient(135deg, #14f195 0%, #9945ff 100%);
    border-color: #14f195;
}

.connect-wallet-btn-profile .wallet-icon {
    font-size: 14px;
}

.connect-wallet-btn-profile .wallet-address {
    font-size: 10px;
    font-family: monospace;
}

/* Return to Home Button */
.return-home-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 2000;
    background: linear-gradient(135deg, #330066 0%, #1a0033 100%);
    border: 3px outset #00ffff;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    color: #00ffff;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.return-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.5);
    border-color: #ff00ff;
    color: #ff00ff;
}

.board-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.field-column {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.log-column {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.action-column {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Mobile layout - stack vertically */
@media (max-width: 900px) {
    .action-column {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Top Bar */
.top-bar {
    background: linear-gradient(180deg, #1a0033 0%, #330066 100%);
    border: 4px outset #ff00ff;
    border-radius: 0;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 20px #ff00ff, inset 0 0 20px rgba(255, 0, 255, 0.2);
}

.score-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.player-score, .opponent-score, .arena-temp {
    flex: 1;
    text-align: center;
}

.player-score h3, .opponent-score h3, .arena-temp h3 {
    font-size: 14px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    color: #ff8800;
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-shadow: 0 0 5px #ff8800, 1px 1px 0 #000;
}

.player-score p, .opponent-score p {
    font-size: 42px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    color: #00ffff;
    text-shadow: 0 0 15px #00ffff, 2px 2px 0 #ff00ff;
    animation: scoreGlow 2s ease-in-out infinite;
}

@keyframes scoreGlow {
    0%, 100% { text-shadow: 0 0 15px #00ffff, 2px 2px 0 #ff00ff; }
    50% { text-shadow: 0 0 25px #00ffff, 2px 2px 0 #ff00ff; }
}

.arena-temp p {
    font-size: 24px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    color: #ffffff;
    text-shadow: 0 0 10px #fff, 1px 1px 2px #000;
}

.temp-bar {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.temp-indicator {
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, #00ffff 0%, #ffffff 50%, #ff4444 100%);
    transition: transform 0.5s ease;
}

.temp-indicator.ice {
    transform: translateX(-40%);
    background: #00ffff;
}

.temp-indicator.fire {
    transform: translateX(40%);
    background: #ff4444;
}

/* Card Zones */
.opponent-area, .player-area {
    margin: 30px 0;
}

.opponent-area, .player-area {
    margin: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(26, 0, 51, 0.6) 100%);
    border: 4px outset rgba(255, 0, 255, 0.35);
    padding: 18px;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.2);
}
.opponent-area h2, .player-area h2 {
    text-align: center;
    font-size: 16px;
    letter-spacing: 3px;
    margin-bottom: 14px;
    color: rgba(255,255,255,0.7);
}

.card-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}

.card-slot {
    display: flex;
    justify-content: center;
}

.reserve-zone {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Cards */
.card {
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    box-shadow: 0 0 12px rgba(0,0,0,0.75);
    border: 3px outset rgba(255,255,255,0.6);
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card:not(.empty) {
    background: linear-gradient(135deg, #1a0033 0%, #4a0080 100%);
    border-style: outset;
    border-width: 4px;
    border-radius: 0;
}

.card.empty {
    background: rgba(0,0,0,0.5);
    border: 3px inset rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: default;
}

.card:not(.empty):not(.small) {
    width: 228px;
    height: 312px;
}

.card.small {
    width: 108px;
    height: 154px;
    font-size: 11px;
}

.card.selectable:not(.empty):hover {
    transform: translateY(-10px) scale(1.05) rotate(2deg);
    box-shadow: 0 0 30px #00ffff, 0 0 60px rgba(0,255,255,0.5);
    border-color: #00ffff;
    border-style: outset;
    border-width: 5px;
    animation: cardShake 0.3s ease infinite;
}

@keyframes cardShake {
    0%, 100% { transform: translateY(-10px) scale(1.05) rotate(2deg); }
    50% { transform: translateY(-10px) scale(1.05) rotate(-2deg); }
}

.card.selected {
    border-color: #ff8800 !important;
    border-style: outset !important;
    border-width: 5px !important;
    box-shadow: 0 0 40px #ff8800, 0 0 80px rgba(255,136,0,0.8) !important;
    transform: translateY(-10px) scale(1.05);
    animation: selectedPulse 1s ease-in-out infinite;
}

@keyframes selectedPulse {
    0%, 100% { box-shadow: 0 0 40px #ff8800, 0 0 80px rgba(255,136,0,0.8); }
    50% { box-shadow: 0 0 60px #ff8800, 0 0 120px rgba(255,136,0,1); }
}

/* Card Types */
.card.schizo:not(.empty) {
    background: linear-gradient(135deg, #1a0033 0%, #660066 100%);
    border-color: #ff00ff;
    border-style: outset;
    box-shadow: 0 0 20px #ff00ff;
}

.card.autist:not(.empty) {
    background: linear-gradient(135deg, #001a33 0%, #006666 100%);
    border-color: #00ffff;
    border-style: outset;
    box-shadow: 0 0 20px #00ffff;
}

.card.based:not(.empty) {
    background: linear-gradient(135deg, #1a1700 0%, #664400 100%);
    border-color: #ff8800;
    border-style: outset;
    box-shadow: 0 0 20px #ff8800;
}

.card-label {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 5px;
    letter-spacing: 1px;
}


.card-art {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    border-radius: 6px;
    overflow: hidden;
    border: 2px inset rgba(255,255,255,0.25);
    background: rgba(0,0,0,0.45);
    height: 55%;
}

.card-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-art.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.card-body-compact {
    gap: 6px;
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-name {
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.card-type {
    font-size: 9px;
    color: rgba(255,255,255,0.75);
    letter-spacing: 2px;
}

.card-stats {
    display: flex;
    justify-content: space-around;
    margin: 8px 0;
}

.stat {
    text-align: center;
}


.stat-label {
    font-size: 9px;
    color: rgba(255,255,255,0.55);
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #00ffff;
}


.card-attacks {
    text-align: left;
    font-size: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.attack-name {
    font-weight: bold;
    color: #ff8800;
    margin-bottom: 2px;
}

.card-quick-stats {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: rgba(255,255,255,0.8);
}

.quick-stat {
    background: rgba(0,0,0,0.35);
    padding: 2px 4px;
    border-radius: 4px;
}

.card.small .card-art {
    height: 84px;
}

/* Battle Log */
.battle-log {
    background: linear-gradient(180deg, #000000 0%, #1a0033 100%);
    border: 4px inset #00ff00;
    border-radius: 0;
    padding: 10px 12px;
    margin: 0 auto;
    width: 78%;
    max-width: 100%;
    height: 140px;
    max-height: 140px;
    overflow-y: auto;
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.2), 0 0 15px rgba(0, 255, 0, 0.3);
}

.log-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    max-height: 100%;
}

.log-content p {
    font-size: 12px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    line-height: 1.5;
    color: #00ff00;
    margin: 4px 0;
    padding: 6px;
    border-left: 3px solid #00ffff;
    padding-left: 10px;
    text-shadow: 0 0 5px #00ffff;
}

.log-content p.damage {
    border-left-color: #ff0080;
    color: #ff0080;
    text-shadow: 0 0 5px #ff0080;
}

.log-content p.heal {
    border-left-color: #00ff00;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

.log-content p.effect {
    border-left-color: #ff8800;
    color: #ff8800;
    text-shadow: 0 0 5px #ff8800;
}

/* Action Panel */
.action-panel {
    display: contents;
}

/* Turn Rules */
.turn-rules {
    grid-area: rules;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(135deg, #000000 0%, #1a0033 100%);
    border: 4px outset #00ffff;
    border-radius: 0;
    padding: 12px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 15px rgba(0, 255, 255, 0.1);
}

.turn-rules h4 {
    font-size: 11px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: #ff8800;
    text-align: center;
    text-shadow: 0 0 10px #ff8800, 2px 2px 0 #000;
}

.turn-rules p {
    font-size: 10px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    margin: 4px 0;
    color: #00ffff;
    padding-left: 10px;
    text-shadow: 0 0 5px #00ffff, 1px 1px 0 #000;
}

.turn-rules .note {
    margin-top: 10px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    color: #ff00ff;
    font-size: 9px;
    text-shadow: 0 0 5px #ff00ff, 1px 1px 0 #000;
}

.action-buttons {
    grid-area: actions;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(51, 0, 102, 0.9) 100%);
    border: 4px outset #ff8800;
    padding: 15px;
    box-shadow: 0 0 15px rgba(255, 136, 0, 0.3);
}

.action-btn {
    border: 4px outset #ff8800;
    font-size: 11px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    letter-spacing: 1px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ff00ff 0%, #00ffff 100%);
    color: #000;
    text-shadow: none;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
    padding: 8px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-btn:hover:not(:disabled) {
    transform: scale(1.08) rotate(-1deg);
    box-shadow: 0 0 30px #ff00ff, 0 0 60px #00ffff;
    border-color: #00ffff;
    border-style: outset;
    animation: btnWiggle 0.5s ease infinite;
}

@keyframes btnWiggle {
    0%, 100% { transform: scale(1.08) rotate(-1deg); }
    50% { transform: scale(1.08) rotate(1deg); }
}

.action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #333;
    border-color: #666;
    border-style: inset;
    box-shadow: none;
}

.primary-btn {
    background: linear-gradient(45deg, #00ffff 0%, #ff00ff 100%);
    border-color: #00ffff;
    border-style: outset;
    box-shadow: 0 0 15px #00ffff;
}

.attack-btn {
    background: linear-gradient(45deg, #ff0080 0%, #ff8800 100%);
    border-color: #ff0080;
    border-style: outset;
    box-shadow: 0 0 15px #ff0080;
}

/* Card Info */
.card-info {
    grid-area: cardinfo;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #000000 0%, #1a0033 100%);
    border: 4px inset #ff00ff;
    padding: 16px;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3), inset 0 0 15px rgba(255, 0, 255, 0.1);
}

.card-info h3 {
    font-size: 13px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    letter-spacing: 2px;
    margin-bottom: 12px;
    color: #ff8800;
    text-align: center;
    text-shadow: 0 0 10px #ff8800, 2px 2px 0 #000;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.info-basics {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.info-basics p {
    flex: 1;
    font-size: 12px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    margin: 0;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

.info-basics strong {
    color: #ff00ff;
    text-shadow: 0 0 5px #ff00ff;
}

.info-moves {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-move {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 0, 255, 0.25);
    border-radius: 8px;
    padding: 12px;
}

.info-move-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.info-move-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ff8800;
}

.info-move-name {
    flex: 1;
    font-size: 14px;
    color: #ffffff;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.info-move-stats {
    display: flex;
    gap: 8px;
}

.info-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    color: #00ffff;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.12);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-move-desc {
    font-size: 11px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    line-height: 1.5;
    color: #c7d9ff;
    text-shadow: 0 0 4px rgba(199, 217, 255, 0.4);
}

/* Status Effects */
.status-effects {
    grid-area: effects;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #000000 0%, #001a1a 100%);
    border: 4px inset #00ff00;
    border-radius: 0;
    padding: 12px;
}

.status-effects h4 {
    font-size: 10px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: italic;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.7);
    text-align: center;
}

.effects-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    font-size: 9px;
}

.effect-item {
    padding: 6px;
    margin: 4px 0;
    background: rgba(255,255,255,0.05);
    border-left: 3px solid #ff8800;
    border-radius: 5px;
}

.no-effects {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-style: italic;
}

/* Animations */
@keyframes cardDeal {
    from {
        opacity: 0;
        transform: translateY(-50px) rotateY(180deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateY(0);
    }
}

.card.dealing {
    animation: cardDeal 0.5s ease-out;
}

@keyframes attackFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.card.attacking {
    animation: attackFlash 0.3s ease-in-out 3;
}

/* Attack Animations */
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-5px, 5px); }
    20%, 40%, 60%, 80% { transform: translate(5px, -5px); }
}

@keyframes fireAttack {
    0% { 
        box-shadow: 0 0 20px #ff0000, 0 0 40px #ff4400, 0 0 60px #ff8800;
        filter: brightness(1.5) hue-rotate(0deg);
    }
    25% {
        box-shadow: 0 0 40px #ff4400, 0 0 80px #ff8800, 0 0 120px #ffaa00;
        filter: brightness(2) hue-rotate(10deg);
    }
    50% {
        box-shadow: 0 0 60px #ff8800, 0 0 100px #ffaa00, 0 0 140px #ffdd00;
        filter: brightness(2.5) hue-rotate(20deg);
    }
    75% {
        box-shadow: 0 0 40px #ff4400, 0 0 80px #ff8800, 0 0 120px #ffaa00;
        filter: brightness(2) hue-rotate(10deg);
    }
    100% {
        box-shadow: 0 0 20px #ff0000, 0 0 40px #ff4400, 0 0 60px #ff8800;
        filter: brightness(1.5) hue-rotate(0deg);
    }
}

@keyframes iceAttack {
    0% { 
        box-shadow: 0 0 20px #00ffff, 0 0 40px #00ccff, 0 0 60px #0099ff;
        filter: brightness(1.5) hue-rotate(0deg);
    }
    25% {
        box-shadow: 0 0 40px #00ccff, 0 0 80px #0099ff, 0 0 120px #0066ff;
        filter: brightness(2) hue-rotate(-10deg);
    }
    50% {
        box-shadow: 0 0 60px #0099ff, 0 0 100px #0066ff, 0 0 140px #ffffff;
        filter: brightness(2.5) hue-rotate(-20deg);
    }
    75% {
        box-shadow: 0 0 40px #00ccff, 0 0 80px #0099ff, 0 0 120px #0066ff;
        filter: brightness(2) hue-rotate(-10deg);
    }
    100% {
        box-shadow: 0 0 20px #00ffff, 0 0 40px #00ccff, 0 0 60px #0099ff;
        filter: brightness(1.5) hue-rotate(0deg);
    }
}

.card.fire-attack {
    animation: fireAttack 1s ease-in-out;
}

.card.ice-attack {
    animation: iceAttack 1s ease-in-out;
}

.game-container.screen-shake {
    animation: screenShake 0.5s ease-in-out;
}

.fire-projectile,
.ice-projectile {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    mix-blend-mode: screen;
}

.fire-projectile {
    background: radial-gradient(circle at 30% 30%, #ffff66 0%, #ff8800 40%, rgba(255, 0, 0, 0.7) 70%, rgba(255, 0, 0, 0) 100%);
    box-shadow: 0 0 20px rgba(255, 68, 0, 0.9), 0 0 40px rgba(255, 160, 0, 0.7);
}

.ice-projectile {
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #80ffff 40%, rgba(0, 180, 255, 0.7) 70%, rgba(0, 180, 255, 0) 100%);
    box-shadow: 0 0 20px rgba(80, 200, 255, 0.9), 0 0 40px rgba(170, 240, 255, 0.7);
}

/* Fire particle effect overlay */
.fire-particles {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
}

.fire-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #ff4400, #ff0000);
    border-radius: 50%;
    animation: fireParticleRise 1s ease-out forwards;
    box-shadow: 0 0 10px #ff4400, 0 0 20px #ff8800;
}

@keyframes fireParticleRise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) scale(0);
        opacity: 0;
    }
}

/* Ice particle effect overlay */
.ice-particles {
    position: fixed;
    top: 0;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 9999;
}

.ice-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #ffffff, #00ffff);
    border-radius: 50%;
    animation: iceParticleFall 1.5s ease-in forwards;
    box-shadow: 0 0 5px #00ffff, 0 0 10px #ffffff;
}

@keyframes iceParticleFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(360deg) scale(0);
        opacity: 0;
    }
}

.card.hit-flash {
    position: relative;
}

.card.hit-flash-fire {
    animation: fireImpactFlash 0.45s ease-out;
}

.card.hit-flash-ice {
    animation: iceImpactFlash 0.45s ease-out;
}

.card.hit-flash-normal {
    animation: normalImpactFlash 0.35s ease-out;
}

@keyframes fireImpactFlash {
    0% { box-shadow: 0 0 15px rgba(255, 80, 0, 0.5), 0 0 25px rgba(255, 80, 0, 0.3); filter: brightness(1); }
    40% { box-shadow: 0 0 55px rgba(255, 120, 0, 1), 0 0 85px rgba(255, 200, 0, 0.8); filter: brightness(1.4); }
    100% { box-shadow: 0 0 15px rgba(255, 80, 0, 0.4), 0 0 30px rgba(255, 140, 0, 0.3); filter: brightness(1); }
}

@keyframes iceImpactFlash {
    0% { box-shadow: 0 0 15px rgba(80, 210, 255, 0.5), 0 0 25px rgba(80, 210, 255, 0.3); filter: brightness(1); }
    40% { box-shadow: 0 0 55px rgba(160, 240, 255, 1), 0 0 85px rgba(200, 255, 255, 0.8); filter: brightness(1.4); }
    100% { box-shadow: 0 0 15px rgba(80, 210, 255, 0.4), 0 0 30px rgba(160, 240, 255, 0.3); filter: brightness(1); }
}

@keyframes normalImpactFlash {
    0% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 0 18px rgba(255, 255, 255, 0.2); filter: contrast(1); }
    35% { box-shadow: 0 0 35px rgba(255, 255, 255, 0.7), 0 0 55px rgba(255, 255, 255, 0.4); filter: contrast(1.25); }
    100% { box-shadow: 0 0 12px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 255, 255, 0.15); filter: contrast(1); }
}

/* Scrollbar */
.battle-log::-webkit-scrollbar {
    width: 14px;
}

.battle-log::-webkit-scrollbar-track {
    background: #000;
    border: 3px inset #00ff00;
}

.battle-log::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00ff00, #00ffff);
    border: 3px outset #ff8800;
}

.battle-log::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00ffff, #00ff00);
}

/* Global scrollbar */
::-webkit-scrollbar {
    width: 14px;
}

::-webkit-scrollbar-track {
    background: #000;
    border: 3px inset #ff00ff;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff00ff, #00ffff);
    border: 3px outset #ff8800;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00ffff, #ff00ff);
}

/* Responsive */
@media (max-width: 1200px) {
    .board-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .field-column,
    .action-column,
    .log-column {
        width: 100%;
    }

    .action-column {
        order: 2;
    }

    .log-column {
        order: 3;
    }

    .battle-log {
        min-height: 240px;
    }

    .card:not(.empty):not(.small) {
        width: 200px;
        height: 280px;
    }
    
    .card.small {
        width: 100px;
        height: 140px;
    }
}

/* Authentication Section */
.auth-section {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    width: 100%;
    max-width: 400px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    color: #00ffff;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s;
}

.auth-tab.active {
    background: rgba(0, 255, 255, 0.3);
    border-bottom: 2px solid #00ffff;
}

.auth-tab:hover {
    background: rgba(0, 255, 255, 0.2);
}

.auth-form {
    text-align: center;
}

.auth-form h3 {
    color: #00ffff;
    margin-bottom: 15px;
}

.auth-form input {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffff;
    border-radius: 5px;
    color: #00ffff;
    font-size: 16px;
}

.auth-form input::placeholder {
    color: rgba(0, 255, 255, 0.5);
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: #00ffff;
    border: none;
    border-radius: 5px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}

.auth-btn:hover {
    background: #00cccc;
}

.auth-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

.auth-error {
    color: #ff4444;
    margin-top: 10px;
    font-size: 14px;
}

.user-info {
    text-align: center;
}

.user-info p {
    color: #00ffff;
    margin-bottom: 10px;
}

.user-stats {
    display: flex;
    justify-content: space-around;
    margin: 10px 0;
    font-size: 14px;
}

.logout-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.logout-btn:hover {
    background: #cc3333;
}

/* Leaderboard */
.leaderboard-section {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    width: 100%;
    max-width: 600px;
}

.leaderboard-section h3 {
    color: #00ffff;
    text-align: center;
    margin-bottom: 15px;
}

.leaderboard-content {
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-loading {
    text-align: center;
    color: #00ffff;
    padding: 20px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    background: rgba(0, 255, 255, 0.05);
    margin-bottom: 5px;
    border-radius: 5px;
}

.leaderboard-item.rank-1 {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid gold;
}

.leaderboard-item.rank-2 {
    background: rgba(192, 192, 192, 0.1);
    border: 1px solid silver;
}

.leaderboard-item.rank-3 {
    background: rgba(205, 127, 50, 0.1);
    border: 1px solid #cd7f32;
}

.leaderboard-rank {
    font-weight: bold;
    color: #00ffff;
    min-width: 30px;
}

.leaderboard-username {
    flex: 1;
    color: #00ffff;
    font-weight: bold;
}

.leaderboard-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #00cccc;
}

/* Mini Leaderboard */
.mini-leaderboard {
    grid-area: leaderboard;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffff;
    border-radius: 4px;
    padding: 7px;
    margin-top: 0;
    width: 100%;
}

.mini-leaderboard h4 {
    color: #00ffff;
    text-align: center;
    margin-bottom: 7px;
    font-size: 11px;
}

.mini-leaderboard-content {
    flex: 1;
    min-height: 0;
    max-height: 150px;
    overflow-y: auto;
}

.mini-leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    font-size: 9px;
}

.mini-leaderboard-rank {
    color: #00ffff;
    font-weight: bold;
    min-width: 15px;
}

.mini-leaderboard-username {
    flex: 1;
    color: #00ffff;
}

.mini-leaderboard-winrate {
    color: #00cccc;
    font-weight: bold;
}

/* Game Footer */
.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #00ff00;
}

.back-btn {
    background: linear-gradient(135deg, #333 0%, #666 100%);
    border: 2px outset #666;
    color: #ff4444;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    border-radius: 0;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: linear-gradient(135deg, #444 0%, #777 100%);
    border-color: #777;
    transform: scale(1.05);
}

.user-display {
    color: #00ff00;
    font-size: 16px;
    font-weight: bold;
}

.user-display span {
    text-shadow: 0 0 5px #00ff00;
}
