/* Reset y variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B35;
    --secondary-color: #004AAD;
    --accent-color: #FFD700;
    --background-color: #F0F8FF;
    --text-color: #2C3E50;
    --success-color: #27AE60;
    --danger-color: #E74C3C;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--background-color) 0%, #E3F2FD 100%);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Home Page Styles */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.game-title h1 {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

.game-title .subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 3rem;
    font-weight: 500;
}

@keyframes titleGlow {
    from { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); }
    to { text-shadow: 2px 2px 20px rgba(255, 107, 53, 0.6); }
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: var(--shadow);
    min-width: 200px;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #FF8A65);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, var(--secondary-color), #42A5F5);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 74, 173, 0.4);
}

.btn-info {
    background: linear-gradient(45deg, #17A2B8, #20C997);
    color: white;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(23, 162, 184, 0.4);
}

.btn-icon {
    font-size: 1.3rem;
}

/* Pokemon decoration */
.pokemon-decoration {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
}

.pokeball {
    width: 80px;
    height: 80px;
    background: linear-gradient(to bottom, var(--primary-color) 50%, white 50%);
    border-radius: 50%;
    border: 4px solid var(--text-color);
    position: relative;
    animation: bounce 2s infinite;
}

.pokeball::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--text-color);
    border-radius: 50%;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Difficulty Page Styles */
.difficulty-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.difficulty-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 3px solid transparent;
    cursor: pointer;
}

.difficulty-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.difficulty-card.easy {
    border-color: var(--success-color);
}

.difficulty-card.medium {
    border-color: var(--accent-color);
}

.difficulty-card.hard {
    border-color: var(--danger-color);
}

.difficulty-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.difficulty-info {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.difficulty-stats {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.back-btn {
    background: #6C757D;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
}

.back-btn:hover {
    background: #5A6268;
    transform: translateY(-1px);
}

/* Game Page Styles */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    min-height: 100vh;
}

.game-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.energy-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
}

.energy-count {
    background: var(--accent-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 1.1rem;
}

.pokemon-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.pokemon-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 1rem;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.pokemon-image img {
    width: 200px;
    height: 200px;
    max-width: 280px;
    max-height: 280px;
}

.pokemon-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-transform: capitalize;
    margin-bottom: 1rem;
}

.ability-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.ability-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    min-width: 100px;
}

.ability-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.ability-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.stats-sidebar {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.stats-table th,
.stats-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #f1f3f4;
}

.stats-table th {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
}

.stats-table td {
    cursor: pointer;
    transition: var(--transition);
    background: #f8f9fa;
}

.stats-table td:hover:not(.filled) {
    background: #e9ecef;
}

.stats-table td.filled {
    background: var(--success-color);
    color: white;
    cursor: not-allowed;
}

.stats-table .total-row {
    font-weight: bold;
    background: var(--accent-color) !important;
    color: var(--text-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.modal-title.victory {
    color: var(--success-color);
}

.modal-title.defeat {
    color: var(--danger-color);
}

.modal-score {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.modal-buttons .btn {
    min-width: 150px;
    flex: 1;
    max-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Settings Page */
.settings-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

.settings-list {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.setting-item {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
    min-width: 200px;
}

.setting-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.setting-info p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: var(--transition);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .stats-sidebar {
        order: -1;
        position: static;
    }
    
    .game-title h1 {
        font-size: 2.5rem;
    }
    
    .menu-buttons {
        width: 100%;
        max-width: 300px;
    }
    
    .difficulty-grid {
        grid-template-columns: 1fr;
    }
    
    .ability-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-buttons .btn {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        width: calc(100% - 2rem);
        max-width: 400px;
    }
    
    .pokemon-image {
        width: 240px;
        height: 240px;
    }
    
    .pokemon-image img {
        max-width: 180px;
        max-height: 180px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .switch {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .home-container {
        padding: 1rem;
    }
    
    .game-title h1 {
        font-size: 2rem;
    }
    
    .pokemon-decoration {
        display: none;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .pokemon-image {
        width: 200px;
        height: 200px;
    }
    
    .pokemon-image img {
        max-width: 150px;
        max-height: 150px;
    }
    
    .modal-content {
        padding: 1rem;
        margin: 0.5rem;
        width: calc(100% - 1rem);
        max-width: 350px;
    }
    
    .modal-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .modal-buttons .btn {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        justify-content: center;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .ability-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .setting-item {
        padding: 1rem;
    }
    
    .settings-container {
        padding: 1rem;
    }
    
    .difficulty-container {
        padding: 1rem;
    }
    
    .difficulty-card {
        padding: 1.5rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Roulette Animation */
.pokemon-image.spinning {
    animation: rouletteSpin 2s ease-out;
}

@keyframes rouletteSpin {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(1080deg);
    }
}
