/* CSS Variables for theme */
:root {
    /* Dark theme (default) */
    --bg-color: #0f172a;
    --card-bg-color: #1e293b;
    --border-color: #334155;
    --text-color: #e2e8f0;
    --text-color-dark: #94a3b8;
    --primary-color: #f97316;
    --primary-color-hover: #fb923c;
    --secondary-color: #3b82f6;
    --danger-color: #ef4444;
    --danger-color-hover: #f87171;
    --font-family: 'Inter', sans-serif;
    --color-easy: #5cc85f;
    --color-medium: #fd9530;
    --color-hard: #fe6277;
    --text-muted: #5c6b89;
    --border-radius: 0.5rem;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --spinner-track-color: rgba(255, 255, 255, 0.2);

    --matched-border-color: #2c3e5d;
    /* Banner Continuar Jogo */
    --banner-resume-bg: var(--card-bg-color);
    --banner-resume-border: var(--border-color);
    --banner-resume-icon-wrapper-bg: #2c3e50;
    --banner-resume-icon-color: var(--secondary-color);
    --banner-resume-btn-bg: var(--secondary-color);
    --banner-resume-btn-hover-bg: #60a5fa;
    --banner-resume-text-color: var(--text-color);
    --banner-resume-text-muted-color: var(--text-color-dark);
}

html[data-theme='light'] {
    --bg-color: #f1f5f9;
    --card-bg-color: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --text-color-dark: #64748b;
    --text-muted: #5c6b89;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --spinner-track-color: rgba(0, 0, 0, 0.1);
    --matched-border-color: #cbd5e1;

    /* Banner Continuar Jogo (Light) */
    --banner-resume-bg: #f7f9fd;
    --banner-resume-border: #eaf0f9;
    --banner-resume-icon-wrapper-bg: #e5f0ff;
    --banner-resume-icon-color: #2b71ff;
    --banner-resume-btn-bg: #2b71ff;
    --banner-resume-btn-hover-bg: #225ce6;
    --banner-resume-text-color: #142146;
    --banner-resume-text-muted-color: #6e7a91;
}

html[data-theme='light'] .title {
    color: #0f172a;
}

html[data-theme='light'] .title-icon {
    filter: none; /* O novo ícone tem cores próprias e não deve ser filtrado */
}

html[data-theme='light'] .coin-container .coin-info strong,
html[data-theme='light'] .info-card-value {
    color: #0f172a;
}

html[data-theme='light'] #coinCount,
html[data-theme='light'] #tokenCount {
    color: #0f172a;
}

html[data-theme='light'] .coin-display,
html[data-theme='light'] .token-display,
html[data-theme='light'] .title#difficultyDisplay {
    background-color: rgba(0, 0, 0, 0.05);
}

html[data-theme='light'] .progress-bar {
    background-color: #e2e8f0;
}

html[data-theme='light'] .progress-bar span {
    color: var(--text-color);
    text-shadow: none;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 80px;
}

.game-page-body {
    padding-top: 70px; /* Space for fixed header */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    position: relative;
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    z-index: 900;
    box-shadow: var(--shadow);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 70px; /* Match body padding-top */
}

.title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f8fafc;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.title-with-subtitle {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.header-subtitle {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-color-dark);
}

.title .title-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    font-weight: 800;
}

.title .title-text span {
    font-size: 1.4rem;
}

.title .title-word-1 {
    color: var(--text-color);
    margin-top: 3px;
}

.title .title-word-2 {
    color: var(--primary-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.title-icon {
    width: 45px;
    height: 45px;
    filter: none; /* Remove o filtro para exibir o novo SVG com suas cores originais */
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-color-dark);
    margin-top: 0.5rem;
}

.page-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin: 1rem auto 1.5rem;
    max-width: 90%;
}

.header-back-btn {
    position: static;
    transform: none;
    color: var(--text-color-dark);
    font-size: 1.5rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.header-back-btn:hover {
    color: var(--primary-color);
}

/* Coin Display */
.coin-display, .token-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
}
.coin-icon, .token-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}
#coinCount, #tokenCount {
    font-weight: 700;
    color: white;
}
.coin-particle {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}
.coin-particle .coin-icon {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 3px rgba(0,0,0,0.5));
}

/* Coin Container on Index Page */
.coin-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    margin: 0 auto 1.5rem;
    max-width: 618px;
    border: 1px solid #facc15;
    box-shadow: 0 0 25px rgba(250, 204, 21, 0.15);
}

.piggy-bank-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid #facc15;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Impede que o círculo encolha */
    animation: pulse-gold 2.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

.coin-container .fa-piggy-bank {
    font-size: 3rem;
    color: #facc15;
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.5));
}

.coin-container .coin-info {
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-color-dark);
    line-height: 1.4;
}

.coin-container .coin-info strong {
    color: #fde047; /* Lighter gold */
    font-weight: 600;
}

/* Stats Banner on Index Page */
.stats-banner {
    background-color: var(--banner-resume-bg);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.75rem 1.5rem;
    margin: 1.5rem auto 1.5rem auto;
    max-width: 618px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.09);
    border: 1px solid var(--banner-resume-border);
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex: 1;
}

