/* Syrian Memory Game Styles */

/* Define CSS variables for the color palette */
:root {
    --color-forest: #428f77;
    --color-golden-wheat: #edebe0;
    --color-deep-maroon: #6b1f2a;
    --color-charcoal: #3d3a3b;
    --color-white: #ffffff;
}

/* Base styles */
body {
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: var(--color-charcoal);
    color: var(--color-golden-wheat);
    overflow: hidden;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

/* Orientation message for portrait mode */
.orientation-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    color: var(--color-white);
    font-size: 2em;
    font-weight: 700;
    text-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

@media (orientation: portrait) {
    body > *:not(.orientation-message) {
        display: none;
    }
    .orientation-message {
        display: flex;
    }
}

/* Game container */
.game-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background-color: var(--color-forest);
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    max-width: 80%;
    width: 700px;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}

/* Game header */
.game-header {
    width: 100%;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.game-title {
    font-size: 2.8em;
    font-weight: 700;
    color: var(--color-golden-wheat);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    flex-grow: 1;
    text-align: center;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 20px;
    width: 100%;
}

/* Difficulty selector */
.difficulty-selector-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.difficulty-selector-group label {
    font-size: 1.1em;
    color: var(--color-golden-wheat);
}

.difficulty-selector-group select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid var(--color-golden-wheat);
    background-color: var(--color-forest);
    color: var(--color-white);
    font-size: 1em;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23edebe0%22%20d%3D%22M287%2C197.3L159.2%2C69.5c-3.7-3.7-9.8-3.7-13.5%2C0L5.4%2C197.3c-3.7%2C3.7-3.7%2C9.8%2C0%2C13.5l13.5%2C13.5c3.7%2C3.7-9.8%2C3.7-13.5%2C0l113.8-113.8L259.9%2C224.3c3.7%2C3.7%2C9.8%2C3.7%2C13.5%2C0l13.5-13.5C290.7%2C207.1%2C290.7%2C201%2C287%2C197.3z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 8px top 50%;
    background-size: 12px auto;
    min-width: 120px;
}

/* Card grid */
.card-grid {
    display: grid;
    gap: 10px;
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    justify-content: center;
}

/* Card styles */
.card {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: var(--color-deep-maroon);
}

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

.card.matched {
    pointer-events: none;
}

.card.matched .card-face {
    background-color: #a0a0a0;
    color: var(--color-white);
    border-color: #808080;
    transition: background-color 0.6s, border-color 0.6s;
}

.card-face, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    font-size: 2.5em;
    font-weight: 700;
    color: var(--color-charcoal);
    border: 2px solid var(--color-golden-wheat);
    box-sizing: border-box;
    overflow: hidden;
}

.card-face {
    background-color: var(--color-golden-wheat);
    transform: rotateY(180deg);
}

.card-face .card-content {
    color: var(--color-charcoal);
}

.card-back {
    background-color: var(--color-deep-maroon);
}

