:root{color-scheme:dark;--terra-text:#eef6ed;--terra-muted:#bad1bf;--terra-accent:#b6e58f;--terra-panel:rgba(18,43,34,.94);--terra-border:rgba(144,197,153,.36);font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;background:#0e1d19;color:var(--terra-text);line-height:1.55}
[hidden]{display:none!important}
.terra-ambient-bg{position:fixed;inset:0;z-index:0;pointer-events:none}
.terra-home{position:relative;z-index:1;max-width:1320px;min-height:100vh;margin:0 auto;padding:14px clamp(12px,3vw,38px) 24px}
.terra-home-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 4px 18px}
.terra-home-brand{font-size:clamp(22px,3vw,31px);font-weight:900;letter-spacing:.11em;color:#e2ffc4;text-decoration:none}
.terra-home-brand small{font-size:13px;letter-spacing:.07em;display:block;color:var(--terra-muted);font-weight:650}
.terra-home-identity{display:flex;align-items:center;gap:10px;min-width:0}
.terra-home-avatar{width:44px;height:44px;flex:0 0 44px;display:block;object-fit:cover;object-position:center;border-radius:50%;background:#294c3a;border:2px solid #759e77;box-shadow:0 2px 10px #08190f88}
#terra-identity-name{font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:210px}
.terra-home-verified{font-size:13px;background:#28472c;padding:4px 7px;border:1px solid #7bb77e;border-radius:8px;color:#d9ffd5}
.terra-home-locked{font-size:13px;color:#f5dfb6;background:#493923;border:1px solid #b99969;border-radius:8px;padding:4px 7px}
.terra-home-verify-link{font:inherit;font-size:13px;font-weight:750;color:#e7f5d5;background:transparent;border:0;text-decoration:underline;text-underline-offset:3px;padding:4px 3px;cursor:pointer;white-space:nowrap}
.terra-home-verify-link:hover{color:#fff}
.terra-home-reward-warning{display:flex;flex-wrap:wrap;align-items:center;gap:10px 20px;border:1px solid #b8aa83;border-radius:10px;background:rgba(34,37,32,.94);padding:14px 17px;margin:12px 0 20px}
.terra-home-reward-warning strong{flex:1;min-width:min(100%,320px)}
.terra-home-reward-warning a,.terra-home-reward-warning button{font:inherit;font-weight:750;color:#e9f5dc;background:transparent;border:0;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.terra-home-account-action{border:1px solid var(--terra-border);color:#e0f5d9;background:#244333;border-radius:9px;padding:8px 11px;cursor:pointer;font:inherit}
.terra-home-tabs{display:flex;flex-wrap:wrap;gap:5px;align-items:center;border:1px solid var(--terra-border);padding:6px;border-radius:15px;background:rgba(14,34,29,.96);box-shadow:0 8px 25px #0007;position:sticky;top:6px;z-index:5}
.terra-home-tabs button,.terra-home-tabs a{border:0;border-radius:9px;padding:11px clamp(8px,1.4vw,17px);background:transparent;color:var(--terra-text);text-decoration:none;cursor:pointer;font:inherit;font-size:14px;font-weight:700;white-space:nowrap}
.terra-home-tabs button:hover,.terra-home-tabs a:hover,.terra-home-account-action:hover{background:#315741}
.terra-home-tabs button[aria-current=page]{background:#b5e289;color:#193220}
.terra-home-panel{margin-top:20px;min-height:440px;animation:terra-home-in .18s ease-out}
@keyframes terra-home-in{from{opacity:.3;transform:translateY(5px)}to{opacity:1;transform:none}}
.terra-home-intro{border:1px solid var(--terra-border);border-radius:20px;background:linear-gradient(110deg,rgba(27,66,46,.97),rgba(16,44,37,.92));padding:clamp(22px,4vw,42px);box-shadow:0 10px 36px #0004}
.terra-home-overline{font-size:13px;text-transform:uppercase;letter-spacing:.18em;color:#bdedaf;font-weight:800}
.terra-home h1{font-size:clamp(28px,4vw,45px);line-height:1.16;margin:8px 0 14px}
.terra-home h2{font-size:clamp(19px,2.2vw,24px);margin:0 0 8px}
.terra-home h3{font-size:18px;margin:16px 0 5px}
.terra-home p{margin:8px 0 14px;color:var(--terra-muted)}
.terra-home-intro p{max-width:720px}
.terra-home-resume,.terra-home-actionbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px;margin-top:18px}
.terra-home-resume{padding:18px 22px;border:1px solid #bedb73;border-radius:15px;background:rgba(45,76,41,.94)}
.terra-home-resume p{margin-bottom:0}
.terra-home-actionbar{justify-content:flex-start}
.terra-home-button{display:inline-flex;align-items:center;justify-content:center;padding:12px 19px;border:1px solid #c6e7a3;border-radius:10px;background:#b6e289;color:#16301d;font:inherit;font-weight:800;text-decoration:none;cursor:pointer;min-height:42px}
.terra-home-button:hover{background:#d6f3b0}
.terra-home-button.secondary{background:#264639;color:#ecf8e9;border-color:#698877}
.terra-home-button.secondary:hover{background:#345847}
.terra-home-section-title{display:flex;justify-content:space-between;align-items:center;gap:18px;margin:28px 0 14px}
.terra-home-section-title h2{margin:0}
.terra-home-section-title p{margin:3px 0 0}
.terra-home-mutetime{font-size:13px;color:var(--terra-muted)}
.terra-home-arenas{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.terra-home-arena,.terra-home-card{border:1px solid var(--terra-border);border-radius:16px;background:var(--terra-panel);box-shadow:0 10px 22px #06110b44;overflow:hidden}
.terra-home-arena-thumb{width:100%;aspect-ratio:16/8.5;display:block;object-fit:cover;background:linear-gradient(135deg,#385d48,#193528)}
.terra-home-arena-body{padding:17px}
.terra-home-arena-head{display:flex;justify-content:space-between;gap:9px;align-items:center}
.terra-home-arena h3{font-size:18px;margin:0;color:#f3ffe7}
.terra-home-arena-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.terra-home-arena-stats span{display:flex;flex-direction:column;border-radius:9px;background:#294737;padding:9px;color:#d3e9d5;font-size:13px}
.terra-home-arena-stats strong{color:#fff;font-size:16px}
.terra-home-arena-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:10px}
.terra-home-info{border:1px solid #8fa68b;border-radius:50%;background:#214333;width:32px;height:32px;color:#fff;font:inherit;cursor:pointer}
.terra-home-ruleinfo{margin-top:13px;padding:12px;border-radius:9px;background:#254537;color:#e4f5e4}
.terra-home-ruleinfo p{margin:0}
.terra-home-notice,.terra-home-empty{font-size:13px;color:#d0e6cc}
.terra-home-empty{background:rgba(16,42,34,.92);border:1px solid var(--terra-border);border-radius:12px;padding:19px}
.terra-home-card{padding:clamp(18px,3vw,30px);margin-top:16px;max-width:960px}
.terra-home-facts{display:flex;flex-wrap:wrap;gap:13px;margin:18px 0}
.terra-home-facts span{display:flex;flex-direction:column;gap:4px;background:#294737;border-radius:10px;padding:13px;min-width:165px}
.terra-home-facts strong{color:#d2f5b3}
.terra-home-keybindings{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:9px;margin:20px 0}
.terra-home-key-row{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#294737;padding:10px;border-radius:10px}
.terra-home-key-row button{border:1px solid #83a888;background:#163a2b;color:#ecffe2;border-radius:7px;font:inherit;font-weight:800;cursor:pointer;padding:7px 14px;min-width:50px}
.terra-home-key-row button[aria-pressed=true]{background:#b6e289;color:#16301d}
.terra-home-form{display:grid;gap:9px;max-width:460px;margin:22px 0}
.terra-home-form label{font-size:14px;font-weight:700}
.terra-home-form input{width:100%;padding:11px 13px;border:1px solid #648474;border-radius:9px;background:#0e211a;color:#fff;font:inherit}
.terra-home-form .terra-home-button{justify-self:start;margin-top:8px}
.terra-home-status{border:1px solid #89b18d;border-radius:10px;background:#294936;padding:12px 15px;margin:14px 0}
.terra-home-status[data-error=true]{border-color:#cc7d75;background:#5d2e30}
.terra-home-footer{margin:32px 0 8px;text-align:center;color:#bad1bf;font-size:13px}
@media(max-width:900px){.terra-home-arenas{grid-template-columns:1fr}}
@media(max-width:750px){.terra-home-header{flex-wrap:wrap}.terra-home-tabs{position:static;justify-content:flex-start}.terra-home-tabs button,.terra-home-tabs a{padding:10px 11px;font-size:13px}.terra-home-verified,.terra-home-locked{white-space:nowrap}.terra-home-section-title{align-items:flex-start;flex-direction:column}.terra-home-arenas{grid-template-columns:1fr}.terra-home-card{margin-top:12px}.terra-home-panel{min-height:350px}}
@media(prefers-reduced-motion:reduce){.terra-home-panel{animation:none}}

/* Competitive ranking: two distinct sources of truth, match results vs wallet. */
.terra-rank-hero{display:flex;align-items:center;justify-content:space-between;gap:22px;padding:clamp(22px,4vw,38px);border-radius:18px;border:1px solid #618e71;background:linear-gradient(110deg,rgba(37,74,55,.97),rgba(12,31,31,.96));box-shadow:0 12px 34px #06150d66}
.terra-rank-hero h1{margin:8px 0 10px}
.terra-rank-hero p{max-width:660px;margin:0}
.terra-rank-hero-emblem{flex:0 0 auto;font-size:clamp(52px,7vw,98px);line-height:1;filter:drop-shadow(0 7px 15px #0008)}
.terra-rank-controls{display:flex;justify-content:space-between;align-items:flex-end;gap:15px;flex-wrap:wrap;margin:18px 0}
.terra-rank-periods{display:flex;align-items:center;gap:6px;padding:5px;border:1px solid #537d63;background:rgba(13,36,28,.92);border-radius:12px}
.terra-rank-periods button{padding:10px 16px;border:0;border-radius:8px;background:none;color:#e1ecdd;cursor:pointer;font:inherit;font-size:14px;font-weight:750}
.terra-rank-periods button[aria-pressed=true]{background:#b6e289;color:#14301d}
.terra-rank-periods button:hover:not([aria-pressed=true]){background:#2c533d}
.terra-rank-search{display:grid;gap:4px;min-width:min(100%,250px)}
.terra-rank-search-label{font-size:13px;color:var(--terra-muted)}
.terra-rank-search input{min-width:0;width:100%;background:#112b21;border:1px solid #648570;border-radius:9px;color:#fff;padding:11px 14px;font:inherit}
.terra-rank-overview{display:grid;grid-template-columns:minmax(0,1fr) minmax(200px,265px);gap:14px;margin-bottom:18px}
.terra-rank-podium{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:end;gap:10px;min-height:224px}
.terra-rank-podium>.terra-home-notice{grid-column:1/-1;align-self:center}
.terra-rank-podium-player{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:6px;min-width:0;padding:20px 9px 14px;border:1px solid #607960;border-radius:14px;background:linear-gradient(160deg,#294738,#18362c);min-height:190px}
.terra-rank-podium-player[data-rank="1"]{order:2;min-height:224px;border-color:#e7cb6a;background:linear-gradient(145deg,#71602c,#234237 62%,#18352c);box-shadow:0 6px 26px #d4b75626}
.terra-rank-podium-player[data-rank="2"]{order:1;border-color:#a8c2ba}
.terra-rank-podium-player[data-rank="3"]{order:3;border-color:#af886f}
.terra-rank-podium-medal{font-size:25px;line-height:1}
.terra-rank-podium-avatar{width:52px;height:52px;display:grid;place-items:center;border:2px solid #bbd2b7;border-radius:50%;background:#142e23;color:#e2efcf;font-size:22px;font-weight:850}
.terra-rank-podium-name{font-weight:850;color:#f4ffe9;max-width:100%;overflow-wrap:anywhere;line-height:1.25;font-size:14px}
.terra-rank-podium-wins{font-weight:850;font-size:19px;color:#e2ffce}
.terra-rank-podium-sub{font-size:13px;color:#c8d9c7}
.terra-rank-side{display:flex;flex-direction:column;gap:11px;border:1px solid var(--terra-border);background:rgba(14,37,31,.95);border-radius:14px;padding:18px}
.terra-rank-side>div{padding:12px;border-radius:9px;background:#2a4938}
.terra-rank-side span{display:block;font-size:13px;color:var(--terra-muted)}
.terra-rank-side strong{font-size:26px;color:#e6ffca;font-variant-numeric:tabular-nums}
.terra-rank-side p{font-size:13px;margin:0}
.terra-rank-table-wrap{border:1px solid var(--terra-border);border-radius:14px;overflow-x:auto;max-width:100%;background:rgba(14,36,29,.95)}
.terra-rank-table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums;min-width:760px}
.terra-rank-table th,.terra-rank-table td{padding:12px 15px;text-align:left;white-space:nowrap}
.terra-rank-table th{color:#cce9bf;font-size:13px;letter-spacing:.05em;text-transform:uppercase;background:#284535}
.terra-rank-table td{font-size:14px;border-top:1px solid #51746159}
.terra-rank-table tbody tr:nth-child(2n){background:rgba(43,77,54,.25)}
.terra-rank-table tbody tr:hover{background:rgba(96,134,75,.2)}
.terra-rank-table td:nth-child(n+3),.terra-rank-table th:nth-child(n+3){text-align:right}
.terra-rank-ord{font-size:16px;font-weight:850;color:#e9e5c2}
.terra-rank-player{display:flex;align-items:center;gap:10px;min-width:0}
.terra-rank-mini-avatar{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:50%;background:#3b6447;color:#eefbe5;font-weight:850}
.terra-rank-player-name{display:block;font-weight:750;overflow:hidden;text-overflow:ellipsis;max-width:230px}
.terra-rank-origin{display:block;color:#a5c2a7;font-size:13px}
.terra-rank-victories{font-weight:800;color:#dff6bc}
.terra-rank-winrate{font-weight:750}
.terra-rank-winrate-meter{height:4px;width:70px;background:#48614a;border-radius:9px;overflow:hidden;margin:6px 0 0 auto}
.terra-rank-winrate-meter span{display:block;height:100%;background:#bbdf7f}
.terra-rank-table-wrap:focus-visible{outline:2px solid #caecad;outline-offset:3px}
@media(max-width:980px){.terra-rank-overview{grid-template-columns:1fr}.terra-rank-side{flex-direction:row;flex-wrap:wrap}.terra-rank-side>div{flex:1;min-width:145px}.terra-rank-side p{flex:1;min-width:190px}}
@media(max-width:650px){.terra-rank-hero{padding:19px}.terra-rank-hero-emblem{font-size:49px}.terra-rank-overview{gap:8px}.terra-rank-podium{gap:5px;min-height:174px}.terra-rank-podium-player{padding:12px 5px;min-height:153px}.terra-rank-podium-player[data-rank="1"]{min-height:178px}.terra-rank-podium-avatar{height:38px;width:38px;font-size:16px}.terra-rank-podium-name{font-size:13px}.terra-rank-podium-wins{font-size:16px}.terra-rank-podium-sub{font-size:13px}.terra-rank-periods{width:100%}.terra-rank-periods button{flex:1;font-size:13px;padding:10px 8px}.terra-rank-search{width:100%}}

.terra-home-fog-private{display:grid;place-items:center;min-height:150px;padding:20px;text-align:center;border:1px dashed #64816b;background:#162b25;color:#d0e7cd;font-weight:750}

.terra-rank-mini-avatar,.terra-rank-podium-avatar{overflow:hidden}
.terra-rank-mini-avatar img,.terra-rank-podium-avatar img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%}
.terra-home-arena-thumb[hidden]{display:none}

/* Private match history: responsive metrics and a horizontally scrollable ledger. */
.terra-history-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:20px 0}
.terra-history-summary>div{display:grid;gap:8px;padding:18px 16px;border:1px solid var(--terra-border);background:rgba(18,48,37,.94);border-radius:13px}
.terra-history-summary small{font-size:13px;color:var(--terra-muted)}
.terra-history-summary strong{font-size:clamp(21px,3vw,30px);color:#e6ffca;font-variant-numeric:tabular-nums}
.terra-history-table{min-width:1020px}
.terra-history-table tr[data-outcome="won"] td:nth-child(3){color:#b9e8ac;font-weight:800}
.terra-history-table tr[data-outcome="lost"] td:nth-child(3){color:#f3b9ab;font-weight:800}
@media(max-width:680px){.terra-history-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.terra-history-summary>div{padding:13px}}

/* Boutique Terra : présentation neutre, jamais de bouton actif pour les joueurs. */
.terra-shop-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:14px;margin:18px 0 26px}
.terra-shop-item{display:flex;flex-direction:column;align-items:flex-start;gap:9px}
.terra-shop-item h3{margin:0;font-size:1.05rem}
.terra-shop-item .terra-home-button{margin-top:auto}
.terra-shop-item .terra-home-button:disabled{opacity:.53;cursor:not-allowed}
