.game-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    margin-bottom: 40px;
}

.game-title {
    text-align: center;
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.game-subtitle {
    text-align: center;
    font-size: 1.2em;
    color: #34495e;
    margin-bottom: 40px;
    line-height: 1.6;
}

.game-card {
    background: linear-gradient(145deg, #fff, #f1f3f4);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.game-content {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 30px;
    align-items: stretch;
}

.game-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 25px;
}

/* Silhouette image */
.game-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(255, 107, 107, 0.15), rgba(78, 205, 196, 0.1) 60%, transparent 80%);
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    min-height: 280px;
}

.game-silhouette-image {
    width: 100%;
    max-width: 240px;
    height: auto;
    filter: brightness(0);
    transition: filter 0.5s ease, transform 0.3s ease;
    /* Stay invisible until the bytes are in — otherwise browsers flash a
       broken-image icon while the src is empty/loading between rounds. */
    visibility: hidden;
}

.game-silhouette-image.loaded {
    visibility: visible;
}

.game-silhouette-image.revealed {
    filter: none;
}

.game-silhouette-image.revealed:hover {
    transform: scale(1.05);
}

/* Attacks game image — same wrapper layout as the silhouette, but the
   Pokémon is visible from the start (no silhouette filter). */
.game-attacks-image {
    width: 100%;
    max-width: 240px;
    height: auto;
    visibility: hidden;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.18));
    transition: transform 0.3s ease;
}

.game-attacks-image.loaded {
    visibility: visible;
}

.game-attacks-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
    text-transform: capitalize;
    margin: 0;
    text-align: center;
    word-break: break-word;
}

/* Moves game — list of four move chips above the options */
.game-moves-list {
    width: 100%;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.game-move-chip {
    background: linear-gradient(145deg, #4ecdc4, #45b7d1);
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 1em;
    text-align: center;
    text-transform: capitalize;
    box-shadow: 0 4px 10px rgba(78, 205, 196, 0.35);
    letter-spacing: 0.3px;
    word-break: break-word;
    line-height: 1.25;
}

.game-move-chip.placeholder {
    background: #ecf0f1;
    color: transparent;
    box-shadow: none;
    animation: gamePulse 1.4s ease-in-out infinite;
}

/* Loader */
.game-image-loader {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 107, 107, 0.2);
    border-top-color: #ff6b6b;
    border-radius: 50%;
    animation: gameSpin 0.9s linear infinite;
}

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

/* Traits display */
.game-traits-display {
    width: 100%;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.game-traits-types {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 22px;
    min-height: 36px;
}

.game-trait-type {
    padding: 6px 16px;
    border-radius: 20px;
    color: #fff;
    font-weight: bold;
    font-size: 0.95em;
    text-transform: capitalize;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.5px;
}

.game-trait-type.placeholder {
    background: #ecf0f1;
    color: #95a5a6;
    box-shadow: none;
}

.game-traits-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 22px;
}

.game-trait-item {
    background: linear-gradient(145deg, #fff, #f1f3f4);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.game-trait-item-wide {
    grid-column: 1 / -1;
}

.game-trait-label {
    display: block;
    font-size: 0.85em;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.game-trait-value {
    display: block;
    font-size: 1.15em;
    color: #2c3e50;
    font-weight: bold;
}

.game-trait-stats {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.game-trait-stat {
    display: grid;
    grid-template-columns: 130px 40px 1fr;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
}

.game-trait-stat-name {
    color: #34495e;
    font-weight: 600;
}

.game-trait-stat-value {
    color: #2c3e50;
    font-weight: bold;
    text-align: right;
}

.game-trait-stat-bar {
    display: block;
    background: #ecf0f1;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.game-trait-stat-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #45b7d1);
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Reveal image (game 2) — sits between the options and the score box. The
   wrapper holds its size whether or not an image is loaded so the layout
   never jumps. */
.game-reveal-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(78, 205, 196, 0.15), rgba(69, 183, 209, 0.08) 60%, transparent 80%);
    border-radius: 20px;
    padding: 15px;
    width: 100%;
    height: 210px;
}

.game-reveal-placeholder {
    font-size: 5em;
    font-weight: bold;
    color: rgba(149, 165, 166, 0.45);
    line-height: 1;
    user-select: none;
    transition: opacity 0.3s ease;
}

.game-reveal-wrapper.has-image .game-reveal-placeholder {
    opacity: 0;
}

.game-reveal-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 180px;
    max-height: 180px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.25));
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-reveal-image.loaded {
    visibility: visible;
    opacity: 1;
}

/* Options */
.game-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.game-option-button {
    appearance: none;
    border: 2px solid transparent;
    background: linear-gradient(145deg, #ffffff, #f1f3f4);
    border-radius: 14px;
    padding: 16px 18px;
    font-size: 1.05em;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    text-transform: capitalize;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    line-height: 1.2;
    min-height: 56px;
}

.game-option-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    border-color: #4ecdc4;
}

.game-option-button:disabled {
    cursor: default;
    opacity: 0.85;
}

.game-option-button.correct {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    color: #fff;
    border-color: #1e8449;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
    opacity: 1;
}

.game-option-button.wrong {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: #fff;
    border-color: #922b21;
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
    opacity: 1;
}

.game-option-button.placeholder {
    background: #ecf0f1;
    box-shadow: none;
    color: transparent;
    pointer-events: none;
    animation: gamePulse 1.4s ease-in-out infinite;
}

@keyframes gamePulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

/* Feedback text */
.game-feedback {
    min-height: 1.4em;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    color: #34495e;
    margin: 0;
}

.game-feedback.correct {
    color: #27ae60;
}

.game-feedback.wrong {
    color: #c0392b;
}

/* Next round button */
.game-next-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    background: linear-gradient(145deg, #ff6b6b, #ff5252);
    border: 2px solid transparent;
    border-radius: 50px;
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
}

.game-next-button:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.6);
    background: linear-gradient(145deg, #ff5252, #ff6b6b);
}

