/* Lord of Cards - Hauptstyles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

.game-container {
    width: 100%;
    height: 100vh;
    padding: 0.5vh 0.5vw;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Header */
.game-header {
    text-align: center;
    padding: 0.5vh 0.8vw;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.8vh;
    margin-bottom: 0.4vh;
    box-shadow: 0 0.3vh 1.5vh rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    height: 8vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-header h1 {
    font-size: 2.8vh;
    text-shadow: 0.2vh 0.2vh 0.4vh rgba(0, 0, 0, 0.5);
    margin-bottom: 0.3vh;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.game-controls {
    display: flex;
    gap: 0.6vw;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.5vh 1vw;
    border: none;
    border-radius: 0.6vh;
    font-size: 1.3vh;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    box-shadow: 0 0.3vh 0.5vh rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-0.2vh);
    box-shadow: 0 0.8vh 1.2vh rgba(0, 0, 0, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-end-turn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 1.4vh;
    padding: 0.7vh 1.5vw;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spielfeld */
.game-board {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1.5vh;
    padding: 0.6vh 0.6vw;
    margin: 0.4vh 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    min-height: 0;
}

/* Spieler-Bereiche */
.opponent-area, .player-area {
    flex: 0 0 43%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1vw;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.6vh 1.2vw;
    border-radius: 1vh;
    margin-bottom: 0.5vh;
    flex-shrink: 0;
    height: 6vh;
}

.opponent-info {
    border: 3px solid #e74c3c;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}

.player-info-bottom {
    border: 3px solid #3498db;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

.player-avatar {
    font-size: 3.5vh;
    width: 4.5vh;
    height: 4.5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: 0.2vh solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.player-stats {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-size: 1.5vh;
    font-weight: bold;
    margin-bottom: 0.3vh;
    line-height: 1;
}

.health-bar, .mana-bar {
    font-size: 1.4vh;
    margin: 0.2vh 0;
    display: flex;
    align-items: center;
    gap: 0.5vw;
    line-height: 1;
}

.health-value {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 1.1em;
}

.mana-value {
    color: #4dabf7;
    font-weight: bold;
    font-size: 1.1em;
}

.deck-info {
    text-align: center;
    font-size: 1.4vh;
    flex-shrink: 0;
}

/* Spielfeld Slots */
.board-area {
    display: flex;
    gap: 0.5vw;
    justify-content: center;
    flex: 1;
    padding: 0.6vh 0.4vw;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1vh;
    border: 0.15vh dashed rgba(255, 255, 255, 0.2);
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 0;
    align-items: center;
}

.board-slot {
    width: 7vw;
    height: 12vh;
    min-width: 7vw;
    max-width: 9vw;
    max-height: 15vh;
    background: rgba(255, 255, 255, 0.05);
    border: 0.15vh dashed rgba(255, 255, 255, 0.3);
    border-radius: 0.8vh;
    transition: all 0.3s;
    flex-shrink: 0;
}

.board-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.board-slot.drag-over {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4caf50;
    transform: scale(1.05);
}

/* Hand Area */
.hand-area {
    display: flex;
    gap: 0.5vw;
    justify-content: center;
    padding: 2vh 0.4vw 0.6vh 0.4vw;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1vh;
    margin-top: 0.5vh;
    height: 16vh;
    overflow-x: auto;
    overflow-y: visible;
    flex-shrink: 0;
    align-items: flex-start;
}

/* Karten */
.card {
    width: 7vw;
    min-width: 7vw;
    max-width: 9vw;
    height: 12vh;
    max-height: 15vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.8vh;
    padding: 0.5vh 0.4vw;
    cursor: grab;
    position: relative;
    transition: all 0.3s;
    box-shadow: 0 0.4vh 1.2vh rgba(0, 0, 0, 0.5);
    border: 0.2vh solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-1vh) scale(1.05);
    box-shadow: 0 1.2vh 2.5vh rgba(0, 0, 0, 0.7);
    z-index: 10;
}

.card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.card.creature {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.card.spell {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.card.equipment {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.card.legendary {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* Karten-Inhalte */
.card-cost {
    position: absolute;
    top: -0.4vh;
    left: -0.4vw;
    width: 2vw;
    height: 2vw;
    min-width: 20px;
    min-height: 20px;
    max-width: 28px;
    max-height: 28px;
    background: #2c3e50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3vh;
    font-weight: bold;
    border: 0.2vh solid #ffd700;
    color: #fff;
    box-shadow: 0 0.15vh 0.6vh rgba(0, 0, 0, 0.5);
}

.card-name {
    font-size: 1.1vh;
    font-weight: bold;
    text-align: center;
    margin-top: 1.5vh;
    margin-bottom: 0.2vh;
    color: #fff;
    text-shadow: 0.1vh 0.1vh 0.2vh rgba(0, 0, 0, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.card-image {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3vh;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.6vh;
    margin: 0.2vh 0;
}

.card-description {
    font-size: 0.9vh;
    text-align: center;
    margin: 0.2vh 0;
    flex: 0 0 auto;
    min-height: 2vh;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 0.3vh;
    flex-shrink: 0;
}

.card-attack, .card-health {
    width: 1.8vw;
    height: 1.8vw;
    min-width: 20px;
    min-height: 20px;
    max-width: 28px;
    max-height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.3vh;
    border: 0.15vh solid rgba(255, 255, 255, 0.5);
}

.card-attack {
    background: #e74c3c;
    color: white;
}

.card-health {
    background: #27ae60;
    color: white;
}

.card-abilities {
    display: flex;
    gap: 0.2vw;
    justify-content: center;
    margin-top: 0.3vh;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.ability-icon {
    font-size: 1vh;
    padding: 0.15vh 0.3vw;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0.2vh;
    border: 0.1vh solid rgba(255, 255, 255, 0.3);
}

/* Kreatur auf dem Spielfeld */
.card.on-board {
    cursor: pointer;
}

.card.can-attack {
    animation: pulse 1s infinite;
}

.card.exhausted {
    opacity: 0.6;
    filter: grayscale(50%);
}

.card.attacking {
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
}

.card.selected-attacker {
    border-color: #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
    transform: scale(1.1);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 1vh rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 2.5vh rgba(255, 215, 0, 0.9); }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal.show {
    display: block;
}

.modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    margin: 5% auto;
    padding: 3vh 3vw;
    border: 0.2vh solid rgba(255, 255, 255, 0.3);
    border-radius: 2vh;
    width: 90%;
    max-width: 1200px;
    box-shadow: 0 1vh 5vh rgba(0, 0, 0, 0.7);
    max-height: 85vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 4vh;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close:hover {
    color: #fff;
}

/* Deck Builder */
.deck-builder-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.card-collection h3, .current-deck h3 {
    margin-bottom: 15px;
    color: #ffd700;
}

.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-bar select {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 14px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
}

.deck-list {
    max-height: 600px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
}

.deck-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.deck-card-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* Regeln */
.rules-content {
    max-height: 600px;
    overflow-y: auto;
}

.rules-content h3 {
    color: #ffd700;
    margin: 20px 0 10px;
}

.rules-content ul, .rules-content ol {
    margin-left: 25px;
    line-height: 1.8;
}

/* Game Over */
.game-over-content {
    text-align: center;
    max-width: 500px;
}

.game-over-content h2 {
    font-size: 3em;
    margin-bottom: 20px;
    color: #ffd700;
}

.game-over-content p {
    font-size: 1.5em;
    margin-bottom: 30px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 1vh;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5vh;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0.5vh;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive Design - nur für extreme Anpassungen */
@media (max-width: 1024px) {
    .deck-builder-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .player-info {
        gap: 1vw;
    }
    
    .card, .board-slot {
        width: 12vw;
        min-width: 12vw;
    }
}

@media (max-aspect-ratio: 1/1) {
    /* Portrait mode */
    .card, .board-slot {
        width: 15vw;
        min-width: 15vw;
    }
}
