/* PPL Energy Savings Game CSS */

:root {
    --ppl-orange: #BA4A00;
    --ppl-light-orange: #F0851C;
    --ppl-cream: #FCD1AC;
    --ppl-white: #FFFFFF;
    --ppl-blue: #00557F;
    --ppl-dark-blue: #0071A8;
    --ppl-yellow: #FFB81C;
    --card-width: 182px;
    --card-height: 226px;
    --card-border-radius: 0px;
    --flip-duration: 0.3s;
    --match-animation-duration: 0.8s;
    --card-border-radius: 12px;
}

body {
    background: var(--ppl-orange);
    min-height: 100vh;
    font-family: 'Raleway', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--ppl-blue);
    color: var(--ppl-white);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    font-family: 'Raleway', sans-serif;
    font-weight: 500;
}

.skip-link:focus {
    top: 6px;
}

.container-fluid {
    padding: 0;
    max-width: 1440px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Game Board - First and centered */
.game-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(6, var(--card-width));
    gap: 20px;
    margin: 0 auto;
}

/* Score Section - Second */
.score-section {
    text-align: left;
    margin-bottom: 1rem;
    padding: 0;
    width: calc(6 * var(--card-width) + 5 * 20px);
    margin-left: auto;
    margin-right: auto;
}

.score-container {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.score-badge {
    background: var(--ppl-light-orange);
    color: var(--ppl-white);
    padding: 10px 20px;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-label {
    font-family: 'Raleway', sans-serif;
    font-weight: 500;
    font-size: 24px;
    line-height: 1.174;
}

.score-value {
   font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 24px;
}

/* Text Section - Third */
.text-section {
    text-align: left;
    margin-bottom: 2rem;
    padding: 0;
    width: calc(6 * var(--card-width) + 5 * 20px);
    margin-left: auto;
    margin-right: auto;
}

.main-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 1.174;
    color: var(--ppl-cream);
    margin-bottom: 1rem;
    max-width: 899px;
}

.subtitle {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.174;
    color: var(--ppl-cream);
    margin-bottom: 1rem;
    max-width: 899px;
}



/* Tip Styles */
.tip-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.174;
    color: var(--ppl-cream);
    margin-bottom: 1rem;
    max-width: 899px;
}

.tip-description {
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.174;
    color: var(--ppl-cream);
    margin-bottom: 2rem;
    max-width: 899px;
}

/* PPL Logo Footer - Bottom right */
.ppl-footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.logo-img {
    height: 107px;
    width: auto;
}

/* Card Styles */
.card {
    width: var(--card-width);
    height: var(--card-height);
    perspective: 1000px;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
    background: var(--ppl-orange);
    border: none;

}

.card:hover {
    transform: translateY(-5px);
}

.card:focus {
    outline: 3px solid var(--ppl-yellow);
    outline-offset: 2px;
    transform: translateY(-5px);
}

.card:focus:not(:focus-visible) {
    outline: none;
    transform: none;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform var(--flip-duration);
    transform-style: preserve-3d;
    border-radius: var(--card-border-radius);
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card.matched .card-inner {
    animation: matchPulse var(--match-animation-duration) ease-in-out;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--card-border-radius);
    border: 2px solid var(--ppl-orange);
    box-shadow: 0 0 0 2px var(--ppl-light-orange);
    transition: box-shadow 0.3s ease;
}

.card:hover .card-front,
.card:hover .card-back {
    box-shadow: 0 0 0 2px var(--ppl-light-orange), 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-front {
    background: var(--ppl-cream);
    transform: rotateY(180deg);
    padding: 5.22px 5.35px;
    border: 2px solid var(--ppl-orange);
    border-radius: var(--card-border-radius);
}

.card-back {
    background: var(--ppl-light-orange);
    transform: rotateY(0deg);
    background-image: url('images/card-back-update.jpg');
    background-size: cover;
    background-position: center;
    border: 2px solid var(--ppl-orange);
    border-radius: var(--card-border-radius);
}

/* Card Icons */
.card-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Card Overlays */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0.75;
    pointer-events: none;
}

