/* on global.css 
:root {
    --nintendo-red: #0065b3;
    --nintendo-red-dark: #003E6D;
    --background: #f3f4f6;
    --panel: #ffffff;
    --text: #111111;
    --muted: #666666;
    --border: #d7d7d7;
}
*/
/* BASE */
:root {
    --background: #f3f4f6;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    background: var(--background);
    color: var(--text);
}

/* MENU bleu */

.main-header {
    width: 100%;
    background: var(--nintendo-red);
    color: white;
    padding: 0.6rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-menu {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.main-menu a,
.main-menu button {
    color: white;
    background: rgba(255, 255, 255, 0.16);
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}

.main-menu a:hover,
.main-menu button:hover {
    background: rgba(255, 255, 255, 0.28);
}

.main-menu .brand {
    margin-right: auto;
    background: transparent;
    font-weight: 900;
}

/* DROPDOWN FIX */


.dropdown {
    position:relative;
}

.dropdown-content {
    position:absolute;
    right:0;
    top:100%;
    min-width:180px;
    background:white;
    border:1px solid #d7d7d7;
    border-radius:12px;
    box-shadow:0 8px 24px rgba(0,0,0,.12);
    z-index:9999;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translateY(6px);
    transition:.15s;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translateY(0);
}

.dropdown-content a {
    display:block;
    color:#111 !important;
    background:white !important;
    padding:10px 14px;
    text-decoration:none;
    border-radius:0;
}

.dropdown-content a:hover,
.dropdown-content a:focus {
    background:#f3f4f6 !important;
    color:var(--nintendo-red) !important;
}

@media(max-width:700px) {
    .dropdown {
        width:100%;
    }

    .dropdown > button {
        width:100%;
        text-align:left;
    }

    .dropdown-content {
        position:static;
        display:none;
        opacity:1;
        visibility:visible;
        pointer-events:auto;
        transform:none;
        margin-top:6px;
        width:100%;
    }

    .dropdown:hover .dropdown-content,
    .dropdown:focus-within .dropdown-content {
        display:block;
    }
}

/* LAYOUT */

main,
.page,
.container {
    width: 80%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

main,
.page,
.container {
    padding: 24px 0 40px;
}

/* TITRES */

h1 {
    margin: 0 0 14px;
    font-size: 1.8rem;
    line-height: 1.15;
    color: #111;
}

h2 {
    margin: 20px 0 12px;
    font-size: 1.15rem;
    color: var(--nintendo-red);
}

h3 {
    margin: 16px 0 10px;
    font-size: 1rem;
    color: var(--nintendo-red);
}

a {
    color: var(--nintendo-red);
}

/* CARTES */

.card,
fieldset,
.table-box,
.latest-gp {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.card {
    padding: 16px;
    margin-bottom: 12px;
}

.score {
    float: right;
    font-size: 2rem;
    line-height: 1;
    font-weight: 900;
    color: var(--nintendo-red);
}

.rank {
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--nintendo-red);
}

.racer-name {
    font-size: 1.2rem;
    font-weight: 900;
    color: #111;
}

.meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

/* FORMULAIRES */

form {
    margin-top: 18px;
}

fieldset {
    padding: 16px;
    margin-bottom: 14px;
}

legend {
    padding: 0 8px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--nintendo-red);
}

label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #333;
}

input,
select,
textarea {
    width: 100%;
    background: white;
    color: black;
    border: 1px solid #cccccc;
    border-radius: 8px;
    padding: 9px 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--nintendo-red);
    box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.15);
}

button,
.button,
input[type="submit"] {
    background: var(--nintendo-red);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
    background: var(--nintendo-red-dark);
}

/* GRILLE JOUEURS */

.racer-row {
    display: grid;
    grid-template-columns: 1.5fr 0.6fr 0.6fr 1.5fr 1fr 1fr;
    gap: 10px;
    align-items: end;
}

/* TABLES */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    color: #111;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

th,
td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
}