.stat-details {
    text-align: left;
}

.stat-item i {
    font-size: 1.5rem;
    margin-bottom: 0;
}

/* Cores específicas para os ícones do banner de status */
.stat-item .fa-trophy {
    color: #facc15; /* Dourado para o recorde */
}
.stat-item .fa-calendar-days {
    color: var(--secondary-color); /* Azul para a sequência */
}
.stat-item .fa-gamepad {
    color: #9333ea; /* Roxo para as partidas */
}

.stat-item .stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--banner-resume-text-color);
    line-height: 1.1;
}

.stat-item .stat-label {
    font-size: 0.7rem;
    color: var(--banner-resume-text-muted-color);
}

.stat-divider {
    width: 1px;
    height: 40px;
    background-color: var(--banner-resume-border);
}

/* Banner Roleta */
.roulette-banner {
    border-color: #C03A2B;
    margin-bottom: 0.5rem; /* Espaço entre os banners */
}

.roulette-banner .buy-coins-banner__image {
    transform: rotate(15deg);
    transition: transform 0.3s ease-in-out;
}

/* Banner Comprar Moedas */
.buy-coins-banner {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 618px;
    margin: 0.5rem auto;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.buy-coins-banner__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.buy-coins-banner__image {
    width: 76px;
    height: 64px;
    flex-shrink: 0;
}

.buy-coins-banner__text {
    display: flex;
    flex-direction: column;
}

.buy-coins-banner__title {
    color: var(--text-color-dark);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.buy-coins-banner__balance {
    color: var(--text-color);
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    margin: 0;
    transition: all 0.2s ease-in-out;
}

.buy-coins-banner__button {
    background: linear-gradient(180deg, #FFDE59 0%, #FFB629 100%);
    border: none;
    border-radius: var(--border-radius);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 182, 41, 0.3);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.buy-coins-banner__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(255, 182, 41, 0.4);
}

.buy-coins-banner__button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(255, 182, 41, 0.3);
}

.buy-coins-banner__button span {
    color: #0F172A;
    font-size: 15px;
    font-weight: 600;
}

.buy-coins-banner__cart-icon {
    width: 20px;
    height: 20px;
}

.roulette-banner__button {
    background: linear-gradient(180deg, #E64C3C 0%, #C03A2B 100%);
    box-shadow: 0 4px 10px rgba(230, 76, 60, 0.3);
}

.roulette-banner__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(230, 76, 60, 0.4);
}

.roulette-banner__button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(230, 76, 60, 0.3);
}

.roulette-banner__button span, .roulette-banner__button i {
    color: #ffffff;
}

