
:root {
  --c-space: #050b12;
  --c-panel: #0b1925;
  --c-panel-deep: #07121b;
  --c-line: #96ddeb4d;
  --c-line-soft: #96ddeb26;
  --c-text: #eaf6fb;
  --c-text-muted: #8da6b6;
  --c-action: #73edff;
  --c-action-ink: #082331;
  --c-action-base: #2fa0c6;
  --g-cyan: #73edff;
  --g-muted: #8da6b6;
  --g-line: #96ddeb30;
}


.c-screen, #home.play-screen {
  background: linear-gradient(115deg, #07151af2, #122a36ee), url('garage/laboratoire.webp') center / cover no-repeat !important;
  color: var(--c-text);
}

.screen.dim { background: #020812b3 !important; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.screen.dim > .card, .screen.dim > div > .card, .card {
  background: linear-gradient(140deg, #203542f5, #08121bf7) !important; border: 1px solid #8fdded70 !important; border-radius: 2px !important;
  box-shadow: 0 30px 100px #000a !important; color: var(--c-text);
}


.c-panel, .c-screen [class*="-panel"]:not(.g-ecran *), .c-screen [class*="-card"]:not(canvas):not(.g-ecran *) {
  border-radius: 2px !important;
}
.c-panel { background: linear-gradient(140deg, #183342cc, #07131cd9) !important; border: 1px solid #73edff30 !important; box-shadow: none !important; }


.screen:not(#hub) :is(button, input, select, textarea, .c-btn, .c-field, .c-choice, .mode-btn, .mode-tile, .sq-btn, .skin-tab, .shop-kind-btn,
  [class*="-tile"], .shop-sections, [class*="-row"], [class*="-box"], [class*="-slot"], [class*="-day"], [class*="-stat"], [class*="-win"], [class*="-bar"]:not(i):not(em)):not(.bal-plus):not(.g-ecran *):not(.round) {
  border-radius: 2px !important;
}
#hud :is(button):not(.bal-plus) { border-radius: 3px; }


.c-btn { background: #0b1925d9 !important; border: 1px solid #96ddeb4d !important; color: var(--c-text) !important; box-shadow: none !important; }
.c-btn:hover { border-color: var(--g-cyan) !important; background: #183342 !important; }
.c-btn.c-primary, .c-primary {
  background: linear-gradient(120deg, #b4f7ff, #59d9f4 55%, #2fa0c6) !important; border: 1px solid #d2ffff !important; color: #062434 !important;
  box-shadow: inset 0 2px 0 #fff8, inset 0 -3px 0 #14536b70 !important; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
}
.c-btn:disabled, .c-primary:disabled { opacity: .45; filter: grayscale(.4); }

.screen:not(#hub) :is(.selected, [aria-selected="true"], [aria-checked="true"], [aria-pressed="true"]):is(button, .c-btn, .mode-btn, .skin-tab, .shop-kind-btn) {
  background: #30617799 !important; border-color: var(--g-cyan) !important; color: var(--g-cyan) !important; box-shadow: inset 0 0 12px #65dbff1c !important;
}
.c-choice { background: #07121bcc !important; border: 1px solid #96ddeb30 !important; }


.c-field, .screen:not(#hub) input:not([type=range]):not([type=checkbox]):not([type=radio]) {
  background: #07131e !important; border: 1px solid #8acfe35c !important; color: #fff !important;
}


.screen-title { text-transform: none !important; letter-spacing: .5px !important; font-size: clamp(20px, 3vw, 30px) !important; color: var(--c-text) !important; }
.c-screen > :first-child:is([class*="-head"], .play-head, .skins-head) { border-bottom: 1px solid #81d8e52e; background: #0b1c27e6; }
.sq-btn { width: 44px !important; height: 36px !important; border-radius: 2px !important; background: #0b1925c9 !important; border: 1px solid #96ddeb4d !important; color: var(--c-text) !important; }
.sq-btn:hover { border-color: var(--g-cyan) !important; }


.c-screen h2, .card h2 { letter-spacing: .5px; }
.c-screen :is(.xp-bar, .road-bar, .quest-bar, [class*="xp-bar"]) { border-radius: 0 !important; }


#tourner { background: radial-gradient(ellipse at center, #173343, #050b12) !important; color: #eaf6fb; }
.welcome-screen .welcome-box { background: linear-gradient(145deg, #183342dc, #07131ced) !important; border: 1px solid #83e4f34a !important; border-radius: 2px !important; }


#skins.shop-screen { padding-left: calc(104px + env(safe-area-inset-left)) !important; }
#skins #shop-kind, #skins #store-title { display: none !important; }
#skins .shop-nav { position: absolute; z-index: 4; left: 0; top: 0; bottom: 0; width: calc(92px + env(safe-area-inset-left)); padding-left: env(safe-area-inset-left);
  display: flex; flex-direction: column; justify-content: center; gap: 6px; border-right: 1px solid #c1ebff16; background: linear-gradient(90deg, #06101de6, #06101d66); }
#skins .shop-nav button { position: relative; width: 84px; min-height: 52px; border: 0 !important; background: none !important; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px; color: #9fb4c4 !important; font: 10px Nunito, system-ui, sans-serif; cursor: pointer; box-shadow: none !important; }
#skins .shop-nav button:hover { color: #eaf6fb !important; }
#skins .shop-nav button.active { color: var(--g-cyan) !important; background: linear-gradient(90deg, #5fd9ee25, transparent) !important; }
#skins .shop-nav button.active::before { content: ''; position: absolute; left: 0; top: 18%; height: 64%; width: 2px; background: var(--g-cyan); box-shadow: 0 0 12px var(--g-cyan); }
#skins .shop-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#skins .shop-nav small { font-size: 10px; white-space: nowrap; }
@media (max-height: 500px) {
  #skins.shop-screen { padding-left: calc(84px + env(safe-area-inset-left)) !important; }
  #skins .shop-nav { width: calc(76px + env(safe-area-inset-left)); gap: 2px; }
  #skins .shop-nav button { width: 70px; min-height: 44px; }
  #skins .shop-nav svg { width: 20px; height: 20px; }
  #skins .shop-nav small { font-size: 9px; }
}


#welcome.welcome-screen { background: linear-gradient(90deg, #020a12d9, #061322a6, #020a12d9) !important; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; }
#welcome .welcome-card { width: min(460px, 90vw); text-align: center; padding: 20px 35px; display: flex; flex-direction: column; align-items: stretch; gap: 0;
  border: 1px solid #83e4f34a !important; background: linear-gradient(145deg, #183342dc, #07131ced) !important; box-shadow: 0 20px 80px #0008; border-radius: 2px !important; }
#welcome .welcome-logo { width: 48px; height: 48px; object-fit: contain; align-self: center; }
#welcome .welcome-eyebrow { display: block; font-size: 8px; letter-spacing: 3px; color: var(--g-cyan); margin: 5px 0; }
#welcome h1 { margin: 0; font-size: 30px; letter-spacing: 4px; color: #eaf6fb; }
#welcome .welcome-card > p { font-size: 11px; color: #b4cad7; line-height: 1.4; margin: 8px 0; }
#welcome .welcome-card > .c-btn { display: block; width: 100%; padding: 10px; margin: 7px 0; min-height: 0; font-size: 12px; font-weight: 900; }
#welcome .welcome-note { font-size: 9px !important; color: var(--g-muted) !important; margin-top: 10px !important; }
#welcome .liens-legaux { font-size: 9px; color: var(--g-muted); }
#welcome .liens-legaux a { color: #9fdbe6; }
@media (max-height: 500px) {
  #welcome .welcome-card { padding: 10px 28px; }
  #welcome .welcome-logo { width: 32px; height: 32px; }
  #welcome h1 { font-size: 24px; }
  #welcome .welcome-card > .c-btn { padding: 8px; margin: 4px 0; }
  #welcome .welcome-card > p { margin: 4px 0; }
  #welcome .welcome-note { margin-top: 4px !important; }
}


#account .auth-brand { display: none; }
#account.invite .account-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; overflow-y: auto; }
#account.invite .auth-brand { display: flex; flex-direction: column; justify-content: center; grid-row: 1; grid-column: 1; padding: 10px 4vw 10px 10px; }
#account.invite .account-main { grid-column: 2; grid-row: 1 / span 2; background: linear-gradient(135deg, #193544d9, #0b1c29e8) !important; border: 1px solid #a2dce32c !important; }
#account.invite .account-admin { grid-column: 1; grid-row: 2; }
#account .auth-brand img { height: 64px; width: 64px; object-fit: contain; }
#account .auth-brand h3 { font-size: clamp(22px, 3.6vw, 44px); line-height: 1.15; letter-spacing: 1px; margin: 14px 0; color: #eaf6fb; }
#account .auth-brand p { color: #94b6c5; font-size: 13px; margin: 0; }
@media (max-height: 500px) {
  #account .auth-brand img { height: 40px; width: 40px; }
  #account .auth-brand h3 { margin: 8px 0; }
  #account .auth-brand p { font-size: 11px; }
}
@media (orientation: portrait) { #account.invite .account-cols { grid-template-columns: 1fr; } #account.invite .auth-brand { display: none; } #account.invite .account-main { grid-column: 1; } #account.invite .account-admin { grid-column: 1; } }


#acc-history, #acc-export, #acc-back { display: none !important; }
#account .account-cols { grid-template-columns: minmax(0, 1fr) !important; max-width: 680px; margin: 0 auto; width: 100%; overflow-y: auto; }
#account.invite .account-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) !important; max-width: 1000px; }
#account.invite .account-main { grid-row: 1 !important; }

#account.invite :is(.account-who, .account-photo), #account.invite .c-head .perles { display: none !important; }
#account .account-fields { display: flex !important; flex-direction: column !important; gap: 8px !important; }
#account .account-fields > * { width: 100% !important; flex: 0 0 auto !important; } 
#account.invite .account-btns { display: flex; gap: 8px; }
#account.invite .account-btns > * { flex: 1; }

.g-ecran #admin-key-box { max-width: 520px; padding: 12px !important; display: flex; flex-direction: column; gap: 8px; }
.g-ecran #admin-key-box h2 { display: none; }


#account.invite .account-cols { grid-template-columns: minmax(0, 1fr) !important; max-width: 560px !important; margin: 0 auto; justify-items: stretch; }
#account.invite .auth-brand { grid-column: 1 !important; grid-row: 1 !important; flex-direction: column; align-items: center; text-align: center; padding: 4px 0 10px !important; }
#account.invite .account-main { grid-column: 1 !important; grid-row: 2 !important; }
#account .auth-brand h3 { font-size: clamp(24px, 3.4vw, 36px) !important; letter-spacing: 4px !important; margin: 6px 0 4px !important; }
#account .auth-brand img { height: 48px !important; width: 48px !important; }
#account .auth-brand p { font-size: 12px; }
#account.invite .account-desc { text-align: center; }
@media (max-height: 500px) { #account .auth-brand img { height: 32px !important; width: 32px !important; } #account .auth-brand h3 { font-size: 22px !important; margin: 2px 0 !important; } #account .auth-brand p { display: none; } }
#account.invite .account-cols { align-content: start !important; grid-template-rows: auto auto !important; }


#settings > .card > * { flex-shrink: 0; }


#profile .profile-tabs, #profile .profile-inv { display: none !important; }
#profile .profile-photo-btn { align-self: flex-start; }
#profile #profile-photo-msg:empty { display: none; }
#profile .parrain-url { font-size: 12px; overflow-wrap: anywhere; color: var(--g-cyan, #73edff); }
#profile #admin-key-box { padding: 12px !important; display: flex; flex-direction: column; gap: 8px; }
#profile #admin-key-box h2 { font-size: 13px; margin: 0; }


#dead.c-screen { padding: max(14px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  gap: 10px; align-items: stretch;
  background: radial-gradient(ellipse 120% 70% at 50% 120%, transparent 58%, #4de3ff14 58.3%, transparent 58.8%),
    radial-gradient(ellipse 90% 60% at 80% -10%, transparent 60%, #4de3ff10 60.3%, transparent 60.9%),
    radial-gradient(ellipse 70% 60% at 50% 40%, #16303f 0%, transparent 72%), linear-gradient(180deg, #0f1c26 0%, #0a141c 62%, #070e14 100%); }
#dead .bilan-retour { position: absolute; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); z-index: 2; }
#dead .bilan { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: safe center; gap: 12px; overflow-y: auto; padding: 0 4px 0 44px; }
#dead .bilan > * { flex: none; }
#dead .bilan-tete { display: flex; flex-direction: column; gap: 6px; }
#dead .bilan-mode { align-self: flex-start; padding: 4px 18px; background: linear-gradient(90deg, #4de3ff, #22b8d8); color: #04151c; font-weight: 900; font-style: italic;
  text-transform: uppercase; letter-spacing: .04em; clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); }
#dead .bilan-mode:empty { display: none; }
#dead .bilan-titre { margin: 0; padding-left: 14px; border-left: 5px solid #4de3ff; font-size: clamp(24px, 4.2vw, 46px); font-weight: 900; line-height: 1.05;
  text-transform: uppercase; color: #fff; }
#dead .bilan-salut { margin: -2px 0 0 19px; font-size: 14px; font-weight: 800; color: var(--c-text-muted, #9fb3d1); }
#dead .bilan-panneaux { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.15fr) minmax(0, 0.95fr); gap: 14px; align-items: stretch; }
#dead .bilan-panneau { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: #0e1d27cc; border: 1px solid #4de3ff66; border-radius: 10px; }
#dead .bilan-panneau[hidden] { display: none; }

#dead .bilan-droite { align-items: center; justify-content: center; }
#dead .bilan-scene { position: relative; width: min(100%, 34vh, 280px); aspect-ratio: 1; }
#dead #dead-skin { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 0 0 3px #4de3ffcc, 0 0 28px #4de3ff55; animation: bilan-flotte 3.2s ease-in-out infinite; }
@keyframes bilan-flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { #dead #dead-skin { animation: none; } }
#dead .bilan-nom { text-align: center; font-size: clamp(15px, 2vw, 24px); font-weight: 900; font-style: italic; color: #fff; overflow-wrap: anywhere; }
#dead .bilan-nom:empty { display: none; }

#dead .bilan-gauche { justify-content: center; }
#dead .bilan-stats { display: flex; flex-direction: column; }
#dead .bilan-stats > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 14px; padding: 8px 4px; border-bottom: 1px solid #96ddeb30; }
#dead .bilan-stats > div:last-child { border-bottom: 0; }
#dead .bilan-stats span { min-width: 0; font-size: 14px; font-weight: 800; color: #c9dbe4; padding-right: 14px; border-right: 1px solid #96ddeb38; }
#dead .bilan-stats b { min-width: 0; font-size: clamp(18px, 2.6vw, 32px); font-weight: 900; color: #fff; line-height: 1.1; white-space: nowrap; }
#dead .bilan-xp { color: #6dffa8; font-weight: 900; }
#dead .bilan-xp[hidden], #dead .bilan-xp-detail[hidden] { display: none; }
#dead .bilan-xp-detail { margin-left: 6px; font-size: 11px; font-weight: 800; color: #c9dbe4; }

#dead .bilan-argent { align-items: center; text-align: center; }
#dead .bilan-argent-total { font-size: clamp(17px, 2.2vw, 28px); font-weight: 900; color: #fff; }
#dead .bilan-piece { width: clamp(52px, 9vh, 96px); height: auto; aspect-ratio: 1; flex: none; filter: drop-shadow(0 4px 10px #0008); }
#dead .bilan-argent-detail { align-self: stretch; display: flex; flex-direction: column; gap: 6px; }
#dead .bilan-ligne { display: flex; justify-content: space-between; gap: 10px; padding: 5px 12px; border: 1px solid #96ddeb38; border-radius: 6px; color: #c9dbe4; font-weight: 800; font-size: 14px; text-align: left; }
#dead .bilan-ligne b { color: #fff; }
#dead .bilan-ligne-fort { background: linear-gradient(90deg, #1d6f80, #155563); border-color: #4de3ff99; color: #eaffff; }
#dead .bilan-boutique { align-self: stretch; min-height: 40px; font-size: 14px; font-weight: 900; }
#dead .bilan-suite { display: flex; flex-direction: column; gap: 6px; }
#dead .bilan-suite .pub-btns:not(:has(button:not([hidden]))) { display: none; }
#dead .dead-btns { position: static; flex: none; display: flex; gap: 16px; justify-content: center; width: auto; margin: 0; padding: 0; background: none; }
#dead .bilan-rejouer { min-width: 180px; min-height: 48px; font-size: 22px; font-style: italic; font-weight: 900; }
#dead .bilan-menu { min-width: 140px; min-height: 48px; font-size: 18px; font-weight: 900; }

@media (max-height: 520px) {
  #dead.c-screen { gap: 6px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  #dead .bilan { gap: 6px; }
  #dead .bilan-tete { flex-direction: row; align-items: center; gap: 12px; }
  #dead .bilan-titre { font-size: 22px; }
  #dead .bilan-salut { display: none; }
  #dead .bilan-panneaux { gap: 8px; }
  #dead .bilan-panneau { padding: 8px 10px; gap: 6px; }
  #dead .bilan-scene { width: min(100%, 30vh); }
  #dead .bilan-nom { font-size: 14px; }
  #dead .bilan-stats > div { padding: 3px 2px; gap: 8px; }
  #dead .bilan-stats span { font-size: 11px; padding-right: 8px; }
  #dead .bilan-stats b { font-size: 16px; }
  #dead .bilan-argent-total { font-size: 15px; }
  #dead .bilan-piece { width: 40px; }
  #dead .bilan-ligne { padding: 2px 8px; font-size: 12px; }
  #dead .bilan-boutique { min-height: 32px; font-size: 12px; }
  #dead .bilan-rejouer, #dead .bilan-menu { min-height: 40px; }
  #dead .bilan-rejouer { min-width: 140px; font-size: 18px; }
  #dead .bilan-menu { min-width: 100px; font-size: 15px; }
}

@media (max-width: 640px), (orientation: portrait) {
  #dead .bilan { padding-left: 4px; padding-top: 34px; }
  #dead .bilan-panneaux { grid-template-columns: 1fr; gap: 8px; }
  #dead .bilan-droite { flex-direction: row; justify-content: flex-start; padding: 8px 12px; }
  #dead .bilan-scene { width: 64px; }
  #dead .bilan-argent { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; text-align: left; column-gap: 12px; }
  #dead .bilan-argent-total { grid-column: 1 / -1; }
  #dead .bilan-piece { width: 52px; }
  #dead .bilan-boutique { grid-column: 1 / -1; }
}
