:root {
    --bg-color: #121212;
    --panel-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --muted-color: #888;
    --border-color: #333;
    --accent-color: #4fc3f7;
    --success-color: #2ecc71;
    --warning-color: #e67e22;
    --danger-color: #e74c3c;
    --purple-color: #8e44ad;
    --green-color: #16a085;
    --raise-color: var(--danger-color);
    --threebet-color: var(--purple-color);
    --push-color: var(--warning-color);
    --call-color: var(--success-color);
    --check-color: var(--green-color);
    --fold-color: #4a4a4a;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}
 
body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
}

body > * {
    width: 100%;
    max-width: 1120px;
}

h1, h2, h3 {
    margin: 0 0 18px;
}

h1 {
    font-size: clamp(28px, 5vw, 40px);
    text-align: center;
    letter-spacing: 0.01em;
}

h2 {
    font-size: clamp(20px, 3vw, 28px);
}

a {
    color: var(--accent-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

body.page-login {
    min-height: 100vh;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at top left, rgba(79, 195, 247, 0.16), transparent 30%),
        radial-gradient(circle at bottom right, rgba(142, 68, 173, 0.16), transparent 34%),
        linear-gradient(140deg, #0c1018 0%, #121924 100%);
}

.login-card {
    width: min(100%, 420px);
    border-radius: 16px;
    padding: 22px;
    background: rgba(17, 24, 38, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
    text-align: left;
    font-size: clamp(26px, 5vw, 32px);
    margin-bottom: 10px;
}

.login-subtitle {
    margin: 0 0 16px;
    color: #b7c3d8;
    font-size: 14px;
}

.login-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8da0bd;
    font-size: 12px;
    margin-bottom: 10px;
}

.login-separator::before,
.login-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.login-card input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.login-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

@media (max-width: 520px) {
    .login-actions {
        grid-template-columns: 1fr;
    }
}

.auth-shell {
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.auth-mini-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(13, 17, 24, 0.65);
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    transition: transform 0.14s ease, background 0.14s ease;
}

.auth-mini-btn:hover {
    transform: translateY(-1px);
    background: rgba(13, 17, 24, 0.9);
}

.auth-panel {
    position: absolute;
    right: 0;
    bottom: 44px;
    min-width: 250px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(10, 14, 22, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.auth-shell.open .auth-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.auth-status {
    font-size: 12px;
    color: #d6dce7;
    max-width: 230px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}

.auth-actions {
    display: flex;
    justify-content: flex-end;
}

.auth-btn {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.auth-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.auth-logout {
    border-color: rgba(231, 76, 60, 0.45);
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(4, 6, 10, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-modal-card {
    width: min(100%, 380px);
    background: #141b28;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 18px;
}

.auth-modal-card h3 {
    margin: 0 0 8px;
}

.auth-modal-card p {
    margin: 0 0 14px;
    color: #b8c1cf;
    font-size: 14px;
}

.auth-modal-card input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.auth-modal-actions {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.auth-message {
    margin-top: 10px;
    color: #ffb4b4;
    font-size: 12px;
}

.auth-required-banner {
    margin-top: 12px;
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 190, 118, 0.4);
    background: rgba(255, 190, 118, 0.1);
    color: #ffd89e;
    font-size: 12px;
    font-weight: 700;
}

.home-cards.auth-locked .home-card {
    filter: grayscale(0.2);
    opacity: 0.65;
}

.home-cards.auth-locked .home-card:hover {
    transform: none;
    box-shadow: inherit;
}

@media (max-width: 760px) {
    .auth-shell {
        right: 10px;
        bottom: 12px;
    }

    .auth-panel {
        min-width: 220px;
        right: 0;
        bottom: 42px;
    }
}

button,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.page-wrapper {
    width: 100%;
    max-width: 1100px;
    padding: 20px;
}

.page-wrapper h1,
.page-wrapper h2,
.page-wrapper h3 {
    margin: 0;
}

.scenario-card,
.lexique-card,
.header-controls,
.controls,
#advice-panel,
#feedback-container,
.trainer-top-bar,
.top-bar {
    background: var(--panel-bg);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.hidden {
    display: none !important;
}

button.primary,
button.secondary,
button.tertiary {
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 700;
    color: #fff;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

button.primary:hover,
button.secondary:hover,
button.tertiary:hover {
    transform: translateY(-1px);
}

button.primary {
    background-color: var(--accent-color);
}

button.secondary {
    background-color: var(--purple-color);
}

button.tertiary {
    background-color: var(--green-color);
}

button.disabled,
button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

select {
    width: 100%;
    padding: 11px 12px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #1f1f1f;
    color: #fff;
    appearance: none;
}
 
label {
    display: inline-block;
    color: #aaa;
    font-size: 13px;
    margin-bottom: 6px;
}

.header-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 18px 20px;
}

/* ---------- Home page ---------- */

body.page-home,
body.page-lexique,
body.page-solver-basique,
body.page-solver-avance,
body.page-trainer {
    min-height: 100vh;
}

.home-header,
.home-cards,
.home-footer {
    width: 100%;
    max-width: 1100px;
}

.home-header {
    text-align: center;
    margin-bottom: 40px;
}

.home-header h1 {
    font-size: clamp(28px, 5vw, 42px);
    color: #fff;
    margin-bottom: 10px;
}

.home-header p {
    color: var(--muted-color);
    font-size: 14px;
}

.home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.home-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 22px;
    text-align: left;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.home-card .card-icon {
    font-size: 38px;
    margin-bottom: 18px;
}

.home-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.home-card p {
    color: #bbb;
    line-height: 1.5;
    margin-bottom: 18px;
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    background: rgba(79, 195, 247, 0.15);
    border: 1px solid rgba(79, 195, 247, 0.25);
}

.home-card.basique { border-top: 4px solid var(--danger-color); }
.home-card.avance { border-top: 4px solid var(--purple-color); }
.home-card.trainer { border-top: 4px solid var(--warning-color); }
.home-card.lexique { border-top: 4px solid var(--success-color); }
.home-card.admin { border-top: 4px solid var(--accent-color); }

.home-footer {
    text-align: center;
    color: #777;
    font-size: 13px;
}

/* ---------- Admin page ---------- */

body.page-admin {
    min-height: 100vh;
}

.admin-head,
.admin-kpis,
.admin-table-wrap {
    width: 100%;
    max-width: 1100px;
}

.admin-head {
    margin-top: 8px;
    margin-bottom: 18px;
}

.admin-head h1 {
    text-align: left;
    margin-bottom: 8px;
}

.admin-head p {
    margin: 0 0 6px;
    color: #b9c4d6;
}

.admin-note {
    font-size: 13px;
    color: #93a7c6;
}

.admin-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.admin-kpi {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
}

.admin-kpi-label {
    display: block;
    color: #9eb0cb;
    font-size: 12px;
    margin-bottom: 6px;
}

.admin-kpi strong {
    font-size: 28px;
    line-height: 1;
}

.admin-table-wrap {
    background: rgba(12, 16, 24, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
}

.admin-table th {
    position: sticky;
    top: 0;
    background: #141d2b;
    color: #d8e0ee;
    z-index: 1;
}

.admin-empty {
    color: #97abc9;
    text-align: center;
}

/* ---------- Solver Basique ---------- */

.solver-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    background: var(--panel-bg);
    padding: 18px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.solver-header h1 {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
    font-size: clamp(24px, 6vw, 36px);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 180px;
    min-width: 180px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 15px;
    margin-bottom: 10px;
}

.controls button {
    flex: 1 1 120px;
    min-width: 100px;
    border-radius: 6px;
    padding: 10px 12px;
    color: #fff;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 700;
    transition: transform 0.1s ease, background 0.15s ease;
}

.controls button:hover { background: #363636; transform: translateY(-1px); }

.controls button.active.mode-rfi { background: var(--danger-color); border-color: transparent; }
.controls button.active.mode-vs { background: var(--purple-color); border-color: transparent; }

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-bar span {
    color: var(--muted-color);
    font-size: 14px;
}

.grid-container,
.advanced-grid {
    display: grid;
    grid-template-columns: repeat(13, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 2px;
    width: 100%;
    max-width: 620px;
    aspect-ratio: 1 / 1;
    padding: 4px;
    border-radius: 8px;
    background: #1f1f1f;
}

.hand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(11px, 2.2vw, 14px);
    font-weight: 700;
    color: #bbb;
    height: 100%;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.1s ease;
}

.hand:hover {
    border-color: rgba(255,255,255,0.18);
    color: #fff;
}

.hand span { line-height: 1.1; }

.eq-text {
    margin-top: 2px;
    font-size: 0.7em;
    color: rgba(255,255,255,0.55);
    font-weight: normal;
}

.pair,
.suited,
.offsuit { background: var(--fold-color); }

.action-raise { background-color: var(--danger-color) !important; color: white; }
.action-threebet { background-color: var(--purple-color) !important; color: white; }
.action-push { background-color: var(--warning-color) !important; color: white; }
.action-call { background-color: var(--success-color) !important; color: white; }
.action-check { background-color: var(--green-color) !important; color: white; }

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    width: 100%;
    max-width: 620px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 14px;
    border-radius: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.color-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

/* ---------- Solver Avancé ---------- */

.advanced-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 18px 20px;
}

.advanced-header label {
    margin-bottom: 8px;
}

.advanced-grid {
    display: grid;
    grid-template-columns: repeat(13, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    max-width: 620px;
    aspect-ratio: 1 / 1;
    background: #1f1f1f;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.advanced-grid .hand {
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.advanced-grid .hand:hover {
    border-color: rgba(255,255,255,0.18);
    color: #fff;
}

.hand.active-hand {
    background-color: var(--purple-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 14px rgba(142, 68, 173, 0.75);
    z-index: 2;
}

.hand.has-data::after {
    content: "•";
    position: absolute;
    bottom: 2px;
    right: 4px;
    color: var(--accent-color);
    font-size: 12px;
}

#scenarios-section {
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 15px;
}

.section-title {
    color: var(--accent-color);
    font-size: 20px;
    margin: 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
    width: 100%;
}

.scenario-card {
    padding: 16px;
    border-top: 3px solid #555;
    cursor: pointer;
}

.scenario-card:hover {
    transform: translateY(-2px);
}

.scenario-card.active-scenario {
    border-top-color: var(--purple-color);
    background: rgba(142, 68, 173, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.card-title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.stat-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 5px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.stat-badge.prob {
    color: var(--success-color);
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.stat-badge.eq {
    color: var(--warning-color);
    border: 1px solid rgba(230, 126, 34, 0.2);
}

.card-desc,
.card-ex {
    color: #ccc;
    font-size: 13px;
    line-height: 1.5;
}

.card-ex {
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 10px;
}

#advice-panel {
    padding: 18px;
    display: none;
    border-left: 4px solid var(--purple-color);
}

.flash {
    animation: flashPanel 0.4s ease-out;
}

@keyframes flashPanel {
    from { background: rgba(230, 126, 34, 0.4); transform: scale(0.99); }
    to { background: rgba(142, 68, 173, 0.1); transform: scale(1); }
}

.badges-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.position-badge,
.street-badge,
.stack-badge {
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    padding: 6px 10px;
    text-transform: uppercase;
}

.position-badge { background: var(--purple-color); }
.street-badge { background: var(--warning-color); }
.stack-badge { background: var(--danger-color); }

.aura-agressive,
.aura-passive {
    display: block;
    font-weight: 700;
    margin-top: 10px;
}

.aura-agressive { color: #ff5252; }
.aura-passive { color: #4caf50; }

.page-topbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.nav-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-back-button:hover {
    transform: translateY(-1px);
    background: rgba(79, 195, 247, 0.14);
    border-color: rgba(79, 195, 247, 0.35);
    text-decoration: none;
}

/* ---------- Trainer ---------- */

body.page-trainer {
    min-height: 100vh;
    justify-content: flex-start;
    gap: 16px;
    padding: 20px 16px 28px;
    background:
    radial-gradient(circle at 18% 8%, rgba(230, 196, 125, 0.14), transparent 30%),
    radial-gradient(circle at 82% 92%, rgba(24, 128, 108, 0.22), transparent 40%),
    linear-gradient(180deg, #1a1207 0%, #101617 52%, #0a0f14 100%);
}

body.page-trainer > * {
    width: min(100%, 980px);
}

.trainer-top-bar,
.top-bar,
.trainer-controls {
    width: 100%;
}

.trainer-top-bar,
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-size: 15px;
    color: var(--muted-color);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(12px);
}

.trainer-top-bar span { display: flex; align-items: center; gap: 6px; }

.difficulty-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.difficulty-easy {
    background: rgba(80, 220, 140, 0.2);
    color: #9ff3be;
    border-color: rgba(80, 220, 140, 0.35);
}

.difficulty-medium {
    background: rgba(247, 181, 60, 0.2);
    color: #ffd88f;
    border-color: rgba(247, 181, 60, 0.35);
}

.difficulty-hard {
    background: rgba(255, 117, 117, 0.2);
    color: #ffb6b6;
    border-color: rgba(255, 117, 117, 0.35);
}

.difficulty-expert {
    background: rgba(168, 120, 255, 0.22);
    color: #dbc2ff;
    border-color: rgba(168, 120, 255, 0.4);
}

.stats-toggle {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(10, 15, 22, 0.7);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
}

.stats-toggle:hover {
    background: rgba(79, 195, 247, 0.18);
    border-color: rgba(79, 195, 247, 0.35);
}

.table-area {
    flex-grow: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0 12px;
    min-height: 320px;
}

.table-ring {
    width: min(100%, 520px);
    aspect-ratio: 1 / 1.34;
    border: 8px solid #4f3318;
    border-radius: 44% / 50%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 34px;
    background:
        radial-gradient(circle at 48% 35%, rgba(52, 186, 142, 0.5), rgba(10, 86, 67, 0.96) 60%),
        linear-gradient(145deg, #1d7358 0%, #0e4f3f 100%);
    box-shadow:
        0 28px 52px rgba(0, 0, 0, 0.5),
        inset 0 0 0 4px rgba(18, 84, 66, 0.8),
        inset 0 0 48px rgba(0, 0, 0, 0.32);
    overflow: visible;
}

.table-ring::before {
    content: '';
    position: absolute;
    inset: 20px 16px;
    border-radius: 42% / 48%;
    border: 2px dashed rgba(235, 255, 247, 0.25);
    background: radial-gradient(circle at center, rgba(239, 255, 250, 0.07), transparent 65%);
    pointer-events: none;
}

.table-ring::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 46% / 52%;
    border: 2px solid rgba(130, 79, 42, 0.52);
    pointer-events: none;
}

.node {
    position: absolute;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-size: 12px;
    font-weight: 700;
    color: #f0f0f0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: radial-gradient(circle at 35% 30%, #242a31 0%, #0f1319 75%);
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.node-status {
    font-size: 8px;
    line-height: 1;
    letter-spacing: 0.4px;
    font-weight: 800;
    opacity: 0.9;
}

.node-fold {
    opacity: 0.78;
    border-color: rgba(255, 255, 255, 0.16);
    background: radial-gradient(circle at 35% 30%, #1f252d 0%, #0b1016 75%);
}

.node-fold .node-status {
    color: #ff8b8b;
}

.node-in .node-status {
    color: #92f0c8;
}

.node-villain {
    border-color: rgba(255, 214, 133, 0.5);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(255, 188, 96, 0.2);
}

.node-top { top: 7%; left: 50%; }
.node-mtr { top: 16%; left: 74%; }
.node-tr { top: 28%; left: 89%; }
.node-br { top: 62%; left: 89%; }
.node-bl { top: 62%; left: 11%; }
.node-tl { top: 28%; left: 11%; }

.node.hero {
    top: 100%; left: 50%;
    width: 64px;
    height: 64px;
    flex-direction: column;
    gap: 1px;
    border-color: rgba(128, 255, 202, 0.62);
    color: #fff;
    background: radial-gradient(circle at 30% 30%, rgba(36, 195, 144, 0.82), rgba(14, 95, 74, 0.9));
}

.node.hero .stack {
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0.95;
}

.dealer-btn {
    position: absolute;
    top: -10px;
    left: -15px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #000;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
}

.villain-action-box {
    position: absolute;
    top: calc(28% + 38px);
    left: 11%;
    transform: translateX(-50%);
    background: rgba(12, 15, 20, 0.94);
    padding: 6px 10px;
    border-radius: 12px;
    z-index: 3;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.villain-pos-tag {
    color: rgba(255, 231, 186, 0.95);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.villain-action-text {
    color: var(--warning-color);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
}

.villain-action-amt {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    margin-top: 2px;
}

.center-info {
    text-align: center;
    z-index: 1;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(6, 24, 19, 0.66);
    border: 1px solid rgba(164, 245, 212, 0.16);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.25);
    max-width: min(82%, 320px);
}

.sit-text {
    color: var(--muted-color);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.hand-history {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
}

.history-chip {
    font-size: 10px;
    border-radius: 999px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    line-height: 1.2;
    white-space: nowrap;
}

.history-chip.past {
    color: #c8d0db;
    background: rgba(255, 255, 255, 0.08);
}

.history-chip.current {
    color: #d8f9e8;
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.35);
}

.history-chip.future {
    color: #9ba7b6;
    background: rgba(255, 255, 255, 0.03);
}

.pot-text {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
}

.hero-legend {
    margin-bottom: 12px;
    color: #cfd6df;
    font-size: 12px;
    font-weight: 600;
}

.board-cards,
.hero-cards {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cards {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
}

.card {
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: white;
    font-weight: 800;
    position: relative;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.22);
    overflow: hidden;
}

.card.board { width: 40px; height: 56px; font-size: 20px; }
.card.hero { width: 48px; height: 68px; font-size: 24px; }

.rank {
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1;
}

.suit-mini {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.26);
    border: 1px solid rgba(255, 255, 255, 0.32);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.card.board .suit-mini {
    width: 14px;
    height: 14px;
    font-size: 11px;
}

.card.hero .suit-mini {
    width: 18px;
    height: 18px;
    font-size: 13px;
}

.s-h .suit-mini {
    color: #ffd7d7;
}

.s-d .suit-mini {
    color: #dff1ff;
}

.s-c .suit-mini {
    color: #e0ffe6;
}

.s-s .suit-mini {
    color: #ffffff;
    background: rgba(12, 16, 22, 0.55);
}

.s-h {
    background: linear-gradient(160deg, #ff6b6b 0%, #d43d3d 100%);
    border-color: rgba(255, 226, 226, 0.8);
}

.s-d {
    background: linear-gradient(160deg, #4db7ff 0%, #1e78cf 100%);
    border-color: rgba(224, 244, 255, 0.85);
}

.s-c {
    background: linear-gradient(160deg, #57d179 0%, #24954a 100%);
    border-color: rgba(225, 255, 231, 0.85);
}

.s-s {
    background: linear-gradient(160deg, #5d6572 0%, #232933 100%);
    border-color: rgba(236, 242, 252, 0.9);
}

.controls-area {
    width: 100%;
    padding: 12px 0 8px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 560px;
    margin: 0 auto;
}

.btn-action {
    border: none;
    border-radius: 14px;
    padding: 16px 18px;
    min-height: 56px;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.06em;
    color: white;
    text-transform: uppercase;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-action:not(:disabled):hover,
.btn-action:not(:disabled):focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.btn-action:active { opacity: 0.8; }

.btn-action:disabled,
.btn-action.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-raise {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    grid-column: span 2;
}

.btn-fold {
    background: linear-gradient(135deg, #404040 0%, #2a2a2a 100%);
    color: #e8e8e8;
}

.btn-call {
    background: linear-gradient(135deg, #58c96b 0%, #36a84e 100%);
}

.btn-check {
    background: linear-gradient(135deg, #58c96b 0%, #36a84e 100%);
}

#feedback-overlay {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 20px;
    background: transparent;
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 14px;
    pointer-events: none;
}

#feedback-container {
    max-width: 760px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 18px;
    background: rgba(11, 16, 26, 0.9);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(8px);
    pointer-events: auto;
}

.feedback-title {
    font-size: clamp(20px, 3.8vw, 28px);
    margin-bottom: 10px;
    text-align: left;
}

.feedback-text {
    font-size: 14px;
    color: #ccc;
    line-height: 1.55;
    margin-bottom: 14px;
    text-align: left;
}

.feedback-section {
    margin-bottom: 8px;
}

.feedback-tip {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(79, 195, 247, 0.12);
    border: 1px solid rgba(79, 195, 247, 0.25);
}

.btn-next {
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    background: #fff;
    color: #000;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: block;
    margin-left: auto;
}

.correct .feedback-title { color: var(--success-color); }
.correct .feedback-text { color: #ccc; }

.incorrect .feedback-title { color: var(--danger-color); }

.stats-modal {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: rgba(7, 10, 15, 0.68);
}

.stats-card {
    width: min(100%, 640px);
    max-height: 78vh;
    overflow: auto;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(11, 18, 28, 0.96);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.stats-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stats-head h3 {
    margin: 0;
    font-size: 20px;
}

.stats-close {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    font-size: 15px;
}

.stats-summary {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(79, 195, 247, 0.14);
    border: 1px solid rgba(79, 195, 247, 0.22);
    font-weight: 700;
}

.stats-block {
    margin-bottom: 14px;
}

.stats-block h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #d7e0eb;
}

.stats-list {
    display: grid;
    gap: 8px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 13px;
}

.stats-row.muted {
    color: #9fafc5;
}

@media (max-width: 760px) {
    body.page-trainer {
        padding: 12px 12px 16px;
    }

    .top-bar {
        padding: 12px 14px;
    }

    .difficulty-badge {
        font-size: 11px;
        padding: 6px 10px;
    }

    .table-ring {
        width: min(100%, 420px);
        border-radius: 38% / 46%;
        padding: 24px 18px;
    }

    .node {
        width: 48px;
        height: 48px;
        font-size: 11px;
    }

    .node-top { top: 8%; left: 50%; }
    .node-mtr { top: 17%; left: 73%; }
    .node-tr { top: 27%; left: 89%; }
    .node-br { top: 62%; left: 89%; }
    .node-bl { top: 62%; left: 11%; }
    .node-tl { top: 27%; left: 11%; }

    .hero-cards {
        bottom: 22px;
    }

    .actions-grid {
        gap: 10px;
    }

    .btn-action {
        min-height: 58px;
        font-size: 13px;
        padding: 16px 14px;
    }

    #feedback-overlay {
        bottom: 14px;
        padding: 10px;
    }

    #feedback-container {
        padding: 14px;
    }

    .admin-kpis {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .table-ring {
        width: min(100%, 360px);
        padding: 18px 14px;
    }

    .node {
        width: 42px;
        height: 42px;
        font-size: 10px;
    }

    .node-status {
        font-size: 7px;
    }

    .node-mtr {
        top: 18%;
        left: 73%;
    }

    .card.board { width: 34px; height: 50px; font-size: 18px; }
    .card.hero { width: 40px; height: 56px; font-size: 20px; }

    .actions-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .btn-raise {
        grid-column: span 1;
    }
}

/* ---------- Lexique ---------- */

.lexique-container {
    width: 100%;
    max-width: 980px;
    padding: 20px;
}

.lexique-container h1 {
    font-size: clamp(28px, 6vw, 36px);
    text-align: center;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: var(--muted-color);
    margin-bottom: 28px;
    font-size: 14px;
}

.category-title {
    color: var(--accent-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    margin: 36px 0 18px;
}

.category-title:first-of-type {
    margin-top: 0;
}

.lexique-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.lexique-card {
    padding: 18px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lexique-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.lexique-card h3 {
    margin-bottom: 10px;
    color: var(--accent-color);
    font-size: 16px;
}

.lexique-card p {
    color: #ccc;
    line-height: 1.6;
    font-size: 14px;
}

@media (max-width: 760px) {
    .solver-header,
    .advanced-header,
    .home-cards,
    .lexique-grid,
    .cards,
    .actions-grid {
        grid-template-columns: 1fr;
    }

    .advanced-grid,
    .grid-container {
        max-width: 100%;
    }
}