.roulette-banner__button i {
    font-size: 20px;
}
/* Profile Header Section */
.profile-header-section {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    gap: 1.5rem;
    background-color: var(--card-bg-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.profile-header-section .profile-picture {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-dark);
    font-size: 2.5rem;
    flex-shrink: 0;
}

.profile-picture-edit {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: 2px solid var(--card-bg-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.profile-picture-edit:hover {
    background-color: var(--primary-color-hover);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-info .username {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.profile-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color-dark);
}

.profile-level .fa-star {
    color: #facc15;
}

.join-date {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Settings Page */
.settings-container {
    margin-top: 0.5rem;
    flex-direction: column;
    align-items: center;
}

.settings-card {
    width: 100%;
    max-width: 500px;
}

.settings-card--theme {
    margin-bottom: 1.5rem;
}

.settings-card__label {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-card__icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 24px;
    text-align: center;
}

.settings-card__text-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.settings-card__label-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.settings-card__subtitle {
    font-size: 0.6rem;
    color: var(--text-color-dark);
    font-weight: 400;
}

.settings-card__subtitle {
    font-size: 0.6rem;
    color: var(--text-color-dark);
    font-weight: 400;
}

.settings-card--danger-zone {
    margin: 0 auto;
    text-align: center;
}

.danger-zone-icon {
    font-size: 2.5rem;
    color: var(--danger-color);
    margin-bottom: 0.75rem;
}

.settings-card--danger-zone h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.settings-card--danger-zone .subtitle {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
/* Challenges Section */
.challenges-list {
    display: grid;
    gap: 1.5rem;
    margin-top: 0.5rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.challenge-card {
    width: 100%; /* Adapt to be responsive */
    max-width: 460px; /* Max width from example */
    margin: 0 auto; /* Center the cards */
    background: var(--card-bg-color);
    border-radius: var(--border-radius);
    padding: 22px;
    box-shadow: var(--shadow);
    font-family: "Segoe UI", sans-serif; /* Use font from example */
}

.challenge-card .top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.challenge-card .left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.challenge-card .icon-box {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Blue Variant */
.challenge-card .icon-blue {
    background: linear-gradient(135deg, #2f86ff, #1557ff);
    box-shadow: 0 6px 16px rgba(32, 108, 255, 0.25);
}

/* Purple Variant */
.challenge-card .icon-purple {
    background: linear-gradient(135deg, #933dff, #6a1cff);
    box-shadow: 0 6px 16px rgba(106, 28, 255, 0.25);
}

/* Teal Variant */
.challenge-card .icon-teal {
    background: linear-gradient(135deg, #2dd4bf, #14b8a6);
    box-shadow: 0 6px 16px rgba(20, 184, 166, 0.25);
}

/* Gold Variant */
.challenge-card .icon-gold {
    background: linear-gradient(135deg, #facc15, #eab308);
    box-shadow: 0 6px 16px rgba(234, 179, 8, 0.25);
}


.challenge-card .title {
    font-size: 20px; /* Slightly smaller to fit longer titles */
    font-weight: 800;
    color: var(--text-color);
}

.challenge-card .time-box {
    background: #f2f6ff;
    padding: 10px 14px;
    border-radius: var(--border-radius);
    min-width: 110px;
    text-align: center;
}
html[data-theme='dark'] .challenge-card .time-box {
    background: rgba(255, 255, 255, 0.05);
}


.challenge-card .time-box.purple { background: #f5efff; }
html[data-theme='dark'] .challenge-card .time-box.purple { background: rgba(147, 51, 234, 0.1); }

.challenge-card .time-box.teal { background: #f0fdfa; }
html[data-theme='dark'] .challenge-card .time-box.teal { background: rgba(20, 184, 166, 0.1); }

.challenge-card .time-box.gold { background: #fefce8; }
html[data-theme='dark'] .challenge-card .time-box.gold { background: rgba(234, 179, 8, 0.1); }


.challenge-card .time-box i {
    font-size: 14px;
    margin-right: 5px;
}

.challenge-card .time-label {
    font-size: 12px;
    color: var(--text-color-dark);
}

.challenge-card .time-value {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-color);
}

.challenge-card .description {
    margin-top: 22px;
    color: var(--text-color-dark);
    font-size: 15px; /* Slightly smaller */
    line-height: 1.4;
}

.challenge-card .progress-area {
    margin-top: 18px;
}

.challenge-card .progress-bg {
    height: 32px;
    background: #e8edf5;
    border-radius: calc(var(--border-radius) * 2.5); /* 20px, adapted */
    overflow: hidden;
    position: relative;
}
html[data-theme='dark'] .challenge-card .progress-bg {
    background: var(--bg-color);
}

.challenge-card .progress-fill {
    height: 100%;
    width: 0%; /* Default width */
    transition: width 0.6s;
    position: relative;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color-hover));
}

.challenge-card .progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-weight: 800;
    font-size: 16px;
    color: #1e293b; /* Cor escura para o tema claro */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5); /* Sombra clara para legibilidade sobre o preenchimento */
}

/* No tema escuro, o texto do progresso deve ser branco para contrastar com o fundo */
html[data-theme='dark'] .challenge-card .progress-text {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); /* Sombra escura para legibilidade sobre o preenchimento */
}
.challenge-card .reward-row {
    margin-top: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.challenge-card .reward-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color-dark);
}

.challenge-card .reward-left i {
    color: #ffbb00;
}

.challenge-card .coin-box {
    border-radius: var(--border-radius);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-color);
}

.challenge-card .coin {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.challenge-card .action-btn {
    margin-top: 22px;
    width: 100%;
    background: transparent; /* Evita o "flash" inicial do botão */
    border: none;
    height: 58px;
    border-radius: var(--border-radius);
    color: white;
    font-size: 20px; /* Slightly smaller */
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.challenge-card .action-btn:hover {
    transform: translateY(-2px);
}

.challenge-card .btn-blue {
    background: linear-gradient(180deg, #2472ff, #1353ea);
    box-shadow: 0 8px 18px rgba(36, 114, 255, 0.35);
}
.challenge-card .btn-purple {
    background: linear-gradient(180deg, #8d32ff, #6717f3);
    box-shadow: 0 8px 18px rgba(128, 0, 255, 0.30);
}
.challenge-card .btn-teal {
    background: linear-gradient(180deg, #14b8a6, #0d9488);
    box-shadow: 0 8px 18px rgba(20, 184, 166, 0.30);
}
.challenge-card .btn-gold {
    background: linear-gradient(180deg, #facc15, #eab308);
    box-shadow: 0 8px 18px rgba(234, 179, 8, 0.30);
    color: #583d09; /* Cor escura para contraste no fundo dourado */
}

/* Disabled state for action button */
.challenge-card .action-btn.btn-disabled {
    background: var(--border-color);
    /* A cor do texto é branca por padrão, precisa ser sobrescrita para o tema claro */
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

html[data-theme='light'] .challenge-card .action-btn.btn-disabled {
    color: var(--text-color-dark);
}

/* Responsive adjustments for challenge cards */
@media (max-width: 480px) {
    .challenge-card {
        padding: 16px;
        border-radius: var(--border-radius);
    }
    .challenge-card .top {
        gap: 8px; /* Add gap to prevent title and timebox from touching */
    }
    .challenge-card .left {
        gap: 12px;
    }
    .challenge-card .icon-box {
        width: 48px;
        height: 48px;
        font-size: 22px;
        border-radius: 50%; 
    }
    .challenge-card .title {
        font-size: 18px;
    }
    .challenge-card .time-box {
        padding: 8px 10px;
        border-radius: var(--border-radius);
        min-width: auto; /* Allow shrinking */
        flex-shrink: 0; /* Prevent time box from shrinking too much */
    }
    .challenge-card .time-label {
        font-size: 11px;
    }
    .challenge-card .time-value {
        font-size: 12px;
    }
    .challenge-card .description,
    .challenge-card .progress-area,
    .challenge-card .reward-row,
    .challenge-card .action-btn {
        margin-top: 16px;
    }
    .challenge-card .progress-bg,
    .challenge-card .coin-box {
        border-radius: calc(var(--border-radius) * 2);
    }
}

/* Theme Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.theme-control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Estilo unificado para o display de dificuldade, similar ao de moedas */
.title#difficultyDisplay {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
}

/* Difficulty Display */
.title span#difficultyName {
    display: inline-block;
    color: white;
    font-weight: 700;
}

.title.difficulty--easy span#difficultyName {
    color: #22c55e;
}
.title.difficulty--medium span#difficultyName {
    color: var(--primary-color);
}
.title.difficulty--hard span#difficultyName {
    color: var(--danger-color);
}

/* Card base style */
.card {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* Info Stats Board on Start Page */
.info-stats-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem; /* Smaller gap */
    margin: 0.5rem 0.5rem 1.5rem 0.5rem;
}

/* Remove a margem do painel de estatísticas na página de perfil para alinhar com o grid. */
.info-section > .info-stats-board {
    margin: 0;
}

.info-card {
    display: flex;
    align-items: center;
    padding: 0.75rem; /* Smaller padding */
    border-radius: var(--border-radius);
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.info-card-icon {
    width: 36px; /* Smaller icon wrapper */
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1rem; /* Smaller icon */
    flex-shrink: 0;
}

.info-card-content {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    overflow: hidden; /* Prevents text from wrapping weirdly */
}

.info-card-title {
    font-size: 0.7rem; /* Smaller title */
    color: var(--text-color-dark);
    font-weight: 500;
    white-space: nowrap;
}

.info-card-value {
    font-size: 1.25rem; /* Smaller value */
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
}

#score.score-pop, #coinCount.coin-pop {
    animation: pop 0.4s ease-out;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: var(--primary-color); }
    100% { transform: scale(1); }
}

/* Card Colors - following example style */
.info-card.purple .info-card-icon { background-color: rgba(139, 92, 246, 0.15); }
.info-card.purple .info-card-icon i { color: #8B5CF6; }

.info-card.green .info-card-icon { background-color: rgba(34, 197, 94, 0.15); }
.info-card.green .info-card-icon i { color: #22C55E; }

.info-card.blue .info-card-icon { background-color: rgba(59, 130, 246, 0.15); }
.info-card.blue .info-card-icon i { color: #3B82F6; }

.info-card.orange .info-card-icon { background-color: rgba(249, 115, 22, 0.15); }
.info-card.orange .info-card-icon i { color: #F97316; }

@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.6);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(250, 204, 21, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0);
    }
}

.shake-short {
    animation: shake-short 0.3s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake-short {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

.button-attention-shake {
    animation: button-attention-shake 0.8s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes button-attention-shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0) rotate(-1deg);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0) rotate(2deg);
    }
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0) rotate(-3deg);
    }
    40%, 60% {
        transform: translate3d(4px, 0, 0) rotate(3deg);
    }
}
/* Combo Banner */
.combo-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10000;
}

.combo-effect {
    position: fixed;
    left: 50%;
    top: 20%;
    transform: translate(-50%, -50%) scale(.2);
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    opacity: 0;
    pointer-events: none;
    z-index: 10001;
    text-shadow:
        0 0 10px white,
        0 0 20px white,
        0 0 40px white;
}

.combo-effect.show {
    animation: combo-pop 2s ease;
}

@keyframes combo-pop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.2);
    }
    12% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
    24% { transform: translate(-50%, -50%) scale(.95); }
    36% { transform: translate(-50%, -50%) scale(1.08); }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

.board-wrapper {
    overflow-x: auto;
    padding-bottom: 1rem;
    border-radius: var(--border-radius);
    /* Define uma altura mínima para o tabuleiro, calculada subtraindo a altura aproximada (350px) de outros elementos como cabeçalho, rodapé e ações. */
    min-height: calc(100vh - 350px);
    /* A altura agora será determinada pelo conteúdo do tabuleiro. */    
    /* padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem; */
    padding: 0.5rem 0.5rem 0;
    position: relative; /* Necessário para posicionar a animação de vitória */
}

/* Animação de Vitória (SVG) */
.victory-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 350px;
    z-index: 100;
    display: none; /* Escondido por padrão */
    pointer-events: none;
}

.victory-animation.show {
    display: block;
}

.board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
    width: 100%;
    background: #141d31;
    padding: 12px;
    border-radius: 14px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, .45);
    margin: 0 auto;
}