/* Control buttons */
.game-actions {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.control-button {
    background-color: var(--color-golden-wheat);
    color: var(--color-forest);
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    flex-grow: 1;
    max-width: 200px;
}

.control-button:hover {
    background-color: #f0e7d0;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.control-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Message box */
.message-box {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--color-white);
    font-size: 2em;
    font-weight: 700;
    text-align: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    z-index: 10;
}

.message-box.active {
    display: flex;
}

.message-box h2 {
    margin-bottom: 20px;
    color: var(--color-golden-wheat);
}

.message-box .message-subtitle {
    font-size: 0.7em;
    margin-top: -10px;
    margin-bottom: 20px;
    color: var(--color-white);
}

.message-box .restart-button {
    background-color: var(--color-deep-maroon);
    color: var(--color-white);
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.message-box .restart-button:hover {
    background-color: #8a2f3d;
    transform: translateY(-2px);
}

/* Music Player Modal */
.music-modal {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    bottom: 180px;
    right: 20px;
    width: 450px;
    height: 180px;
    background-color: var(--color-forest);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 90;
    transform: translateX(calc(100% + 20px));
    transition: transform 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s ease-out;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.music-modal.active {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.music-modal-content {
    text-align: center;
    position: relative;
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.music-modal-content h3 {
    color: var(--color-golden-wheat);
    font-size: 1.4em;
    margin-bottom: 5px;
}

.music-modal-close {
    color: var(--color-golden-wheat);
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.music-modal-close:hover,
.music-modal-close:focus {
    color: var(--color-white);
    text-decoration: none;
    cursor: pointer;
}

.music-controls-group {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    justify-content: center;
}

.music-controls-group label {
    font-size: 0.9em;
    color: var(--color-golden-wheat);
    white-space: nowrap;
}

.music-modal-content select {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--color-golden-wheat);
    background-color: var(--color-charcoal);
    color: var(--color-white);
    font-size: 0.9em;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23edebe0%22%20d%3D%22M287%2C197.3L159.2%2C69.5c-3.7-3.7-9.8-3.7-13.5%2C0L5.4%2C197.3c-3.7%2C3.7-3.7%2C9.8%2C0%2C13.5l13.5%2C13.5c3.7%2C3.7-9.8%2C3.7-13.5%2C0l113.8-113.8L259.9%2C224.3c3.7%2C3.7%2C9.8%2C3.7%2C13.5%2C0l13.5-13.5C290.7%2C207.1%2C290.7%2C201%2C287%2C197.3z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 6px top 50%;
    background-size: 10px auto;
    flex-grow: 1;
    max-width: 150px;
}

.music-modal-content .player-buttons {
    display: flex;
    justify-content: space-around;
    gap: 5px;
    width: 100%;
}

.music-modal-content .player-buttons button {
    background-color: var(--color-deep-maroon);
    color: var(--color-white);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-grow: 1;
}

.music-modal-content .player-buttons button:hover {
    background-color: #8a2f3d;
    transform: translateY(-1px);
}

.music-modal-content .seek-slider-container,
.music-modal-content .volume-slider-container {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.music-modal-content .seek-slider-container span,
.music-modal-content .volume-slider-container span {
    font-size: 0.9em;
    color: var(--color-golden-wheat);
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.music-modal-content input[type="range"] {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    outline: none;
}

.music-modal-content input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-golden-wheat);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.music-modal-content input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-golden-wheat);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* About Modal */
.about-modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.about-modal-content {
    background-color: var(--color-forest);
    margin: auto;
    padding: 30px;
    border: 1px solid var(--color-golden-wheat);
    border-radius: 15px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    text-align: center;
    position: relative;
    color: var(--color-white);
}

.about-modal-content h3 {
    color: var(--color-golden-wheat);
    font-size: 1.8em;
    margin-bottom: 15px;
}

.about-modal-content p {
    font-size: 1.1em;
    line-height: 1.5;
    margin-bottom: 15px;
}

.about-modal-content .eagle-svg-icon {
    width: 100px;
    height: 100px;
    fill: var(--color-golden-wheat);
    margin-bottom: 20px;
}

.about-modal-close {
    color: var(--color-golden-wheat);
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.about-modal-close:hover,
.about-modal-close:focus {
    color: var(--color-white);
    text-decoration: none;
    cursor: pointer;
}

/* Fixed buttons */
.fixed-bottom-right-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-deep-maroon);
    color: var(--color-golden-wheat);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s, transform 0.2s;
    z-index: 50;
}

.fixed-bottom-right-button:hover {
    background-color: #8a2f3d;
    transform: scale(1.1);
}

/* Fact display */
.fact-display {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: var(--color-white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    font-size: 1.2em;
    text-align: center;
    z-index: 200;
    max-width: 80%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.fact-display.active {
    display: block;
    opacity: 1;
}

/* Footer */
.footer {
    margin-top: 20px;
    padding: 15px;
    color: var(--color-golden-wheat);
    font-size: 0.9em;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 700px;
    box-sizing: border-box;
}

.footer p {
    margin: 5px 0;
    line-height: 1.4;
}

.footer a {
    color: var(--color-golden-wheat);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--color-white);
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        width: 100%;
    }
    
    .game-title {
        font-size: 2.2em;
    }
    
    .game-stats {
        font-size: 1.1em;
        gap: 15px;
    }
    
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        max-width: 400px;
    }
    
    .card {
        width: 70px;
        height: 70px;
    }
    
    .card-face {
        font-size: 2em;
    }
    
    .game-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-button {
        padding: 12px 25px;
        font-size: 1.1em;
        max-width: 100%;
    }
    
    .music-modal {
        width: 280px;
        height: 140px;
        padding: 10px;
        bottom: 15px;
    }
    
    .music-modal-content h3 {
        font-size: 1.3em;
    }
    
    .music-controls-group {
        flex-direction: column;
    }
    
    .music-modal-content .player-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .music-modal-content button {
        padding: 8px;
        font-size: 0.9em;
        flex-basis: 45%;
    }
    
    .music-modal-content select {
        max-width: 100%;
    }
    
    .footer {
        padding: 10px;
        font-size: 0.8em;
    }
    
    .fixed-bottom-right-button {
        width: 45px;
        height: 45px;
        font-size: 1.5em;
        bottom: 15px;
        right: 15px;
    }
    
    .fact-display {
        font-size: 1em;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 1.8em;
    }
    
    .game-stats {
        font-size: 0.9em;
        gap: 10px;
    }
    
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        max-width: 300px;
    }
    
    .card {
        width: 60px;
        height: 60px;
    }
    
    .card-face {
        font-size: 1.8em;
    }
    
    .control-button {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    .music-modal {
        width: 200px;
        height: 120px;
        padding: 8px;
    }
    
    .music-modal-content h3 {
        font-size: 1.2em;
    }
    
    .music-modal-content button {
        padding: 6px;
        font-size: 0.8em;
    }
    
    .music-modal-close {
        font-size: 20px;
        top: 5px;
        right: 5px;
    }
    
    .footer {
        padding: 8px;
        font-size: 0.7em;
    }
    
    .fixed-bottom-right-button {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
        bottom: 10px;
        right: 10px;
    }
    
    .fact-display {
        font-size: 0.9em;
        padding: 10px;
    }
}
