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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.info-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.score-display {
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
    font-weight: bold;
}

.player-score {
    color: #3b82f6;
}

.enemy-score {
    color: #ef4444;
}

.turn-display {
    font-size: 1.1rem;
    font-weight: bold;
    color: #4b5563;
}

.unit-info {
    border-top: 2px solid #e5e7eb;
    padding-top: 10px;
}

.unit-info h3 {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 5px;
}

#selected-unit-info {
    color: #6b7280;
    font-size: 0.9rem;
}

#game-board {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 500px;
}

.hex-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hex-row {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.hex {
    width: 50px;
    height: 58px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.hex-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.hex-shape {
    width: 100%;
    height: 100%;
    background: #f3f4f6;
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
    border: 2px solid #d1d5db;
    transition: all 0.2s;
}

.hex.selectable .hex-shape {
    background: #dbeafe;
    border-color: #60a5fa;
}

.hex.selectable:hover .hex-shape {
    background: #bfdbfe;
    transform: scale(1.1);
}

.hex.selected .hex-shape {
    background: #93c5fd;
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.hex.move-target .hex-shape {
    background: #fef3c7;
    border-color: #fbbf24;
    animation: pulse 1s infinite;
}

.hex.move-target:hover .hex-shape {
    background: #fde68a;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.hex-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.unit {
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.unit.player {
    color: #3b82f6;
}

.unit.enemy {
    color: #ef4444;
}

.unit-hp {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
}

.crystal {
    font-size: 1.3rem;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        filter: brightness(1.5);
    }
}

.ability-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.7rem;
    background: rgba(147, 51, 234, 0.9);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

button {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.rules-content {
    text-align: left;
    color: #4b5563;
}

.rules-content h3 {
    color: #667eea;
    margin-top: 15px;
    margin-bottom: 10px;
}

.rules-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.rules-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.ability-buttons {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.ability-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
}

.ability-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.5;
}

.ability-btn:disabled:hover {
    transform: none;
}