.cell {
    width: 100%;
    aspect-ratio: 1; /* Mantém os blocos perfeitamente quadrados */
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #334666;
    border: 2px solid #526a95;
    font-size: clamp(16px, 3.5vw, 36px); /* Fonte responsiva (cresce com a tela) */
    font-weight: bold;
    color: white;
    opacity: 0;
    cursor: pointer;
    touch-action: manipulation; /* Impede zoom ao dar toques rápidos no mobile */
    transform: translateY(-20px) scale(.2);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.cell.show {
    animation: add .35s cubic-bezier(.18, 1.4, .35, 1) forwards;
}

.cell.visible-instantly {
    opacity: 1;
    transform: none;
}

/* Efeito de hover em células interativas - apenas para dispositivos com mouse */
@media (hover: hover) {
    .cell.show:hover:not(.selected):not(.matched) {
        background: #415982;
    }
}

/* Célula Selecionada */
.cell.selected {
    background: #eab308;
    border-color: #ca8a04;
    transform: scale(1.15) !important;
    z-index: 2;
}

/* Célula com Match feito (Placeholder tracejado) */
.cell.matched {
    pointer-events: none;
    background: transparent;
    border: 2px dashed var(--matched-border-color);
    color: transparent;
}

/* Animação que roda quando um match ACABA de acontecer */
.cell.newly-matched {
    animation: matchSuccess 0.4s forwards;
}
/* Efeito impactante quando a linha é limpa */
.cell.row-cleared {
    animation: explodeOut 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
    pointer-events: none;
    z-index: 10;
}

.cell.hint-highlight {
    position: relative; /* Necessário para o posicionamento do pseudo-elemento */
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.cell.hint-highlight::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: inherit;
    animation: hint-pulse 1.5s ease-out infinite;
}
@keyframes hint-pulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { box-shadow: 0 0 15px 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

@keyframes add {
    0% { opacity: 0; transform: translateY(-20px) scale(.2); }
    70% { opacity: 1; transform: translateY(4px) scale(1.15); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes matchSuccess {
    0% { 
        transform: scale(1.15); 
        background: #eab308;
        border: 2px solid #ca8a04;
        color: white;
    }
    50% { 
        transform: scale(0.8);
        opacity: 0.7; 
    }
    100% { 
        transform: scale(1); 
        opacity: 1;
        background: transparent; 
        border: 2px dashed var(--matched-border-color);
        color: transparent; 
    }
}

/* KEYFRAMES do efeito de destruição da linha */
@keyframes explodeOut {
    0% { 
        transform: scale(1); 
        background: #eab308; 
        border: 2px solid #fff;
        box-shadow: 0 0 15px #eab308; 
        opacity: 1; 
    }
    40% { 
        transform: scale(1.4) rotate(5deg); 
        background: #fff; 
        border: 2px solid #fff;
        box-shadow: 0 0 40px #fff; 
        opacity: 1; 
    }
    100% { 
        transform: scale(0) rotate(45deg); 
        opacity: 0; 
    }
}

/* Actions Section */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

#addRows, #showHint {
    position: relative;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color-hover);
}

.btn-secondary {
    background-color: var(--card-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-color-hover);
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Custom styles for game action buttons to make them more prominent */
#showHint, #addRows {
    border: none;
    color: white; /* Ensures text is white on both themes */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#showHint {
    background: linear-gradient(180deg, #3b82f6, #2563eb); /* Blue gradient */
}

#addRows {
    background: linear-gradient(180deg, #14b8a6, #0d9488); /* Teal gradient */
}

#showHint:hover, #addRows:hover {
    transform: translateY(-2px);
}

#showHint:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

#addRows:hover {
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.3);
}