th {
    background: #fafafa;
    color: var(--nintendo-red);
    font-size: 0.78rem;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: none;
}

/* IMAGES PERSONNAGES */

.character-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

/* IMAGES kart */

.kart-select-wrap {
    display:flex;
    align-items:center;
    gap:8px;
}

.kart-preview-slot {
    width:36px;
    height:36px;
    border-radius:50%;
    background:#d9d9d9;
    border:1px solid #bdbdbd;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.kart-preview-slot.is-filled {
    background:#f3f4f6;
}

.kart-preview {
    width:34px;
    height:34px;
    object-fit:contain;
    display:none;
}

.kart-preview-slot.is-filled .kart-preview {
    display:block;
}

.kart-select-wrap select {
    flex:1;
}

/* FOOTER */

footer {
    padding: 24px 0;
    color: var(--muted);
    font-size: 0.85rem;
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .main-menu {
        align-items: flex-start;
    }

    .racer-row {
        grid-template-columns: 1fr;
    }

    .score {
        float: none;
        display: block;
        margin-bottom: 6px;
    }

    .dropdown-content {
        position: static;
        margin-top: 8px;
    }
}

/* WHAT CUP */

.what-cup-intro {
    margin-bottom: 18px;
    color: #555;
    max-width: 760px;
}

.what-cup-form {
    background: white;
    border: 1px solid #d7d7d7;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 22px;
    box-shadow: 0 3px 12px rgba(0,0,0,.05);
}

.racer-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f8f8;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font-weight: 700;
    color: #111;
}

.checkbox-card:hover {
    border-color: var(--nintendo-red);
    background: #fff5f5;
}

.checkbox-card input {
    width: auto;
    margin: 0;
}

.recommendation-main {
    background: white;
    border: 2px solid var(--nintendo-red);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(230,0,18,.12);
}

.recommendation-label {
    display: inline-block;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--nintendo-red);
    color: white;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.recommendation-main h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: var(--nintendo-red);
}

.interest-score {
    color: #666;
    font-size: .9rem;
    margin-bottom: 12px;
}

.reason-list {
    margin: 0;
    padding-left: 18px;
}

.reason-list li {
    margin-bottom: 5px;
}

.suggestions-grid {
    display: grid;
    gap: 12px;
}

.suggestion-card {
    background: white;
    border: 1px solid #d7d7d7;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,.04);
}

.suggestion-card h3 {
    margin: 0 0 6px;
    color: var(--nintendo-red);
}

.suggestion-score {
    color: #666;
    font-size: .85rem;
    margin-bottom: 8px;
}


/* WHAT CUP ANIMATION */

.cup-reveal {
    animation: cupReveal .55s ease-out both;
    position: relative;
    overflow: hidden;
}

.cup-reveal::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(230, 0, 18, .12) 45%,
        transparent 75%
    );
    transform: translateX(-100%);
    animation: cupShine 1.2s ease-out .2s both;
    pointer-events: none;
}