.overlay-icon {
    width: 120px;
    height: 120px;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.check-overlay .overlay-icon {
    filter: drop-shadow(0 0 10px rgba(0, 166, 81, 0.5));
}

.cross-overlay .overlay-icon {
    filter: drop-shadow(0 0 10px rgba(193, 39, 45, 0.5));
}

/* Animations */
@keyframes matchPulse {
    0% {
        transform: rotateY(180deg) scale(1);
    }
    50% {
        transform: rotateY(180deg) scale(1.05);
    }
    100% {
        transform: rotateY(180deg) scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.card.wrong {
    animation: shake 0.3s ease-in-out;
}

/* Start Over Button */
.start-over-btn {
    background: var(--ppl-yellow);
    color: var(--ppl-blue);
    border: none;
    border-radius: 5px;
    padding: 9.04px 11.25px;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.174;
    width: 195px;
    height: 50px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.start-over-btn:hover {
    background: var(--ppl-yellow);
    color: var(--ppl-blue);
    opacity: 0.9;
}

.start-over-btn:focus {
    outline: 3px solid var(--ppl-blue);
    outline-offset: 2px;
}

.start-over-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Complete Button */
.complete-btn {
    background: var(--ppl-yellow);
    color: var(--ppl-blue);
    border: none;
    border-radius: 5px;
    padding: 9.04px 11.25px;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.174;
    width: 195px;
    height: 50px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    margin-top: 1rem;
}

.complete-btn:hover {
    background: var(--ppl-yellow);
    color: var(--ppl-blue);
    opacity: 0.9;
}

.complete-btn:focus {
    outline: 3px solid var(--ppl-blue);
    outline-offset: 2px;
}

.complete-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Responsive Design */

@media (max-width: 1199px) {
    .game-board {
        grid-template-columns: repeat(4, var(--card-width));
        gap: 15px;
        padding: 0 60px;
    }
    
    .score-section,
    .text-section {
        width: calc(4 * var(--card-width) + 3 * 15px);
        margin-left: auto;
        margin-right: auto;
    }
    
    .main-title {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 20px;
    }
    
    .overlay-icon {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 768px) {
    :root {
        --card-width: 130px;
        --card-height: 160px;
    }
    
    .game-board {
        grid-template-columns: repeat(4, var(--card-width));
        gap: 16px;
        padding: 0 20px;
    }
    
    .score-section,
    .text-section {
        width: calc(4 * var(--card-width) + 3 * 16px);
        margin-left: auto;
        margin-right: auto;
    }
    
    .main-title {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .score-label,
    .score-value {
        font-size: 24px;
    }
    
    .logo-img {
        height: 80px;
    }
    
    .overlay-icon {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 600px) {
    :root {
        --card-width: 100px;
        --card-height: 120px;
    }
    
    .game-board {
        grid-template-columns: repeat(3, var(--card-width));
        gap: 16px;
        padding: 0 10px;
    }
    
    .score-section,
    .text-section {
        width: calc(3 * var(--card-width) + 2 * 16px);
        margin-left: auto;
        margin-right: auto;
        padding: 0 10px;
    }
    
    .main-title {
        font-size: 18px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .score-label,
    .score-value {
        font-size: 18px;
    }
    
    .logo-img {
        height: 50px;
    }
    
    .overlay-icon {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    :root {
        --card-width: 100px;
        --card-height: 120px;
    }
    
    .game-board {
        grid-template-columns: repeat(3, var(--card-width));
        gap: 16px;
        padding: 0 8px;
    }
    
    .score-section,
    .text-section {
        width: calc(3 * var(--card-width) + 2 * 16px);
        margin-left: auto;
        margin-right: auto;
        padding: 0 8px;
    }
    
    .main-title {
        font-size: 16px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .score-label,
    .score-value {
        font-size: 16px;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .overlay-icon {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 360px) {
    :root {
        --card-width: 80px;
        --card-height: 105px;
    }
    
    .game-board {
        grid-template-columns: repeat(3, var(--card-width));
        gap: 16px;
        padding: 0 5px;
    }
    
    .score-section,
    .text-section {
        width: calc(3 * var(--card-width) + 2 * 16px);
        margin-left: auto;
        margin-right: auto;
        padding: 0 5px;
    }
    
    .main-title {
        font-size: 18px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .score-label,
    .score-value {
        font-size: 18px;
    }
    
    .logo-img {
        height: 50px;
    }
    
    .overlay-icon {
        width: 60px;
        height: 60px;
    }
}

/* Game State Indicators */
.game-started .card {
    pointer-events: auto;
}

.game-started .card:not(.flipped):not(.matched) {
    cursor: pointer;
}

.game-started .card.flipped,
.game-started .card.matched {
    cursor: default;
}

/* Disable pointer events when processing a turn */
.game-started.processing-turn .card:not(.flipped):not(.matched) {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.4;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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