.badge {
    position: absolute;
    top: -10px;
    right: -8px;
    background-color: var(--secondary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border: 2px solid var(--bg-color);
}

.badge.badge-cost {
    background-color: #facc15;
}
.badge .coin-icon {
    width: 16px;
    height: 16px;
}
/* Info Section (Ranking & Rules) */
.info-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-section .card {
    padding: 1.5rem;
}

.accordion-card {
    padding: 0 !important; /* Remove padding from the card itself to allow summary to fill it */
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    list-style: none; /* Remove default marker */
}

.accordion-header::-webkit-details-marker {
    display: none; /* For Safari */
}

.accordion-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.accordion-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.accordion-chevron {
    color: var(--text-color-dark);
    transition: transform 0.3s ease;
}

details[open] > summary .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.card-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.accordion-header .card-title-wrapper {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.card-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    color: var(--text-color-dark);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.card-title-wrapper .fa-trophy {
    color: #facc15;
}

.info-section h2 {
    font-size: 1.0rem;
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

#rankingList, .info-section ul {
    list-style: none;
    padding-left: 0;
}

#rankingList li, .info-section li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

#rankingList li:last-child, .info-section li:last-child {
    border-bottom: none;
}

#rankingList li strong {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

#topScoreDisplay strong {
    color: #facc15; /* Gold color for #1 */
    margin-right: 0.5rem;
}

#rankingList li:first-child strong {
    color: #facc15; /* Gold color for #1 */
}