@keyframes cupReveal {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cupShine {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

/* CUP TELEMETRY */

.cup-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.cup-telemetry-card {
    background: white;
    border: 1px solid #d7d7d7;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

.cup-card-header {
    margin-bottom: 12px;
}

.cup-meta-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.difficulty-badge,
.run-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .75rem;
    font-weight: 800;
    color: white;
}

.run-tag {
    background: #f3f4f6;
    color: #333;
    border: 1px solid #e2e2e2;
}

.cup-card-header h4 {
    margin: 0;
    color: var(--nintendo-red);
    font-size: 1.25rem;
    font-weight: 900;
}

.track-intel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 12px 0 14px;
}

.track-chip {
    display: inline-block;
    background: #f3f4f6;
    border: 1px solid #e1e1e1;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .68rem;
    font-weight: 600;
    color: #111;
    font-style: italic;
}

.muted-chip {
    color: #777;
    font-style: italic;
}

.cup-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.c-stat {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
}

.c-label {
    display: block;
    color: #666;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.c-val {
    display: block;
    color: #111;
    font-size: 1.15rem;
    font-weight: 900;
}

.c-val--red {
    color: var(--nintendo-red);
}

.cup-podium-box {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 12px;
}

.cup-podium-box h5 {
    margin: 0 0 8px;
    color: #333;
    font-size: .85rem;
    text-transform: uppercase;
}

.podium-entry {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #e7e7e7;
}

.podium-entry:last-child {
    border-bottom: none;
}

.pod-rank {
    font-weight: 900;
}

.pod-name {
    font-weight: 800;
}

.pod-ppg {
    font-weight: 900;
    color: #111;
}

.podium-empty {
    display: block;
    color: #777;
    font-style: italic;
}

/* RECORD BOOK */


.record-card.record-positive::before {
    border-top: 5px solid var(--nintendo-red);
}

.record-card.record-positive .record-winner {
    color: var(--nintendo-red);
}

.record-card.record-shame::before{
    border-top: 5px solid #111;
}

.record-card.record-shame .record-winner {
    color: #111;
}

.record-card.record-shame .record-icon {
    filter: grayscale(.2);
}

.record-card.record-green::before {
    border-top: 5px solid #2e8b57;
}

.record-card.record-green .record-winner {
    color: #2e8b57;
}




.records-intro {
    max-width: 720px;
    color: #555;
    margin-bottom: 22px;
}

.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 18px;
}

.record-card {
    position: relative;
    background: white;
    border: 1px solid #d7d7d7;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0,0,0,.06);
    overflow: hidden;
}

.record-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-top: 5px solid var(--nintendo-red);
    pointer-events: none;
}

.record-icon {
    font-size: 1.7rem;
    margin-bottom: 8px;
}

.record-card h3 {
    margin: 0 0 14px;
    color: #222;
    font-size: 1rem;
    text-transform: uppercase;
}