.game-next-icon {
    font-size: 1.2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Score */
.game-score {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.game-score-item {
    background: linear-gradient(145deg, #ffffff, #f1f3f4);
    border-radius: 15px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.game-score-item-wide {
    grid-column: 1 / -1;
}

.game-score-label {
    display: block;
    font-size: 0.85em;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.game-score-value {
    display: block;
    font-size: 1.6em;
    font-weight: bold;
    color: #ff6b6b;
}

/* Pokémon type colours — re-use the daily-pokemon palette so the badges look the same */
.game-trait-type.type-normal   { background: #A8A878; }
.game-trait-type.type-fire     { background: #F08030; }
.game-trait-type.type-water    { background: #6890F0; }
.game-trait-type.type-electric { background: #F8D030; color: #3a2f00; }
.game-trait-type.type-grass    { background: #78C850; }
.game-trait-type.type-ice      { background: #98D8D8; color: #1f3a3a; }
.game-trait-type.type-fighting { background: #C03028; }
.game-trait-type.type-poison   { background: #A040A0; }
.game-trait-type.type-ground   { background: #E0C068; color: #3a2f00; }
.game-trait-type.type-flying   { background: #A890F0; }
.game-trait-type.type-psychic  { background: #F85888; }
.game-trait-type.type-bug      { background: #A8B820; }
.game-trait-type.type-rock     { background: #B8A038; }
.game-trait-type.type-ghost    { background: #705898; }
.game-trait-type.type-dragon   { background: #7038F8; }
.game-trait-type.type-dark     { background: #705848; }
.game-trait-type.type-steel    { background: #B8B8D0; color: #1f1f3a; }
.game-trait-type.type-fairy    { background: #EE99AC; }

/* Versus layout (battle / which-is-X-er) */
.game-versus {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 24px;
}

.game-versus-card {
    background: linear-gradient(145deg, #ffffff, #f1f3f4);
    border-radius: 18px;
    padding: 20px;
    cursor: pointer;
    border: 3px solid transparent;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    outline: none;
}

.game-versus-card:hover:not(.disabled),
.game-versus-card:focus-visible:not(.disabled) {
    transform: translateY(-3px);
    border-color: #4ecdc4;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15);
}

.game-versus-card.disabled {
    cursor: default;
}

.game-versus-card.winner {
    border-color: #2ecc71;
    background: linear-gradient(145deg, rgba(46, 204, 113, 0.18), rgba(255, 255, 255, 0.95));
    box-shadow: 0 14px 30px rgba(46, 204, 113, 0.25);
}

.game-versus-card.loser {
    border-color: #e74c3c;
    background: linear-gradient(145deg, rgba(231, 76, 60, 0.12), rgba(255, 255, 255, 0.95));
    opacity: 0.85;
}

.game-versus-card.tie {
    border-color: #f9ca24;
    background: linear-gradient(145deg, rgba(249, 202, 36, 0.18), rgba(255, 255, 255, 0.95));
}

.game-versus-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(255, 107, 107, 0.12), rgba(78, 205, 196, 0.08) 60%, transparent 80%);
    border-radius: 14px;
    margin-bottom: 14px;
}

.game-versus-image {
    width: 100%;
    max-width: 200px;
    max-height: 200px;
    height: auto;
    visibility: hidden;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.18));
    transition: transform 0.3s ease;
}

.game-versus-image.loaded {
    visibility: visible;
}

.game-versus-card.winner .game-versus-image {
    transform: scale(1.04);
}

.game-versus-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
    text-transform: capitalize;
    word-break: break-word;
}

.game-versus-divider {
    align-self: center;
    font-size: 2em;
    font-weight: 900;
    color: #ff6b6b;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    letter-spacing: 1px;
}

/* Battle: stats list shown after answering */
.game-versus-stats {
    list-style: none;
    width: 100%;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 4px;
    font-size: 0.92em;
}

.game-versus-stat {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.game-versus-stat-label {
    color: #34495e;
    font-weight: 600;
}

.game-versus-stat-value {
    color: #2c3e50;
    font-weight: bold;
}

.game-versus-stat.total {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    color: #fff;
    margin-bottom: 4px;
}

.game-versus-stat.total .game-versus-stat-label,
.game-versus-stat.total .game-versus-stat-value {
    color: #fff;
}

.game-versus-stat.higher .game-versus-stat-value {
    color: #27ae60;
}

.game-versus-stat.total.higher {
    background: linear-gradient(145deg, #27ae60, #1e8449);
}

.game-versus-types-row {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 4px 0;
    background: transparent;
    box-shadow: none;
}

.game-versus-stat.advantage {
    background: rgba(46, 204, 113, 0.18);
}

.game-versus-stat.advantage .game-versus-stat-value {
    color: #1e8449;
}

.game-versus-stat.disadvantage {
    background: rgba(231, 76, 60, 0.15);
}

.game-versus-stat.disadvantage .game-versus-stat-value {
    color: #922b21;
}

.game-versus-stat.immune {
    background: rgba(127, 140, 141, 0.18);
}

.game-versus-stat.immune .game-versus-stat-value {
    color: #4a4a4a;
}

/* Type-vs-type matchup row uses the same colour rules above. The only
   tweak is making the value pill a touch tighter so 2 rows fit comfortably. */
.game-versus-stat.matchup .game-versus-stat-value {
    font-variant-numeric: tabular-nums;
}

/* The "összesen" row keeps a slightly stronger emphasis. */
.game-versus-stat.effectiveness {
    font-weight: 600;
}

/* Which-game prompt + per-card value */
.game-which-prompt {
    text-align: center;
    font-size: 1.6em;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 24px;
}

.game-which-prompt .game-which-metric {
    color: #ff6b6b;
}

.game-which-value {
    margin: 10px 0 0;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 1.05em;
    font-weight: bold;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 0 0 1px rgba(44, 62, 80, 0.08);
    /* Always reserve space — the pill becomes visible only after the user
       answers, but its box has to be in the layout from the start so the
       cards don't grow on reveal. */
    visibility: hidden;
}

.game-which-value.revealed {
    visibility: visible;
}

.game-versus-card.winner .game-which-value {
    background: rgba(46, 204, 113, 0.18);
    color: #1e8449;
}

.game-versus-card.loser .game-which-value {
    background: rgba(231, 76, 60, 0.15);
    color: #922b21;
}

/* Footer row holds Új kör + score side-by-side under the versus area */
.game-card-footer {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: center;
    margin-top: 8px;
}

.game-card-footer .game-score {
    grid-template-columns: repeat(3, 1fr);
}

.game-card-footer .game-next-button {
    margin: 0;
}

@media (max-width: 900px) {
    .game-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .game-versus {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .game-versus-divider {
        justify-self: center;
    }

    .game-card-footer {
        grid-template-columns: 1fr;
        gap: 16px;
        justify-items: center;
    }

    .game-card-footer .game-score {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .game-section {
        padding: 28px 20px;
    }

    .game-title {
        font-size: 2em;
    }

    .game-subtitle {
        font-size: 1.05em;
        margin-bottom: 28px;
    }

    .game-card {
        padding: 20px;
    }

    .game-image-wrapper {
        min-height: 220px;
    }

    .game-silhouette-image,
    .game-attacks-image {
        max-width: 180px;
    }

    .game-moves-list {
        padding: 18px;
        gap: 10px;
    }

    .game-move-chip {
        font-size: 0.95em;
        padding: 12px 12px;
    }

    .game-trait-stat {
        grid-template-columns: 100px 35px 1fr;
        font-size: 0.9em;
    }

    .game-option-button {
        font-size: 1em;
        padding: 14px 12px;
        min-height: 52px;
    }

    .game-score-value {
        font-size: 1.4em;
    }
}