.info-section li {
    color: var(--text-color-dark);
}

/* Achievements Section */
.achievements-section {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.achievements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.achievements-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.achievements-title-group .fa-medal {
    color: var(--primary-color);
}

.achievements-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.see-all-btn {
    background-color: var(--bg-color);
    color: var(--text-color-dark);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.see-all-btn:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

.see-all-btn i {
    margin-left: 0.25rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 0.5rem 0.5rem 0.5rem 0.5rem;
}

.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    border-top: 4px solid var(--border-color); /* Borda de destaque */
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
    box-shadow: 0 4px 5px rgba(0, 0, 0, 0.09);
}

.achievement-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    background-color: var(--border-color);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.achievement-text h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color-dark);
    margin-bottom: 0.1rem;
    transition: color 0.3s ease;
}

.achievement-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* Achievement States */
.achievement-item.locked {
    filter: grayscale(1);
    opacity: 0.6;
}

.achievement-item.unlocked {
    filter: none;
    opacity: 1;
    border-top-color: var(--primary-color);
}

.achievement-item.unlocked .achievement-icon {
    background-color: var(--primary-color);
    color: white;
}

.achievement-item.unlocked .achievement-text h4 {
    color: var(--text-color);
}

/* Estilo circular para a pré-visualização de conquistas na página de perfil */
.achievements-section .achievements-grid {
    display: flex;
    justify-content: center;
    align-items: center;
}

.achievements-section .achievement-item {
    /* Reseta os estilos do card para ser um container simples */
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    /* Transforma o container em um círculo */
    width: 72px;
    height: 72px;
    border-radius: 50%;
}

.achievements-section .achievement-item .achievement-text {
    /* Esconde o texto nesta visualização resumida */
    display: none;
}

.achievements-section .achievement-item .achievement-icon {
    /* Faz o ícone preencher o novo container circular */
    width: 100%;
    height: 100%;
    margin: 0;
    font-size: 2rem;
    border: 3px solid var(--border-color); /* Adiciona uma borda ao ícone */
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    color: var(--text-color-dark);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* App Footer (Fixed) */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg-color);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
}

.footer-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-color-dark);
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}

.footer-btn.active, .footer-btn:hover {
    color: var(--primary-color);
}

.footer-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 0 0 3px 3px;
}

/* Game Actions Footer */
.game-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg-color);
    display: flex;
    gap: 2.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    justify-content: center;
}

.game-footer > button {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    padding: 0;
    flex: 0 0 54px;
    justify-content: center;
}

.game-footer > button i {
    font-size: 1.75rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.modal-message {
    margin-bottom: 2rem;
    color: var(--text-color-dark);
}

.modal-message strong {
    color: var(--primary-color);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Level Selection Section */
.level-selection-wrapper {
    margin: 3rem 0 0;
}

.level-selection {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    /* A margem foi movida para o .level-selection-wrapper */
}

.level-card {
    border: none;
    text-decoration: none;
    color: var(--text-color);
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    padding: 16px 12px;
    width: 190px;
    max-width: 100%;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.level-card.carousel-active {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.level-card h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
}

.level-card .icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 10px;
}

.level-card .stars {
    display: flex;
    gap: 4px;
    font-size: 12px;
    margin-bottom: 10px;
}

.level-card .description {
    color: var(--text-color-dark);
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 16px;
    min-height: 36px;
}

.level-card .btn-play {
    width: 100%;
    padding: 8px 0;
    border: none;
    border-radius: var(--border-radius);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    font-family: var(--font-family);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: filter 0.2s;
    margin-top: auto;
    text-decoration: none;
}

.level-card.easy .icon-circle, .level-card.easy .btn-play { background-color: var(--color-easy); }
.level-card.easy h2, .level-card.easy .stars { color: var(--color-easy); }
.level-card.medium .icon-circle, .level-card.medium .btn-play { background-color: var(--color-medium); }
.level-card.medium h2, .level-card.medium .stars { color: var(--color-medium); }
.level-card.hard .icon-circle, .level-card.hard .btn-play { background-color: var(--color-hard); }
.level-card.hard h2, .level-card.hard .stars { color: var(--color-hard); }

/* Continue Banner (Resume) */
.carousel-indicators {
    display: none; /* Escondido por padrão */
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border-color);
    transition: background-color 0.3s ease;
}

.indicator.active {
    background-color: var(--primary-color);
}
.resume-banner {
    background-color: var(--banner-resume-bg);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    margin: 2.5rem auto 0;
    max-width: 618px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--banner-resume-border);
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.resume-banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-wrapper {
    background-color: var(--banner-resume-icon-wrapper-bg);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--banner-resume-icon-color);
}

.text-content h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--banner-resume-text-color);
    margin: 0 0 4px 0;
}

.text-content p {
    font-size: 14.5px;
    color: var(--banner-resume-text-muted-color);
    font-weight: 400;
    margin: 0;
}

.text-content p strong {
    font-weight: 600;
    color: var(--banner-resume-text-color);
}

