/* Game specific styles for Color Match */

:root {
    --primary-color: #FF9800;
    --primary-hover: #F57C00;
    --text-main: #333;

    --board-size: 320px;
}

@media (min-width: 600px) {
    :root {
        --board-size: 450px;
    }
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 0;
}

.game-container h1 {
    margin-bottom: 1.5rem;
    color: #333;
}

.game-description {
    margin-bottom: 2rem;
    color: #555;
    font-size: 1.1rem;
}

/* Polished Game Wrapper */
.game-area-wrapper {
    position: relative;
    padding: 30px;
    background: #FAFAFA;
    /* Light Grey Clean Background */
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: inline-block;
    border: 1px solid #eee;
}

.game-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #455A64;
    width: 100%;
    max-width: var(--board-size);
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.game-board {
    width: var(--board-size);
    height: var(--board-size);
    background: #fff;
    margin: 0 auto;
    border-radius: 16px;
    display: grid;
    /* Changed from flex to grid */
    padding: 10px;
    box-sizing: border-box;
    gap: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #eee;
    /* grid-template-columns set by JS */
}

.tile {
    /* Width is set by JS */
    background-color: #ddd;
    border-radius: 12px;
    /* Soft round */
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s;
}

.tile:hover {
    filter: brightness(1.03);
    transform: scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tile:active {
    transform: scale(0.92);
}

/* Overlays */
.start-overlay,
.result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    z-index: 10;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.start-hint {
    margin-top: 20px;
    color: #607D8B;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

/* Result */
.final-score {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 10px 0;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.rank-msg {
    font-size: 1.4rem;
    font-weight: bold;
    color: #455A64;
    margin-bottom: 30px;
}

/* Share */
.share-area {
    margin-top: 20px;
}

.share-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    color: #fff;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.twitter {
    background-color: #000;
    /* X black */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Primary Btn */
.primary-btn {
    background-color: var(--primary-color);
    color: white;
    font-size: 1.4rem;
    font-weight: 800;
    padding: 1.2rem 3.5rem;
    border-radius: 60px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(255, 152, 0, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 1px;
}

.primary-btn:hover {
    background-color: #F57C00;
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(255, 152, 0, 0.4);
}

.primary-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 5px rgba(255, 152, 0, 0.3);
}

/* Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(255, 152, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Instructions */
.instructions {
    background: #FAFAFA;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: left;
    margin: 3rem auto 5rem;
    color: #444;
    line-height: 1.8;
}

.instructions h3 {
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
}

.rank-list-display {
    list-style: none;
    padding: 0;
    margin: 1rem 0 2rem;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}

.rank-list-display li {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

.rank-list-display li:last-child {
    border-bottom: none;
}

.rank-list-display strong {
    color: var(--primary-color);
    display: inline-block;
    width: 80px;
}