/* Game specific styles for Sevens */

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

    --card-width: 32px;
    --card-height: 48px;
    --gap: 2px;
}

@media (min-width: 600px) {
    :root {
        --card-width: 48px;
        --card-height: 68px;
        --gap: 4px;
    }
}

.game-container {
    max-width: 900px;
    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;
}

/* Table Style Wrapper */
.game-area-wrapper {
    position: relative;
    padding: 20px;
    background-color: #2E7D32;
    background-image: radial-gradient(circle at center, #388E3C 0%, #1B5E20 100%);
    border: 12px solid #3E2723;
    border-radius: 40px;
    margin-bottom: 2rem;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5), 0 20px 40px rgba(0, 0, 0, 0.2);
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50px;
    color: #fff;
    font-weight: bold;
    backdrop-filter: blur(4px);
}

.turn-indicator {
    font-size: 1.2rem;
    color: #FFD54F;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.pass-info {
    font-size: 1rem;
    color: #e0e0e0;
}

/* Opponents */
.opponents-area {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.opponent {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    transition: transform 0.3s;
}

.opponent.active {
    transform: scale(1.1);
    color: #fff;
}

.avatar {
    width: 50px;
    height: 50px;
    background: #546E7A;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #fff;
    font-weight: bold;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.opponent.active .avatar {
    background: #FF9800;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.8);
}

/* Field Grid */
.field-grid {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    margin: 0 auto;
    width: fit-content;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.field-row {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: var(--gap);
    min-width: calc(13 * (var(--card-width) + var(--gap)));
}

/* Player Hand */
.player-hand-wrapper {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 16px;
    margin-top: auto;
    /* Push to bottom */
    margin-left: auto;
    margin-right: auto;
    backdrop-filter: blur(2px);
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.player-hand {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    min-height: var(--card-height);
}

/* Cards */
.card {
    width: var(--card-width);
    height: var(--card-height);
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 11px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    font-family: 'Arial', sans-serif;
}

@media (min-width: 600px) {
    .card {
        font-size: 16px;
        border-radius: 6px;
    }
}

.card.red {
    color: #E53935;
}

.card.black {
    color: #333;
}

.card.placeholder {
    background: rgba(255, 255, 255, 0.05);
    /* Ghost card */
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.player-hand .card {
    cursor: pointer;
    margin-top: 0;
}

.player-hand .card:hover {
    z-index: 10;
    transform: translateY(-8px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.player-hand .card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.8) brightness(0.8);
}

.player-hand .card.playable {
    box-shadow: 0 0 8px #FFD54F;
    /* Glow */
    border: 2px solid #FFD54F;
    transform: translateY(-4px);
    /* Slight lift hint */
}

.player-hand .card.playable:hover {
    transform: translateY(-12px);
    border-color: #FFC107;
}

/* Controls */
.controls-area {
    margin-top: 15px;
}

.secondary-btn {
    background-color: #78909C;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}

.secondary-btn:hover {
    background-color: #607D8B;
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 25px;
    /* Match inner radius roughly */
    backdrop-filter: blur(5px);
}

.hidden {
    display: none;
}

.ranking-list {
    margin-bottom: 20px;
    text-align: left;
    width: 80%;
    max-width: 300px;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.rank-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
    color: #333;
    font-weight: bold;
}

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

/* Primary Btn */
.primary-btn {
    background-color: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 1rem 3rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(255, 152, 0, 0.4);
    letter-spacing: 1px;
}

.primary-btn:hover {
    background: #F57C00;
}

/* Instructions */
.instructions {
    background: #FAFAFA;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px 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;
}