.continue-btn-placeholder {
    background-color: var(--banner-resume-btn-bg);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius);
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.resume-banner:hover .continue-btn-placeholder {
    background-color: var(--banner-resume-btn-hover-bg);
}

/* Roulette Overlay */
.roulette-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centraliza o conteúdo na tela */
    align-items: center;
    background-color: var(--bg-color);
    z-index: 1100; /* Acima do footer */
    display: none; /* Escondido por padrão */
    gap: 2rem; /* Espaçamento entre a roleta e o botão */
}

.roulette-overlay.show {
    display: flex;
}

.roulette-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 70px;
}

.roulette-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.roulette-canvas {
    width: 90vw;
    height: 90vw;
    max-width: 450px;
    max-height: 450px;
}

.roulette-pointer {
    position: absolute;
    width: 30px;
    height: 60px;
    top: -30px; /* Posiciona acima da roleta */
    left: 50%;
    transform-origin: center 10px; /* Origem da animação no pino do ponteiro */
    transform: translateX(-50%);
    filter: drop-shadow(0px 4px 3px rgba(0,0,0,0.3));
}

/* Ajuste para o botão de fechar no overlay da roleta */
.roulette-overlay .header-back-btn {
    background: none;
    border: none;
    cursor: pointer;
}

.roulette-pointer svg polygon {
    fill: var(--primary-color);
}
.roulette-pointer svg circle:nth-of-type(1) {
    fill: var(--primary-color);
}
.roulette-pointer svg circle:nth-of-type(2) {
    fill: var(--bg-color);
}

.roulette-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
}