.record-winner {
    color: var(--nintendo-red);
    font-size: 1.15rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.record-winner strong {
    color: #111;
}

.record-sub {
    color: #666;
    font-size: .85rem;
    margin-bottom: 12px;
}

.record-runners {
    margin: 0;
    padding-left: 20px;
    color: #333;
    font-size: .9rem;
}

.record-runners li {
    margin-bottom: 5px;
}

.record-empty {
    color: #777;
    font-style: italic;
}


/* NEWS */

.news-card {
    background: white;
    border: 1px solid #d7d7d7;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 14px rgba(0,0,0,.06);
    max-width: 850px;
}

.news-card h2 {
    margin-top: 0;
    color: var(--nintendo-red);
    font-size: 1.6rem;
}

.news-meta {
    color: #666;
    font-weight: 700;
    margin-bottom: 18px;
}

.news-alert {
    background: #fff7d9;
    border-left: 5px solid #ffd700;
    padding: 12px;
    border-radius: 10px;
}

.news-shame {
    background: #f1f1f1;
    border-left: 5px solid #111;
    padding: 12px;
    border-radius: 10px;
}

.news-results {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.news-result-row {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    gap: 12px;
    align-items: center;
    background: #fafafa;
    border-radius: 10px;
    padding: 10px 12px;
}

.news-result-row.winner {
    background: #fff7d9;
    border-left: 5px solid #ffd700;
}

.news-result-row.podium {
    border-left: 5px solid #c0c0c0;
}

.news-result-row span {
    color: var(--nintendo-red);
    font-weight: 900;
}

.news-result-row em {
    font-style: normal;
    font-weight: 900;
}

/* ADD RESULT HEADER */

.gp-header-row {
    display: grid;
    grid-template-columns: 220px 180px 1fr;
    gap: 16px;
    align-items: end;
    margin-bottom: 24px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group input,
.field-group select {
    width: 100%;
}


/* ADD RESULT RACERS TABLE */

.gp-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #d7d7d7;
    border-radius: 14px;
    overflow: hidden;
}

.gp-table th {
    background: var(--nintendo-red);
    color: white;
    padding: 10px;
    text-align: left;
    font-size: .78rem;
    text-transform: uppercase;
}

.gp-table td {
    padding: 10px;
    border-bottom: 1px solid #eeeeee;
}

.gp-table select,
.gp-table input[type="text"],
.gp-table input[type="number"] {
    width: 100%;
    margin-bottom: 0;
}

.gp-table input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* character in gp-table */
.character-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.character-preview-slot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid #bdbdbd;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.character-preview-slot.is-filled {
    background: #f3f4f6;
}

.character-preview {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: none;
}

.character-preview-slot.is-filled .character-preview {
    display: block;
}

.character-select-wrap select {
    flex: 1;
}

.readonly-field {
    background: #f3f4f6;
    color: #666;
    cursor: not-allowed;
    user-select: none;
}

/* RESPONSIVE */
@media (max-width: 900px) {

    .gp-header-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .gp-table {
        border: none;
        background: transparent;
    }

    .gp-table thead {
        display: none;
    }

    .gp-table,
    .gp-table tbody,
    .gp-table tr {
        display: block;
        width: 100%;
    }

    .gp-table tr {
        display: grid;
        gap: 8px;
        background: white;
        border: 1px solid #d7d7d7;
        border-radius: 14px;
        padding: 14px;
        margin-bottom: 16px;
    }

    .gp-table td {
        display: grid;
        grid-template-columns: 110px 1fr;
        gap: 12px;
        align-items: center;
        padding: 6px 0;
        border: none;
    }

    .gp-table td::before {
        content: attr(data-label);
        font-size: .78rem;
        font-weight: 800;
        color: var(--nintendo-red);
        text-transform: uppercase;
    }

    .gp-table td select,
    .gp-table td input[type="text"],
    .gp-table td input[type="number"] {
        width: 100%;
        margin: 0;
    }

    .gp-table td input[type="checkbox"] {
        width: 22px;
        height: 22px;
        margin: 0;
    }

}

/* FOOTER */

.main-footer {
    margin-top: 40px;
    background: var(--nintendo-red);
    color: white;
    padding: 15px 0;
    box-shadow: 0 -4px 12px rgba( 0, 0, 0, .15 );
}

.footer-content {
    display:flex;
    justify-content:space-around;
    align-items:center;
    gap:20px;
}

.footer-brand {
    font-size:1rem;
    font-weight:900;
}

.footer-sub {
    margin-top:4px;
    font-size:.82rem;
    opacity:.85;
}

.footer-right {
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.footer-right a, .main-footer a {
    color:white;
    text-decoration:none;
    padding: 8px 12px;
    border-radius:999px;
    background:rgba( 255,255,255,.15);
    transition:.2s;
}

.footer-right a:hover, .main-footer a:hover {
    background: rgba(255, 255,255,.25 );
}

.main-footer p {margin:0;}

/* MOBILE */

@media (max-width:768px){
    .footer-content{
        flex-direction:column;
        text-align:center;
    }

    .footer-right{
        justify-content:center;
    }
}

.news-grid-2 {
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:20px;
}

@media(max-width:700px){
    .news-grid-2{
        grid-template-columns:1fr;
    }
}


.character-cell {
    display:flex;
    align-items:center;
    gap:8px;
}

.character-cell img {
    width:28px;
    height:28px;
    object-fit:contain;
    border-radius:50%;
    background:#f3f4f6;
    border:1px solid #d7d7d7;
}




.racer-page{padding-top:24px;}
.back-link{display:inline-block;margin-bottom:14px;color:var(--nintendo-red);font-weight:700;text-decoration:none;}
.racer-hero-card{display:grid;grid-template-columns:1fr 1.4fr;gap:20px;background:white;border:1px solid #d7d7d7;border-radius:18px;padding:22px;box-shadow:0 4px 14px rgba(0,0,0,.06);margin-bottom:20px;}
.racer-hero-left{display:flex;align-items:center;gap:18px;}
.racer-hero-avatar{width:110px;height:110px;object-fit:contain;border-radius:50%;background:#f3f4f6;border:1px solid #d7d7d7;}
.racer-hero-card h1{margin:0;font-size:2rem;color:#111;}
.racer-nickname{margin-top:6px;color:#666;font-weight:800;}
.racer-hero-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;}
.racer-hero-stats div,.stat-list div{background:#f8f8f8;border:1px solid #e8e8e8;border-radius:12px;padding:12px;}
.racer-hero-stats span,.stat-list span{display:block;color:#666;font-size:.75rem;font-weight:800;text-transform:uppercase;margin-bottom:4px;}
.racer-hero-stats strong,.stat-list strong{font-size:1.35rem;color:var(--nintendo-red);}
.racer-section-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px;}
.racer-panel{background:white;border:1px solid #d7d7d7;border-radius:16px;padding:18px;box-shadow:0 4px 14px rgba(0,0,0,.05);margin-bottom:18px;}
.racer-panel h2{margin-top:0;color:var(--nintendo-red);}
.stat-list{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;}
.favorite-character-list{display:grid;gap:10px;}
.favorite-character{display:flex;align-items:center;gap:10px;background:#f8f8f8;border-radius:12px;padding:10px;}
.favorite-character img{width:42px;height:42px;object-fit:contain;border-radius:50%;background:#eee;}
.favorite-character span{display:block;color:#666;font-size:.85rem;}
.recent-form-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;}
.recent-form-item{background:#f8f8f8;border-left:4px solid #ccc;border-radius:12px;padding:10px;}
.recent-form-item.winner{border-left-color:#ffd700;background:#fff8dd;}
.recent-form-item.podium{border-left-color:#c0c0c0;}
.recent-form-item span,.recent-form-item em{display:block;color:#666;font-size:.82rem;}
.recent-form-item strong{display:block;color:#111;font-size:1.1rem;}
.cup-mastery-summary{display:flex;justify-content:space-between;gap:10px;align-items:center;background:#fff7d9;border-radius:12px;padding:12px;margin-bottom:12px;}
.cup-mastery-summary strong{color:var(--nintendo-red);font-size:1.3rem;}
.cup-mastery-summary span{color:#555;font-weight:700;}
.cup-mastery-grid{display:grid;gap:8px;}
.cup-mastery-item{display:grid;grid-template-columns:48px 1fr auto;gap:10px;align-items:center;background:#f8f8f8;border-radius:10px;padding:10px;}
.cup-mastery-item.counted{border-left:4px solid var(--nintendo-red);}
.cup-mastery-item.dropped{opacity:.75;}
.cup-mastery-rank{font-weight:900;color:var(--nintendo-red);}
.cup-mastery-item span{display:block;color:#666;font-size:.82rem;}
.cup-mastery-score{font-weight:900;color:#111;}
.racer-results-table{width:100%;border-collapse:collapse;background:white;}
.racer-results-table th,.racer-results-table td{padding:10px;border-bottom:1px solid #eee;text-align:left;}
.character-cell{display:flex;align-items:center;gap:8px;}
.character-cell img{width:28px;height:28px;object-fit:contain;border-radius:50%;background:#f3f4f6;border:1px solid #d7d7d7;}
.muted{color:#999;}

@media(max-width:850px){.racer-hero-card,.racer-section-grid{grid-template-columns:1fr;}.racer-hero-stats{grid-template-columns:repeat(2,1fr);}.stat-list{grid-template-columns:1fr;}.racer-results-table{font-size:.85rem;}}
.racer-results-wrapper {    width:100%;    overflow-x:auto;    -webkit-overflow-scrolling:touch;}
.racer-results-table {    width:100%;    min-width:760px;    border-collapse:collapse;    background:white;}
.racer-results-table th,
.racer-results-table td {    padding:10px;    border-bottom:1px solid #eee;    text-align:left;    white-space:nowrap;}

@media(max-width:700px) {
    .racer-results-table {min-width:0;}
    .racer-results-table,
    .racer-results-table thead,
    .racer-results-table tbody,
    .racer-results-table tr,
    .racer-results-table td {display:block; width:100%;}
    .racer-results-table thead { display:none;}
    .racer-results-table tr {background:white; border:1px solid #d7d7d7; border-radius:12px; padding:12px; margin-bottom:12px;}
    .racer-results-table td {display:grid;grid-template-columns:110px 1fr;gap:10px;padding:7px 0; border-bottom:none;white-space:normal;        align-items:center;}
    .racer-results-table td::before {content:attr(data-label);color:var(--nintendo-red);font-size:.75rem;font-weight:800;text-transform:uppercase;}
}


/* RESPONSIVE GLOBAL */

@media (max-width: 900px) {
    .container,
    .content-container,
    .main-content {
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .main-menu {
        flex-wrap: wrap;
        gap: 6px;
    }

    .main-menu .brand {
        width: 100%;
        margin-bottom: 6px;
    }

    h1 {
        font-size: 1.55rem;
    }

    h2 {
        font-size: 1.05rem;
    }

    .racer-card {
        grid-template-columns: 44px 52px 1fr;
        gap: 10px;
        padding: 12px;
    }

    .racer-portrait img {
        width: 46px;
        height: 46px;
    }

    .racer-score {
        grid-column: 1 / -1;
        text-align: left;
        font-size: 1.6rem;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #eee;
    }

    .badge-container {
        gap: 4px;
    }

    .badge-item {
        width: 24px;
        height: 24px;
        font-size: .82rem;
    }

    .gp-header-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .gp-table thead {
        display: none;
    }

    .gp-table,
    .gp-table tbody,
    .gp-table tr,
    .gp-table td {
        display: block;
        width: 100%;
    }

    .gp-table tr {
        background: white;
        border: 1px solid #d7d7d7;
        border-radius: 14px;
        padding: 12px;
        margin-bottom: 14px;
    }

    .gp-table td {
        display: grid;
        grid-template-columns: 105px 1fr;
        gap: 10px;
        align-items: center;
        border: none;
        padding: 7px 0;
    }

    .gp-table td::before {
        content: attr(data-label);
        color: var(--nintendo-red);
        font-size: .75rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .gp-table input,
    .gp-table select {
        margin-bottom: 0;
    }

    .timeline-item,
    .news-card,
    .record-card,
    .cup-telemetry-card,
    .racer-panel,
    .recommendation-main {
        padding: 14px;
    }

    .timeline-meta,
    .cup-meta-top,
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-row,
    .news-result-row,
    .podium-entry {
        grid-template-columns: 42px 1fr auto;
        gap: 8px;
    }

    .news-grid,
    .records-grid,
    .cup-telemetry-grid,
    .racer-section-grid,
    .recent-form-list {
        grid-template-columns: 1fr;
    }

    .racer-hero-card {
        grid-template-columns: 1fr;
    }

    .racer-hero-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .racer-hero-avatar {
        width: 88px;
        height: 88px;
    }

    .racer-hero-stats,
    .stat-list {
        grid-template-columns: 1fr 1fr;
    }

    .cup-stats-row {
        grid-template-columns: 1fr;
    }

    .cup-mastery-item {
        grid-template-columns: 38px 1fr;
    }

    .cup-mastery-score {
        grid-column: 2;
    }

    .racer-results-table thead {
        display: none;
    }

    .racer-results-table,
    .racer-results-table tbody,
    .racer-results-table tr,
    .racer-results-table td {
        display: block;
        width: 100%;
    }

    .racer-results-table tr {
        background: white;
        border: 1px solid #d7d7d7;
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
    }

    .racer-results-table td {
        display: grid;
        grid-template-columns: 105px 1fr;
        gap: 10px;
        border: none;
        padding: 7px 0;
        white-space: normal;
    }

    .racer-results-table td::before {
        content: attr(data-label);
        color: var(--nintendo-red);
        font-size: .75rem;
        font-weight: 800;
        text-transform: uppercase;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 13px;
    }

    .main-menu a,
    .main-menu button {
        font-size: .72rem;
        padding: 7px 10px;
    }

    .racer-card {
        grid-template-columns: 38px 44px 1fr;
    }

    .racer-name-link {
        font-size: 1rem;
    }

    .racer-score {
        font-size: 1.35rem;
    }

    .gp-table td,
    .racer-results-table td {
        grid-template-columns: 90px 1fr;
    }

    .character-select-wrap {
        gap: 6px;
    }

    .character-preview-slot {
        width: 32px;
        height: 32px;
    }

    .character-preview {
        width: 30px;
        height: 30px;
    }

    .racer-hero-stats,
    .stat-list {
        grid-template-columns: 1fr;
    }

    .footer-right {
        justify-content: flex-start;
    }
}

/* MOBILE MENU + NEWS FIX */

@media(max-width:700px){

    .main-menu {
        display:grid !important;
        grid-template-columns:1fr 1fr 1fr;
        gap:8px;
        width:100%;
    }

    .main-menu .brand {
        grid-column:1 / -1;
        width:100%;
        text-align:center;
        margin:0 0 4px 0;
    }

    .main-menu > a:not(.brand),
    .main-menu > button {
        width:100%;
        text-align:center;
        justify-content:center;
    }

    .main-menu .dropdown {
        grid-column:1 / -1;
        width:100%;
    }

    .main-menu .dropdown > button {
        width:100%;
        text-align:center;
    }

    .dropdown-content {
        width:100%;
        min-width:0;
        box-sizing:border-box;
    }

    .dropdown-content a {
        width:100%;
        box-sizing:border-box;
    }


/* NEWS */

.news-page {
    width:100%;
    max-width:100%;
}

.news-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(0,1fr));
    gap:20px;
    width:100%;
    max-width:100%;
}

.news-card {
    width:100%;
    max-width:100%;
    min-width:0;
    overflow:hidden;
    background:white;
    border:1px solid #d7d7d7;
    border-radius:16px;
    padding:18px;
    box-shadow:0 4px 14px rgba(0,0,0,.06);
}

.news-card h2,
.news-card h3,
.news-card p,
.news-card strong,
.news-card em {
    max-width:100%;
    overflow-wrap:break-word;
    word-break:normal;
}

.news-results {
    display:grid;
    gap:8px;
    width:100%;
    max-width:100%;
}

.news-result-row {
    display:grid;
    grid-template-columns:32px minmax(0,1fr);
    gap:8px;
    width:100%;
    max-width:100%;
    min-width:0;
    background:#fafafa;
    border-radius:10px;
    padding:10px;
}

.news-result-row span {
    grid-column:1;
}

.news-result-row strong {
    grid-column:2;
    min-width:0;
    overflow-wrap:break-word;
}

.news-result-row em {
    grid-column:2;
    white-space:normal;
    min-width:0;
    overflow-wrap:break-word;
}

@media(max-width:700px) {
    .news-grid {
        display:block;
    }

    .news-card {
        margin-bottom:16px;
        padding:14px;
    }
}

/* news page */

.news-page {
    overflow-x:hidden;
}

.news-page .news-grid,
.news-page .news-card,
.news-page .news-results,
.news-page .news-result-row {
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
}

.news-page .news-card {
    overflow:hidden;
}

.news-page .news-card p,
.news-page .news-card h2,
.news-page .news-card h3,
.news-page .news-card strong,
.news-page .news-result-row strong,
.news-page .news-result-row em {
    overflow-wrap:anywhere;
    word-break:break-word;
}

@media(max-width:700px) {
    .news-page .news-grid {
        display:block;
        width:100%;
    }

    .news-page .news-card {
        width:100%;
        margin:0 0 16px 0;
        padding:14px;
    }

    .news-page .news-result-row {
        display:grid;
        grid-template-columns:28px minmax(0,1fr);
        gap:8px;
        width:100%;
    }

    .news-page .news-result-row em {
        grid-column:2;
        white-space:normal;
    }
}