.roulette-spin-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    width: 100%;
    max-width: 300px;
    background: linear-gradient(180deg, #E64C3C 0%, #C03A2B 100%);
    box-shadow: 0 4px 10px rgba(230, 76, 60, 0.3);
    border: none;
}
.roulette-spin-btn:hover {
    background: linear-gradient(180deg, #E64C3C 0%, #C03A2B 100%);
    box-shadow: 0 6px 14px rgba(230, 76, 60, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    /* Responsive adjustments for info stats board */
    @media (min-width: 768px) {
        .info-stats-board {
            grid-template-columns: repeat(4, 1fr);
        }
    }

    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .level-selection-wrapper {
        margin-top: 0.5rem;
        margin-bottom: 0;
    }

    /* Carousel for level selection on mobile */
    .level-selection {
        display: flex;
        overflow-x: auto;
        justify-content: flex-start;
        flex-wrap: nowrap;
        padding: 1.5rem 1rem 0;
        gap: 1rem;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    .level-selection::-webkit-scrollbar {
        display: none;
    }
    .carousel-indicators {
        display: flex;
    }

    .level-card {
        flex: 0 0 190px;
    }
    .resume-banner {
        margin: 1rem 0.5rem 0;
    }

    .coin-container {
        /* Restaura a margem lateral em telas menores, mantendo o espaçamento inferior */
        margin: 0.5rem 0.5rem 1.5rem;
    }

    .stats-banner {
        gap: 0.5rem;
        padding: 1rem 0.5rem;
        justify-content: space-evenly;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    .stat-item .stat-value {
        font-size: 1.25rem;
    }
    .stat-item i {
        font-size: 1.25rem;
    }
    .stat-item .stat-label {
        font-size: 0.7rem;
        white-space: nowrap;
    }
    .stat-divider {
        display: none; /* Hide dividers on small screens */
    }

    .buy-coins-banner {
        padding: 12px 16px;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    .buy-coins-banner__image {
        width: 56px;
        height: 48px;
    }
    .buy-coins-banner__balance {
        font-size: 28px;
    }
    .buy-coins-banner__button {
        padding: 8px 12px;
    }
    .buy-coins-banner__button span {
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    .buy-coins-banner__button span {
        display: none;
    }
    .buy-coins-banner__button {
        padding: 10px;
    }
    .buy-coins-banner__left {
        gap: 8px;
    }

    .roulette-container {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    .roulette-spin-btn {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .actions {
        flex-direction: column;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .actions-row {
        display: flex;
        gap: 1rem;
    }

    .actions-row > button {
        flex: 1;
    }

    .btn-primary, .btn-secondary, .btn-danger {
        width: 100%;
        justify-content: center;
    }

    .resume-banner {
        /* Ajustes para layout horizontal em telas menores */
        flex-direction: row;
        gap: 1rem;
        padding: 12px 16px;
        align-items: center;
    }
    .banner-left {
        /* Reverte para o padrão horizontal e reduz o espaçamento */
        flex-direction: row;
        gap: 0.75rem;
        align-items: center;
        flex-shrink: 1;
        min-width: 0;
    }
    .continue-btn-placeholder {
        padding: 12px; /* Ajusta o padding para um botão de ícone */
        font-size: 14px;
        flex-shrink: 0;
        gap: 0;
    }
    .continue-btn-placeholder .continue-btn-text {
        display: none; /* Esconde o texto em telas pequenas */
    }
    .icon-wrapper {
        width: 44px;
        height: 44px;
    }
    .text-content h2 {
        font-size: 0.9rem;
    }
    .text-content p {
        font-size: 0.7rem;
    }

    .achievements-section .achievements-grid {
        gap: 0.5rem; /* Reduz o espaçamento em telas pequenas */
    }
    .achievements-section .achievement-item {
        width: 56px;
        height: 56px;
    }
    .achievements-section .achievement-item .achievement-icon {
        font-size: 1.5rem;
    }
}

@media (min-width: 481px) {
    /* Seleciona todos os botões dentro de .actions para alinhá-los em desktop */
    .actions-row {
        display: contents;
    }

    .actions button {
        flex: 1;
        justify-content: center;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8); /* --bg-color with opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    border: 4px solid var(--spinner-track-color);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Specific Light Theme Overrides */
html[data-theme='light'] .board-wrapper {
    background: rgba(0,0,0,0.05);
}

html[data-theme='light'] .board {
    background: #e2e8f0; /* Fundo do board mais escuro para destacar as células */
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

html[data-theme='light'] .cell {
    background-color: #ffffff; /* Células brancas para contraste */
    border-color: #cbd5e1; /* Borda sutilmente mais escura */
    color: var(--text-color); /* Adicionado para legibilidade no tema claro */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04); /* Sombra interna para profundidade */
}

html[data-theme='light'] .cell.show:hover:not(.selected):not(.matched) {
    background: #f8fafc; /* Um leve tom de cinza no hover */
}

html[data-theme='light'] .app-footer {
    background-color: #fff;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
}

html[data-theme='light'] .header-fixed {
    background-color: #f1f5f9;
}

html[data-theme='light'] .loading-overlay {
    background-color: rgba(241, 245, 249, 0.8); /* light bg-color with opacity */
}

html[data-theme='light'] .level-card {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
html[data-theme='light'] .level-card.carousel-active {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}
html[data-theme='light'] .level-card .description {
    color: var(--text-muted);
}

.theme-icons {
    font-size: 1.2rem;
    color: #facc15;
}

.theme-icons .fa-sun {
    display: none;
}

html[data-theme='light'] .theme-icons .fa-sun {
    display: block;
}

html[data-theme='light'] .theme-icons .fa-moon {
    display: none;
}

/* Sobrescreve a cor da borda tracejada para o tema claro */
html[data-theme='light'] .cell.matched {
    background: transparent;
    border-color: var(--matched-border-color);
    box-shadow: none; /* Remove a sombra interna */
}

html[data-theme='light'] .cell.selected {
    background-color: var(--primary-color);
    color: white;
}

/* Garante que o destaque da dica tenha a especificidade correta no tema claro,
   sobrescrevendo a cor de fundo e texto padrão dos números. A animação de
   pulso é herdada da regra base `.cell.hint-highlight`. */
html[data-theme='light'] .cell.hint-highlight {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}


html[data-theme='light'] .btn-secondary:hover {
    background-color: #f1f5f9; /* slate-100 */
}

/* Store Page */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 0.5rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.store-card {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.store-card__icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.store-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.store-card__description {
    color: var(--text-color-dark);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.store-card__button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.store-card__button:hover {
    background-color: var(--primary-color-hover);
}

/* Token Card Specifics */
.token-card .quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.token-card .quantity-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.token-card .quantity-display {
    font-size: 2rem;
    font-weight: 700;
    min-width: 50px;
}

.token-card .cost-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #3e4b5d;
}

.token-card .cost-display .coin-icon {
    width: 20px;
    height: 20px;
}

/* Aplica efeitos de hover apenas em dispositivos que suportam (não-toque) */
@media (hover: hover) {
    /* Efeito de hover do tema escuro, como no exemplo */
    .cell.show:hover:not(.selected):not(.matched) {
        background: #415982;
    }
    /* Efeito de hover para o tema claro */
    html[data-theme='light'] .cell:not(.selected):not(.matched):hover {
        background-color: #e2e8f0; /* slate-200 */
        border-color: var(--primary-color);
    }

    /* Efeito de hover para os cards de nível no desktop */
    .level-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    }
}

/* Ad Card Specifics */
.ad-card .store-card__button {
    background-color: var(--secondary-color);
}
.ad-card .store-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-color);
    border-radius: 50%;
}
.ad-card .store-card__icon i {
    font-size: 2.5rem;
    color: white;
}
.ad-card .store-card__button:hover {
    background-color: #60a5fa;
}
.ad-card .store-card__button.btn-disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

/* Coin Pack Specifics */
.coin-pack-card .store-card__title {
    color: #facc15; /* Gold */
}
.coin-pack-card .store-card__button {
    background: linear-gradient(180deg, #FFDE59 0%, #FFB629 100%);
    color: #0F172A;
    box-shadow: 0 4px 10px rgba(255, 182, 41, 0.3);
}
.coin-pack-card .store-card__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(255, 182, 41, 0.4);
}

/* Ajustes de responsividade do exemplo para telas muito pequenas */
@media(max-width: 400px) {
    .board {
        gap: 3px;
        padding: 8px;
    }
    .cell {
        border-width: 1.5px;
    }
}
