/* Terravia — Desktop CSS consolidé
   Responsive/mobile volontairement retiré le 11/09/2026.
   Refaire les adaptations mobiles après stabilisation du CSS desktop. */

/* Thème actuel : ardoise,crème et cuivre. Les couleurs positives,négatives et d’alerte indiquent un état du jeu. */

:root{
  --page: #2f3833;
  --surface: #faf9f6;
  --surface-2: #f2efe8;
  --surface-3: #e8e4da;
  --surface-sunken: #eceae4;
  --border: #d9d5cc;
  --border-strong: #c4bfb3;
  --ink: #23282a;
  --ink-soft: #6b7069;
  --ink-mute: #8d918a;
  --accent: #a9703f;
  --accent-dark: #8a5a30;
  --accent-soft: #f3e6d8;
  --positive: #2f7139;
  --negative: #b4442c;
  --warning: #c98b2f;
  --shell: #242c28;
  --shell-raised: #2c3531;
  --shell-border: #3c453f;
  --shell-ink: #eceae4;
  --shell-muted: #cfd3cb;
  --positive-soft: #eef5e8;
  --positive-border: #b9cfad;
  --positive-dark: #275f30;
  --progress-start: #3f8f4b;
  --progress-end: #5aa863;
  --negative-soft: #fdeee4;
  --negative-dark: #96382a;
  --warning-soft: #fbf3e2;
  --water-soft: #edf8fc;
  --water-border: #abd7e8;
  --shadow: 0 1px 2px rgba(28,32,28,.07);
  --shadow-lift: 0 3px 8px rgba(28,32,28,.10);
  --radius: 10px;
  --radius-lg: 14px;
  --font-title: "Nunito","Trebuchet MS",system-ui,sans-serif;
  --font-body: "Nunito","Trebuchet MS",system-ui,sans-serif;
}

@layer properties {
  @supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))) {
    *,:before,:after,::backdrop{
      --tw-border-style: solid;
      --tw-blur: initial;
      --tw-brightness: initial;
      --tw-contrast: initial;
      --tw-grayscale: initial;
      --tw-hue-rotate: initial;
      --tw-invert: initial;
      --tw-opacity: initial;
      --tw-saturate: initial;
      --tw-sepia: initial;
      --tw-drop-shadow: initial;
      --tw-drop-shadow-color: initial;
      --tw-drop-shadow-alpha: 100%;
      --tw-drop-shadow-size: initial;
    }
  }
}

@layer theme {
  :root,:host{
    --font-sans: ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
    --font-mono: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
    --color-slate-100: oklch(96.8% .007 247.896);
    --color-black: #000;
    --color-white: #fff;
    --spacing: .25rem;
    --default-transition-duration: .15s;
    --default-transition-timing-function: cubic-bezier(.4,0,.2,1);
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
    --color-ink: #2f3833;
  }
}

@layer base {
  *,:after,:before,::backdrop,::file-selector-button{
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  html,:host{
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    line-height: 1.5;
    font-family: var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");
    font-feature-settings: var(--default-font-feature-settings,normal);
    font-variation-settings: var(--default-font-variation-settings,normal);
    -webkit-tap-highlight-color: transparent;
  }

  hr{
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }

  abbr:where([title]){
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }

  h1,h2,h3,h4,h5,h6{
    font-size: inherit;
    font-weight: inherit;
  }

  b,strong{
    font-weight: bolder;
  }

  code,kbd,samp,pre{
    font-family: var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);
    font-feature-settings: var(--default-mono-font-feature-settings,normal);
    font-variation-settings: var(--default-mono-font-variation-settings,normal);
    font-size: 1em;
  }

  small{
    font-size: 80%;
  }

  sub,sup{
    vertical-align: baseline;
    font-size: 75%;
    line-height: 0;
    position: relative;
  }

  sub{
    bottom: -.25em;
  }

  sup{
    top: -.5em;
  }

  table{
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }

  :-moz-focusring{
    outline: auto;
  }

  progress{
    vertical-align: baseline;
  }

  summary{
    display: list-item;
  }

  ol,ul,menu{
    list-style: none;
  }

  img,svg,video,canvas,audio,iframe,embed,object{
    vertical-align: middle;
    display: block;
  }

  img,video{
    max-width: 100%;
    height: auto;
  }

  button,input,select,optgroup,textarea,::file-selector-button{
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  :where(select:is([multiple],[size])) optgroup{
    font-weight: bolder;
  }

  :where(select:is([multiple],[size])) optgroup option{
    padding-inline-start: 20px;
  }

  ::file-selector-button{
    margin-inline-end: 4px;
  }

  ::placeholder{
    opacity: 1;
  }

  @supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px) {
    ::placeholder{
      color: currentColor;
    }

    @supports (color:color-mix(in lab, red, red)) {
      ::placeholder{
        color: color-mix(in oklab,currentcolor 50%,transparent);
      }
    }
  }

  textarea{
    resize: vertical;
  }

  ::-webkit-search-decoration{
    -webkit-appearance: none;
  }

  ::-webkit-date-and-time-value{
    min-height: 1lh;
    text-align: inherit;
  }

  ::-webkit-datetime-edit{
    display: inline-flex;
  }

  ::-webkit-datetime-edit-fields-wrapper{
    padding: 0;
  }

  ::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{
    padding-block: 0;
  }

  ::-webkit-calendar-picker-indicator{
    line-height: 1;
  }

  :-moz-ui-invalid{
    box-shadow: none;
  }

  button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{
    appearance: button;
  }

  ::-webkit-inner-spin-button,::-webkit-outer-spin-button{
    height: auto;
  }

  [hidden]:where(:not([hidden=until-found])){
    display: none;
  }

  *{
    box-sizing: border-box;
  }

  body{
    font-family: Segoe UI Variable,Inter,system-ui,sans-serif;
  }

  a{
  -webkit-text-decoration: inherit;
    color: inherit;
    text-decoration: none;
  }

  input,select{
    color: var(--ink-soft);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: .8rem;
    outline: none;
    width: 100%;
    padding: .82rem 1rem;
    transition: all .2s;
  }

  input:focus,select:focus{
    border-color: var(--accent-dark);
    box-shadow: 0 0 0 3px #a9703f28;
  }

  label{
    color: var(--ink-soft);
    gap: .45rem;
    font-size: .82rem;
    font-weight: 650;
    display: grid;
  }

  button{
    cursor: pointer;
  }

  small[data-error]{
    color: #fb8290;
    min-height: .9rem;
    font-weight: 500;
  }
}

@layer components {
  .skip-link{
    top: calc(var(--spacing)*-20);
    left: calc(var(--spacing)*4);
    z-index: 50;
    background-color: var(--color-white);
    padding-inline: calc(var(--spacing)*3);
    padding-block: calc(var(--spacing)*2);
    color: var(--color-black);
    border-radius: .25rem;
    position: fixed;
  }

  .skip-link:focus{
    top: calc(var(--spacing)*4);
  }

  .stack{
    gap: 1rem;
    margin-top: 2rem;
    display: grid;
  }

  .password-wrap{
    display: block;
    position: relative;
  }

  .password-wrap button{
    color: var(--ink-soft);
    padding: .3rem;
    font-size: .72rem;
    position: absolute;
    top: .62rem;
    right: .7rem;
  }

  .check{
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: .55rem;
    display: flex;
  }

  .check input{
    accent-color: var(--accent);
    width: auto;
  }

  .primary,.secondary{
    border-radius: .85rem;
    justify-content: center;
    align-items: center;
    gap: .6rem;
    font-weight: 750;
    transition: all .2s;
    display: inline-flex;
  }

  .primary{
    color: #fff;
    background: var(--accent);
    padding: .9rem 1.1rem;
    box-shadow: 0 12px 30px #a9703f28;
  }

  .primary:hover{
    background: var(--accent-dark);
    transform: translateY(-1px);
  }

  .primary:disabled{
    opacity: .55;
    cursor: wait;
  }

  .secondary{
    color: var(--surface);
    background: var(--accent);
    border: 1px solid var(--accent-dark);
    padding: .7rem 1rem;
  }

  .fit{
    width: max-content;
  }

  .strength{
    background: var(--surface-2);
    border-radius: 10px;
    height: 4px;
    overflow: hidden;
  }

  .strength i{
    background: #fb7185;
    width: 0;
    height: 100%;
    transition: all .2s;
    display: block;
  }

  .notice{
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding: 1rem 1.2rem;
    display: flex;
  }

  .notice p{
    color: var(--ink-soft);
    font-size: .8rem;
  }

  table{
    border-collapse: collapse;
    width: 100%;
  }

  th,td{
    text-align: left;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }

  th{
    text-transform: uppercase;
    color: var(--ink);
    font-size: .68rem;
  }

  td small{
    color: var(--ink);
    display: block;
  }

  .error-page{
    text-align: center;
    place-content: center;
    gap: 1rem;
    min-height: 100vh;
    padding: 2rem;
    display: grid;
  }

  .error-page>span{
    color: var(--accent);
    letter-spacing: -.08em;
    font-size: 7rem;
    font-weight: 900;
  }

  .error-page pre{
    text-align: left;
    max-width: 80vw;
    overflow: auto;
  }

}

@layer utilities {

  .visible{
    visibility: visible;
  }

  .fixed{
    position: fixed;
  }

  .static{
    position: static;
  }

  .top-4{
    top: calc(var(--spacing)*4);
  }

  .right-4{
    right: calc(var(--spacing)*4);
  }

  .z-50{
    z-index: 50;
  }

  .block{
    display: block;
  }

  .grid{
    display: grid;
  }

  .hidden{
    display: none;
  }

  .table{
    display: table;
  }

  .h-full{
    height: 100%;
  }

  .min-h-full{
    min-height: 100%;
  }

  .gap-3{
    gap: calc(var(--spacing)*3);
  }

  .bg-ink{
    background-color: var(--color-ink);
  }

  .text-slate-100{
    color: var(--color-slate-100);
  }

  .antialiased{
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .filter{
    filter: var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,);
  }

}

@media (prefers-reduced-motion:reduce) {
  *{
    scroll-behavior: auto;
    transition: none;
  }
}

.cycle div{
  display: grid;
}

.catalogue h2{
  font-size: 1.35rem;
}

@supports (color:color-mix(in lab, red, red)) {
  .resource-medal{
    background: color-mix(in srgb,var(--resource)25%,var(--surface-2));
    border: 1px solid color-mix(in srgb,var(--resource)50%,var(--surface-2));
  }
}

.resource-medal.large{
  width: 3.2rem;
  height: 3.2rem;
  font-size: 1.4rem;
}

.ledger div>div{
  display: grid;
}

.ledger strong{
  font-size: .75rem;
}

.ledger b{
  font-family: Bahnschrift Condensed,sans-serif;
  font-size: .8rem;
}

@supports (color:color-mix(in lab, red, red)) {
  .catalogue-icon{
    background: color-mix(in srgb,var(--resource)22%,var(--surface-2));
  }
}

.catalogue-grid p{
  min-height: 2rem;
  font-size: .67rem;
}

.catalogue-grid article>div:not(.catalogue-icon){
  justify-content: space-between;
  font-size: .6rem;
  display: flex;
}

.trend{
  width: max-content;
  padding: .25rem .35rem;
  font-size: .58rem;
  font-weight: 800;
}

.sell-form{
  grid-template-columns: 1fr auto;
  gap: .4rem;
  display: grid;
}

.sell-form :disabled{
  opacity: .4;
  cursor: not-allowed;
}

@keyframes fieldPulse {
  50% {
    opacity: .45;
    transform: scale(.55);
  }
}

@keyframes tileFlow {
  to {
    opacity: 0;
    transform: translateY(25px);
  }
}

.stock-dock>header div{
  display: grid;
}

@supports (color:color-mix(in lab, red, red)) {
  .dock-icon{
    background: color-mix(in srgb,var(--resource)24%,var(--surface-2));
  }
}

.dock-resource>div,.dock-resource>b{
  display: grid;
}

.dock-resource>div strong{
  font-size: .66rem;
}

.dock-resource>div small{
  color: #829087;
  font-size: .48rem;
}

.dock-resource>b{
  text-align: right;
  color: var(--ink);
  font-family: Bahnschrift Condensed,sans-serif;
  font-size: .85rem;
}

.dock-resource>b small{
  color: #86928b;
  font-family: inherit;
  font-size: .48rem;
  font-weight: 500;
}

.stock-dock>footer{
  background: var(--surface-2);
  border-top: 1px solid var(--surface-2);
  gap: .25rem;
  margin-top: auto;
  padding: 1rem;
  display: grid;
}

.stock-dock>footer span{
  letter-spacing: .12em;
  color: #7e8a83;
  font-size: .85rem;
}

.stock-dock>footer strong{
  font-family: Georgia,serif;
  font-size: .85rem;
}

.stock-dock>footer a{
  color: var(--ink);
  margin-top: .3rem;
  font-size: .58rem;
  font-weight: 800;
}

.is-loading{
  position: relative;
  overflow: hidden;
}

.is-loading:after{
  content: "";
  background: var(--surface-2);
  height: 2px;
  animation: .7s infinite loadingSweep;
  position: absolute;
  inset: auto 0 0;
}

@keyframes loadingSweep {
  0% {
    transform: translate(-100%);
  }

  to {
    transform: translate(100%);
  }
}

@keyframes valuePop {
  50% {
    color: var(--ink);
    transform: scale(1.08);
  }
}

@keyframes dockGlow {
  50% {
    box-shadow: inset 4px 0 rgba(28,32,28,.10);
  }
}

@keyframes bannerIn {
  0% {
    opacity: 0;
    transform: translate(-50%,-15px);
  }
}

.recipe-materials{
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .6rem;
  margin: .7rem 0;
  display: grid;
}

.recipe-materials span{
  font-size: .58rem;
}

.ui-toolbar b{
  color: var(--ink);
  font-family: Bahnschrift Condensed,sans-serif;
}

.catalog-group h2{
  font-size: 1.15rem;
}

.catalog-group[hidden],[data-catalog-item][hidden]{
  display: none;
}

.dock-resource.dock-empty{
  display: none;
}

.dock-none{
  text-align: center;
  color: #8a958e;
  padding: 1.5rem .5rem;
  font-size: .6rem;
}

.catalogue-grid .recipe-materials span{
  font-size: .52rem;
}

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

.cycle{
  align-items: center;
  gap: .7rem;
  display: flex;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: .38rem .65rem;
  box-shadow: inset 0 2px #ffffff0c;
}

.cycle small{
  letter-spacing: .13em;
  font-size: .51rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.cycle strong{
  font-size: .67rem;
  color: var(--ink-soft);
  font: 700 .56rem Consolas,monospace;
}

.ledger>div{
  border-bottom: 1px solid var(--surface-2);
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .8rem 0;
  display: grid;
  border-color: var(--border);
}

.ledger small{
  font-size: .6rem;
  color: var(--ink-soft);
}

.resource-medal{
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  color: #fff;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 9px;
}

.catalogue>header p:last-child{
  font-size: .75rem;
  color: var(--ink-soft);
}

.catalog-group>header p{
  font-size: .62rem;
  color: var(--ink-soft);
}

.catalogue-icon{
  place-items: center;
  width: 3rem;
  height: 3rem;
  display: grid;
  border-bottom: 3px solid var(--resource);
  font-size: 1.5rem;
  color: #fff;
  border: 2px solid var(--border);
  border-radius: 9px;
  box-shadow: inset 0 -3px rgba(28,32,28,.10);
  background: var(--surface-2);
}

.catalogue-grid article>span{
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .51rem;
  color: var(--ink-soft);
}

.catalogue-grid article>div strong{
  color: var(--ink-soft);
}

.recipe-materials small{
  letter-spacing: .1em;
  font-size: .45rem;
  color: var(--ink-soft);
}

.recipe-materials>i{
  font-style: normal;
  color: var(--accent);
}

.ui-toolbar input[type=search]{
  border-color: var(--surface-2);
  width: 280px;
  padding: .6rem;
  font-size: .7rem;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 8px;
}

.ui-toolbar>span{
  margin-left: auto;
  font-size: .6rem;
  color: var(--ink-soft);
}

.stock-dock footer span{
  color: var(--ink-soft);
}

.sell-form input{
  border-color: var(--surface-2);
  padding: .55rem;
  color: #fff;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 7px;
}

.sell-form button{
  padding: .55rem .75rem;
  color: var(--ink);
  background: var(--accent);
  border: 2px solid var(--accent-dark);
  border-radius: 7px;
  font-weight: 900;
  box-shadow: inset 0 -3px rgba(28,32,28,.10);
}

.trend.up{
  background: #dceadf;
  color: var(--positive);
}

.trend.down{
  background: #f0dfd8;
  color: #ff7c73;
}

.dock-resource{
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .55rem;
  padding: .7rem .15rem;
  display: grid;
  text-align: left;
  width: 100%;
  background: 0 0;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--border);
}

.dock-resource:hover{
  background: var(--surface-2);
}

.dock-icon{
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  border-left: 3px solid var(--resource);
  font-size: .95rem;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 8px;
}

.dock-resource small{
  color: var(--ink-soft);
}

.dock-resource b{
  color: var(--ink-soft);
}

.stock-dock footer{
  background: var(--surface-2);
  border-color: var(--border);
}

.primary{
  color: var(--ink);
  background: var(--accent);
  border: 2px solid var(--accent-dark);
  box-shadow: inset 0 -3px rgba(28,32,28,.10);
}

.secondary{
  background: var(--accent);
  border: 2px solid var(--accent-dark);
}

.stock-dock>header{
  border-bottom: 1px solid var(--surface-2);
  justify-content: space-between;
  align-items: center;
  height: 74px;
  display: flex;
  color: #fff;
  background: var(--surface-3);
  border-color: var(--border);
  position: relative;
  min-height: 74px;
  padding: .8rem 1rem;
}

.stock-dock>header>div{
  gap: .2rem;
  display: grid;
}

.stock-dock>header small{
  color: var(--ink-soft);
  letter-spacing: .1em;
  font-family: Consolas,monospace;
  font-size: .45rem;
}

.stock-dock>header strong{
  text-shadow: 0 2px rgba(28,32,28,.10);
  line-height: 1.1;
  color: #fff;
  font-family: Arial Rounded MT Bold,Trebuchet MS,sans-serif;
  font-size: 1rem;
}

.stock-dock>header button{
  font-size: 1.5rem;
  display: none;
  color: var(--surface);
  background: var(--surface);
  border: 2px solid var(--accent-dark);
  border-radius: 7px;
  width: 28px;
  height: 28px;
}

.stock-dock-list{
  padding: .4rem .7rem;
  overflow-y: auto;
  scrollbar-color: #597b9c #14283e;
  scrollbar-width: thin;
}

@keyframes cloudFloat {
  50% {
    transform: translate(15px)translateY(5px);
  }
}

@keyframes factorySmoke {
  0% {
    opacity: .8;
    transform: translateY(10px)scale(.6);
  }

  to {
    opacity: 0;
    transform: translate(18px,-28px)scale(1.5);
  }
}

@keyframes beacon {
  to {
    opacity: 0;
    transform: scale(1.7);
  }
}

@keyframes conveyorMove {
  to {
    transform: translate(34px);
  }
}

.place-farmyard:before{
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(25deg,#83aa4e22 0 10px,#0000 10px 24px);
}

.place-ranch:before{
  background-color: var(--surface-2);
  background-image: radial-gradient(circle,#a9d17a22 0 3px,#0000 4px);
  background-size: 26px 26px;
}

.place-quarry:before{
  background-color: var(--surface-2);
  background-image: linear-gradient(30deg,#ffffff08 12%,#0000 12.5% 87%,#ffffff08 87.5%);
  background-size: 42px 72px;
}

.place-factory:before{
  background-color: var(--surface-2);
  background-image: linear-gradient(#ffffff0a 2px,#0000 2px),linear-gradient(90deg,#ffffff0a 2px,#0000 2px);
  background-size: 34px 34px;
}

.catalogue{
  background: rgba(169,112,63,0.8);
  border: 3px solid var(--border);
  border-radius: 16px;
  margin-top: 1.4rem;
  padding: 1rem;
  position: relative;
  box-shadow: inset 0 2px #ffffff0c,0 6px rgba(28,32,28,.10);
}

.catalogue:before{
  content: "";
  background: repeating-linear-gradient(90deg,var(--accent) 0 20px,var(--surface-2) 20px 38px);
  border-radius: 5px;
  height: 7px;
  position: absolute;
  top: -6px;
  left: 18px;
  right: 18px;
}

.catalogue>header{
  color: #fff;
  padding: .8rem 1rem;
  box-shadow: none;
  background: var(--surface-3);
  border: 0;
  border-radius: 10px;
  margin: 0 0 1rem;
}

.catalog-group{
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 12px;
  margin: 1rem 0;
  padding: .75rem;
}

.catalog-group>header{
  border-color: var(--border);
  border-bottom: 1px solid var(--surface-2);
  align-items: center;
  gap: .8rem;
  padding-bottom: .6rem;
  display: flex;
  border: 2px solid var(--border);
  border-radius: 10px;
  margin-bottom: .7rem;
  padding: .65rem;
  background: var(--surface-3);
  margin: 0 0 .75rem;
}

.catalog-group>header>b{
  margin-left: auto;
  padding: .3rem .5rem;
  font-size: .6rem;
  color: var(--ink);
  background: var(--accent);
  border-radius: 7px;
  box-shadow: inset 0 -2px transparent;
}

.catalogue-grid{
  gap: .8rem;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
}

.catalogue-grid>article:before{
  content: "";
  background: var(--accent);
  width: 6px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
}

.place-ranch .catalogue-grid>article:before{
  background: var(--surface-2);
}

.place-quarry .catalogue-grid>article:before{
  background: var(--surface-2);
}

.catalogue h2,
.catalog-group h2,
.catalogue-grid h3{
  color: #fff;
  font-family: Arial Rounded MT Bold,Trebuchet MS,sans-serif;
}

.catalogue-grid .recipe-materials{
  margin: .4rem 0;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: .35rem;
}

.recipe-materials>div{
  color: var(--ink-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  gap: .3rem;
  padding: .55rem;
  display: grid;
  min-height: 70px;
}

.place-factory .recipe-materials>i{
  color: var(--ink);
  background: var(--accent);
  border-radius: 50%;
  place-items: center;
  width: 24px;
  height: 24px;
  font-weight: 900;
  display: grid;
}

.game-place .catalog-group>header p{
  display: none;
}

.game-place .catalog-group>header>b{
  color: var(--ink);
  background: var(--accent);
}

.game-place .catalogue{
  box-shadow: none;
  background: 0 0;
  border: 0;
  padding: 0;
}

.game-place .catalogue:before{
  display: none;
}

.game-place .catalog-group{
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 10px;
  margin: .55rem 0 1rem;
  padding: 0;
  overflow: hidden;
}

.game-place .catalog-group>header{
  background: var(--surface-3);
  border: 0;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  min-height: 54px;
  margin: 0;
  padding: .6rem .75rem;
}

.game-place .catalogue-grid>article:nth-child(2n){
  background: var(--surface-2);
}

.game-place .catalogue-grid>article:last-child{
  border-bottom: 0;
}

.game-place .catalogue-grid>article:hover{
  background: var(--accent-soft);
  transform: none;
  box-shadow: inset 4px 0 var(--accent);
}

.game-place .catalogue-grid>article:before{
  display: none;
}

.game-place .catalogue-grid .catalogue-icon{
  width: 36px;
  height: 36px;
  box-shadow: none;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  grid-area: 1/1;
}

.game-place .catalogue-grid>article>span{
  display: none;
}

.game-place .catalogue-grid>article>.recipe-materials{
  background: 0 0;
  border: 0;
  grid-area: 1/3;
  margin: 0;
  padding: 0;
}

.game-place .catalogue-grid>article>.recipe-materials>div{
  background: var(--surface-2);
  border: 0;
  min-height: 0;
  padding: .25rem .4rem;
}

.game-place .catalogue-grid>article>.recipe-materials span{
  font-size: .48rem;
}

.game-place .catalogue-grid>article>div:not(.catalogue-icon):not(.recipe-materials){
  text-align: right;
  grid-area: 1/4;
  display: grid;
}

.game-place .catalogue-grid>article>form{
  grid-area: 1/5;
  align-self: center;
}

.catalog-precollapsed .catalogue>:not(header),.catalog-precollapsed .ui-page>.catalog-group,.catalogue.is-collapsed>:not(header){
  display: none;
}

.catalogue.is-collapsed>header{
  margin-bottom: 0;
}

.game-place .catalogue>header{
  background: var(--surface-3);
  border: 2px solid var(--border-strong);
  margin-bottom: .55rem;
  padding-right: 235px;
  position: relative;
}

.game-place .catalogue>header>.library-toggle{
  position: absolute;
  top: 50%;
  right: .75rem;
  transform: translateY(-50%);
}

.ui-page{
  margin: auto;
  max-width: 1600px;
  padding: 1.4rem;
  min-height: calc(100vh - 68px);
}

.game-place .catalogue-grid .recipe-materials span{
  font-size: .58rem;
  line-height: 1.45;
}

.game-place .catalogue-grid>article{
  box-shadow: none;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  grid-template-columns: 48px minmax(150px,1fr) minmax(240px,2fr) 115px 170px;
  align-items: center;
  gap: .75rem;
  padding: .55rem .7rem;
  display: grid;
  min-height: 80px;
}

.game-place .catalogue-grid>article>h3{
  grid-area: 1/2;
  margin: 0;
  font-size: .84rem;
}

.game-place .catalogue-grid>article>p{
  grid-area: 1/3;
  min-height: 0;
  margin: 0;
  font-size: .64rem;
  line-height: 1.45;
}

.game-place .catalogue-grid>article>div:not(.catalogue-icon):not(.recipe-materials) small{
  font-size: .52rem;
}

.game-place .catalogue-grid>article>div:not(.catalogue-icon):not(.recipe-materials) strong{
  color: var(--ink-soft);
  font-size: .69rem;
}

@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-blur {
  syntax: "*";
  inherits: false;
}

@property --tw-brightness {
  syntax: "*";
  inherits: false;
}

@property --tw-contrast {
  syntax: "*";
  inherits: false;
}

@property --tw-grayscale {
  syntax: "*";
  inherits: false;
}

@property --tw-hue-rotate {
  syntax: "*";
  inherits: false;
}

@property --tw-invert {
  syntax: "*";
  inherits: false;
}

@property --tw-opacity {
  syntax: "*";
  inherits: false;
}

@property --tw-saturate {
  syntax: "*";
  inherits: false;
}

@property --tw-sepia {
  syntax: "*";
  inherits: false;
}

@property --tw-drop-shadow {
  syntax: "*";
  inherits: false;
}

@property --tw-drop-shadow-color {
  syntax: "*";
  inherits: false;
}

@property --tw-drop-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-drop-shadow-size {
  syntax: "*";
  inherits: false;
}

@font-face {
  font-family: "Baloo 2";
  src: url("../fonts/baloo2-700.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

.equipment-irrigate p strong{
  font-size: 12px;
}

.equipment-irrigate p small{
  font-size: 10px;
  color: var(--ink-soft);
}

.weather-station{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
}

.weather-station strong{
  font: 900 12px/1.2 "Nunito",sans-serif;
}

.weather-station small{
  font: 700 10px/1.2 "Nunito",sans-serif;
  color: var(--ink-soft);
}

.weather-station button{
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--accent-dark);
  border-radius: 7px;
  background: var(--accent);
  color: var(--ink);
  font: 900 10px/1 "Nunito",sans-serif;
  box-shadow: 0 2px rgba(28,32,28,.10);
}

.weather-station>b{
  padding: 6px 9px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font: 900 10px/1 "Nunito",sans-serif;
}

.equipment-soil span{
  font: 800 11px/1.2 "Nunito",sans-serif;
}

.equipment-soil strong{
  color: var(--ink);
  font: 900 12px/1.2 "Nunito",sans-serif;
}

@font-face {
  font-family: "Baloo 2";
  src: url("../fonts/baloo2-800.woff2") format("woff2");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-400.woff2") format("woff2");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-700.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-800.woff2") format("woff2");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

.ui-game .ui-game-stage:before,.ui-game .ui-game-stage:after,.ui-game .ui-game-home:before{
  content: none;
  display: none;
  background: none;
}

.ui-game-stage:before,.ui-game-stage:after{
  display: none;
}

.ui-game-stage:after{
  content: "";
  position: absolute;
  z-index: -1;
  inset: 150px 0 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 8% 18%,var(--surface-2) 0 5px,transparent 6px),radial-gradient(circle at 92% 72%,var(--surface-2) 0 5px,transparent 6px),linear-gradient(90deg,transparent 0 31%,#8f653c 31% 31.4%,var(--surface-2) 31.4% 33.6%,#8f653c 33.6% 34%,transparent 34% 100%),linear-gradient(0deg,transparent 0 54%,#8f653c 54% 54.5%,var(--surface-2) 54.5% 58%,#8f653c 58% 58.5%,transparent 58.5% 100%),repeating-linear-gradient(125deg,#ffffff08 0 14px,#315f2410 14px 28px),linear-gradient(90deg,var(--surface-2) 0 31%,var(--surface-2) 31% 58%,var(--surface-2) 58% 100%);
  background-size: 74px 74px,86px 86px,100% 100%,100% 100%,100% 100%,100% 100%;
  opacity: .92;
}

.ui-game{
    position: relative;
    isolation: isolate;
    color: var(--ink);
    font-family: "Nunito", "Trebuchet MS", sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ui-game a{
  text-decoration: none;
}

.ui-game input,.ui-game select{
  font: inherit;
}

.ui-game-hud{
  height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 4px solid var(--accent-dark);
  box-shadow: 0 4px 0 #56351f33;
}

.ui-game-logo{
  display: flex;
  align-items: center;
  min-width: 270px;
  color: var(--accent-dark);
}

.ui-game-logo>span{
  font-size: 42px;
  filter: drop-shadow(0 3px #bd7d20);
}

.ui-game-logo strong{
  font: 900 25px/1 "Baloo 2","Nunito","Trebuchet MS",sans-serif;
}

.ui-game-logo small{
  margin-top: 4px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ui-game-inventory>header>div{
  display: flex;
  align-items: center;
  gap: 10px;
}

.ui-game-inventory>header span{
  font-size: 27px;
}

.ui-game-inventory header p{
  display: grid;
}

.ui-game-inventory header small{
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 900;
}

.ui-game-inventory header strong{
  font-size: 18px;
}

.ui-game-inventory header button{
  border: 0;
  background: #fff3;
  border-radius: 50%;
  color: #fff;
  width: 28px;
  height: 28px;
}

.ui-game-inventory footer span{
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ui-game-inventory footer a{
  grid-column: 1/-1;
  margin-top: 8px;
  padding: 9px;
  text-align: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 -3px rgba(28,32,28,.10);
}

.player-rank{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-left: 2px solid var(--accent-dark);
}

.player-rank>span{
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--border);
  color: white;
  font-size: 19px;
  font-weight: 900;
  box-shadow: inset 0 -4px rgba(28,32,28,.10);
}

.player-rank>div{
  display: grid;
  min-width: 130px;
}

.player-rank strong{
  font-size: 14px;
}

.player-rank i{
  height: 6px;
  margin-top: 4px;
  border-radius: 5px;
  background: var(--surface-2);
  overflow: hidden;
}

.player-rank em{
  display: block;
  height: 100%;
  background: var(--accent);
}

.ui-game-stage{
  isolation: isolate;
  background: var(--surface-2);
  background-image: linear-gradient(180deg,var(--surface-2) 0 106px,var(--surface-2) 106px);
  display: grid;
  grid-template-columns: minmax(0,1fr) 292px;
  min-height: calc(100vh - 138px);
  position: relative;
}

.ui-game-stage:before{
  z-index: -2;
  content: "";
  position: absolute;
  inset: 65px 0 auto;
  height: 90px;
  background: radial-gradient(ellipse at 12% 100%,var(--surface-2) 0 24%,transparent 25%),radial-gradient(ellipse at 48% 100%,var(--surface-2) 0 29%,transparent 30%),radial-gradient(ellipse at 82% 100%,var(--surface-2) 0 27%,transparent 28%);
  pointer-events: none;
}

.ui-game-content{
  position: relative;
  z-index: 1;
  padding: 24px 28px 50px;
  min-width: 0;
}

.ui-game-inventory{
  z-index: 2;
  height: calc(100vh - 138px);
  position: sticky;
  top: 138px;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border-left: 5px solid var(--accent-dark);
  box-shadow: -5px 0 #55351f22;
}

.ui-game-inventory>header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--accent);
  color: #fff;
  border-bottom: 4px solid var(--border);
}

.ui-game-inventory p{
  margin: 0;
}

.ui-game-inventory footer{
  display: grid;
  grid-template-columns: 1fr auto;
  /* Le libelle se cale sur le milieu du montant, pas sur le haut de sa case. */
  align-items: center;
  padding: 13px 15px;
  background: var(--surface-2);
  border-top: 3px solid var(--border);
}

.ui-game-inventory .dock-resource:hover{
  background: var(--surface-2);
}

.ui-game-inventory .dock-resource div{
  display: grid;
}

.ui-game-inventory .dock-resource strong{
  font-size: 13px;
}

.ui-game-inventory .dock-resource small{
  font-size: 10px;
  color: var(--ink);
}

.ui-game-inventory .dock-resource>b{
  display: grid;
  text-align: right;
  color: var(--accent);
}

.ui-game-inventory .stock-dock-list{
  overflow: auto;
  flex: 1;
  padding: 0 10px;
}

.ui-game-inventory .dock-resource{
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 3px;
  border: 0;
  border-bottom: 1px solid var(--surface-2);
  background: transparent;
  text-align: left;
  color: var(--ink);
}

.ui-game-inventory .dock-empty{
  display: none;
}

.ui-game-inventory .dock-icon{
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.sun{
  position: absolute;
  right: 7%;
  top: 5%;
  font-size: 65px;
}

.path{
  position: absolute;
  left: 4%;
  right: -5%;
  bottom: 18%;
  height: 45px;
  background: #d5ad6a;
  border: 5px solid #94663d;
  transform: rotate(-4deg);
}

.fields{
  left: 4%;
  top: 13%;
  background: var(--surface-3);
}

.ranch{
  left: 38%;
  top: 10%;
  background: var(--surface-3);
}

.workshop{
  left: 8%;
  bottom: 7%;
  background: var(--surface-2);
}

.town{
  right: 4%;
  bottom: 9%;
  background: var(--surface-3);
}

.ui-game-content h1,.ui-game-content h2,.ui-game-content h3{
  color: var(--ink);
}

.ui-game-content input,.ui-game-content select{
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.ui-game-content .library-toggle{
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
}

@media (min-width:1101px) {
  .ui-game-inventory{
    position: fixed;
    z-index: 70;
    right: 0;
    top: 0;
    width: 292px;
    height: 100vh;
  }
}

.ui-game-content.game-place{
  color: var(--ink);
}

.ui-game-content.game-place .recipe-materials>div{
  border-color: var(--surface-2);
  background: var(--surface-2);
  color: var(--ink);
}

.ui-game-content.game-place .catalogue{
  padding: 14px;
  border: 4px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-2);
}

.ui-game-content.game-place .catalogue>header{
  padding: 14px 18px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink);
}

.ui-game-content.game-place .catalog-group{
  margin-top: 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.ui-game-content.game-place .catalog-group>header{
  padding: 12px 15px;
  border: 0;
  border-bottom: 2px solid var(--border);
  background: var(--surface-3);
  color: var(--ink);
}

.ui-game-content.game-place .catalog-group>header h2{
  color: var(--ink);
}

.ui-game-content.game-place .catalogue-grid{
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}

.ui-game-content.game-place .catalogue-grid>article{
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
}

.ui-game-content.game-place .catalogue-grid>article:nth-child(even){
  background: var(--surface-2);
}

@media (min-width:1351px) {
  .ui-game-hud{
    margin-right: 292px;
  }
}

.contract-icon{
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 23px;
}

.contract-history-list{
  display: grid;
}

.contract-history-list article{
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--surface-2);
}

.contract-history-list article:first-child{
  border-top: 0;
}

.contract-history-list article div{
  display: grid;
}

.contract-history-list article small{
  color: var(--ink);
}

.contract-history-list article>b{
  padding: 5px 9px;
  border-radius: 6px;
  font: 800 11px "Nunito",sans-serif;
}

.contract-history-list .completed{
  background: var(--surface-2);
  color: var(--ink);
}

.contract-history-list .expired{
  background: var(--surface-2);
  color: var(--ink);
}

.place-contracts{
  display: grid;
  gap: 16px;
  padding-top: 24px;
}

/* Colonnes */

/* Blocs internes */

/* Textes */

/* Formulaire */

/* Icône */
.place-contracts .contract-icon{
    flex-basis: 42px;
    width: 42px;
    height: 42px;
}

.place-history{
  display: grid;
  gap: 12px;
  padding-top: 24px;
}

.place-history .history-filters{
  display: flex;
  gap: 7px;
  padding: 7px;
  border: 2px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface-3);
  box-shadow: 0 4px rgba(28,32,28,.10);
}

.place-history .history-filters button{
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--accent-dark);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: 800 12px "Nunito",sans-serif;
  cursor: pointer;
}

.place-history time{
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.place-history .history-amount{
  padding-left: 12px;
  border-left: 1px solid var(--border);
  text-align: right;
  font: 800 15px "Nunito",sans-serif;
}

.ui-game-content.place-contracts{
  align-content: start;
  justify-content: stretch;
  grid-auto-rows: max-content;
  grid-template-rows: none;
}

.crop-sprite{
  display: block;
  width: 34px;
  height: 34px;
  background-image: url("../images/crop-sprites-v1.webp");
  background-repeat: no-repeat;
  background-size: 800% 700%;
  background-position: var(--sprite-x) var(--sprite-y);
  filter: drop-shadow(0 1px 1px #4e382633);
}

.workshop-sprite{
  display: block;
  width: 40px;
  height: 40px;
  background-image: url("../images/workshop-sprites-v5.webp");
  background-repeat: no-repeat;
  background-size: 800% 1200%;
  background-position: var(--sprite-x) var(--sprite-y);
  filter: drop-shadow(0 1px 1px #4e382633);
}

.product-sprite--supplement{
  background-image: url("../images/product-sprites-supplement-v3.webp");
  background-size: 800% 700%;
}

.resource-medal .crop-sprite,
.dock-icon .crop-sprite,
.resource-medal .extraction-sprite,
.dock-icon .extraction-sprite,
.resource-medal .workshop-sprite,
.dock-icon .workshop-sprite{
  width: 90%;
  height: 90%;
}

.back-to-top{
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 2px solid var(--accent-dark);
  border-radius: 10px;
  font: 900 20px/1 "Nunito","Trebuchet MS",sans-serif;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s,transform .18s,visibility .18s;
  cursor: pointer;
}

.back-to-top:hover,.back-to-top:focus-visible{
  opacity: 1;
  outline: 0;
}

.back-to-top:focus-visible{
  box-shadow: 0 0 0 3px var(--accent)66,0 3px rgba(28,32,28,.10);
}

@media (min-width:1351px) {
  .back-to-top{
    right: 314px;
    bottom: 80px;
  }
}

@media (prefers-reduced-motion:reduce) {
  .back-to-top{
    transition: none;
  }
}

@media (min-width:1101px) {
  .ui-game-hud{
    padding-inline: 16px;
  }

  .ui-game-logo{
    min-width: 245px;
  }
}

.extraction-sprite{
  display: block;
  width: 40px;
  height: 40px;
  background-image: url("../images/extraction-sprites-v1.webp");
  background-repeat: no-repeat;
  background-size: 500% 400%;
  background-position: var(--sprite-x) var(--sprite-y);
  filter: drop-shadow(0 2px 1px #3e302633);
}

.place-quarry .catalogue-icon .extraction-sprite{
  width: 100%;
  height: 100%;
}

.ui-game-inventory .dock-icon :is(.crop-sprite,.extraction-sprite){
  width: 72%;
  height: 72%;
}

/* L'attribut hidden doit gagner : les cartes du jeu sont en display:grid,
   ce qui annulait le masquage des filtres et de la pagination. */
.ui-game [hidden]{display:none !important;}

.history-pagination{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--ink-soft);
}

.history-pagination[hidden]{
  display: none;
}

.history-pagination span{
  grid-column: 2;
  justify-self: center;
  margin: 0;
  color: var(--ink-soft);
  font: 800 12px/1 var(--font-body);
}

.history-pagination span b{color:var(--ink);}

.history-pagination :is(button,a){
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--accent-dark);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  font: 800 11px var(--font-body);
  cursor: pointer;
}

.history-pagination :is(button:disabled,[aria-disabled="true"]){
  opacity: .42;
  cursor: not-allowed;
}

.place-history .history-filters button:focus-visible,
.history-pagination :is(button,a):focus-visible{
  outline: 3px solid var(--accent-dark);
  outline-offset: 2px;
}

.history-pagination>:first-child{grid-column:1;justify-self:start;}
.history-pagination [aria-disabled="true"]{pointer-events:none;}

.ui-auth-shell .gate-sun{
  position: absolute;
  top: 7%;
  right: 8%;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%,var(--surface-2) 0 32%,var(--surface-2) 66%,var(--surface-2) 100%);
  box-shadow: 0 0 0 16px #fff0a828,0 0 0 34px #fff0a815,0 0 60px #ffe07f88;
  animation: gate-sun 8s ease-in-out infinite;
}

@keyframes gate-sun {
  50% {
    transform: scale(1.06);
  }
}

.ui-auth-shell .gate-cloud{
  position: absolute;
  width: 98px;
  height: 30px;
  border-radius: 30px;
  background: #fffdf8;
  filter: drop-shadow(0 8px 10px #4f9cc02e);
  animation: gate-drift 70s linear infinite;
}

.ui-auth-shell .gate-cloud:before,.ui-auth-shell .gate-cloud:after{
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: #fffdf8;
}

.ui-auth-shell .gate-cloud:before{
  left: 11px;
  width: 46px;
  height: 46px;
}

.ui-auth-shell .gate-cloud:after{
  right: 13px;
  width: 33px;
  height: 33px;
}

.ui-auth-shell .gate-cloud.c1{
  top: 11%;
  left: -20%;
  transform: scale(1);
}

.ui-auth-shell .gate-cloud.c2{
  top: 26%;
  left: -20%;
  transform: scale(.66);
  opacity: .9;
  animation-duration: 96s;
  animation-delay: -30s;
}

.ui-auth-shell .gate-cloud.c3{
  top: 4%;
  left: -20%;
  transform: scale(1.32);
  animation-duration: 118s;
  animation-delay: -72s;
}

.ui-auth-shell .gate-cloud.c4{
  top: 34%;
  left: -20%;
  transform: scale(.5);
  opacity: .8;
  animation-duration: 84s;
  animation-delay: -14s;
}

@keyframes gate-drift {
  to {
    left: 120%;
  }
}

.ui-auth-shell .gate-hills{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 46%;
  height: 0;
  z-index: 1;
}

.ui-auth-shell .gate-hills i:nth-child(1){
  left: -10%;
  width: 54%;
  height: 132px;
  background: var(--surface-2);
}

.ui-auth-shell .gate-hills i:nth-child(2){
  right: -12%;
  width: 62%;
  height: 158px;
  background: var(--surface-2);
}

.ui-auth-shell .gate-hills i:nth-child(3){
  left: 22%;
  width: 46%;
  height: 104px;
  background: var(--surface-2);
}

.ui-auth-shell .gate-hills i:nth-child(4){
  right: 14%;
  width: 38%;
  height: 82px;
  background: var(--surface-2);
}

.ui-auth-shell .gate-trees{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 46%;
  height: 0;
  z-index: 2;
}

.ui-auth-shell .gate-trees i{
  position: absolute;
  bottom: 1px;
  width: 24px;
  height: 28px;
  background: var(--surface-2);
  border-radius: 50% 50% 42% 42%;
  box-shadow: inset -5px -4px 0 rgba(28,32,28,.10);
}

.ui-auth-shell .gate-trees i:after{
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 5px;
  height: 8px;
  margin-left: -2.5px;
  border-radius: 0 0 2px 2px;
  background: #7c5535;
}

.ui-auth-shell .gate-trees i:nth-child(1){
  left: 1%;
  transform: scale(1.18);
}

.ui-auth-shell .gate-trees i:nth-child(2){
  left: 6%;
  transform: scale(.76);
}

.ui-auth-shell .gate-trees i:nth-child(3){
  left: 41%;
  transform: scale(.86);
}

.ui-auth-shell .gate-trees i:nth-child(4){
  left: 47%;
  transform: scale(1.06);
}

.ui-auth-shell .gate-trees i:nth-child(5){
  left: 55%;
  transform: scale(.7);
}

.ui-auth-shell .gate-trees i:nth-child(6){
  left: 63%;
  transform: scale(.95);
}

.ui-auth-shell .gate-trees i:nth-child(7){
  left: 74%;
  transform: scale(1.12);
}

.ui-auth-shell .gate-trees i:nth-child(8){
  left: 85%;
  transform: scale(.72);
}

.ui-auth-shell .gate-trees i:nth-child(9){
  left: 94%;
  transform: scale(1.22);
}

.ui-auth-shell .gate-field{
  position: absolute;
  left: 0;
  right: 0;
  top: 54%;
  bottom: 0;
  z-index: 1;
  background-image: linear-gradient(180deg,transparent 0 14%,#ffffff1c 14% 29%,transparent 29% 50%,#2b582514 50% 69%,transparent 69% 83%,#ffffff16 83% 100%);
}

.ui-auth-shell .gate-shell{
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(360px,436px);
  /* Les deux colonnes se calent l'une sur l'autre : la plus haute donne
     la hauteur, l'autre suit. Inscription comme connexion. */
  align-items: stretch;
  align-content: center;
  justify-items: stretch;
  justify-content: center;
  gap: 44px;
  width: min(1160px,100%);
  margin: 0 auto;
  padding: 34px 22px 96px;
}

.ui-auth-shell .gate-story>*{
  position: relative;
}

.ui-auth-shell .gate-story h1 em{
  font-style: normal;
  color: var(--ink-soft);
  text-shadow: none;
}

.ui-auth-shell .gate-story>p{
  max-width: 42ch;
  margin: 0 auto;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
  text-shadow: none;
}

.ui-auth-shell .gate-panel{
  display: grid;
  align-items: stretch;
  justify-items: center;
}

.ui-auth-shell .gate-footer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px max(12px,env(safe-area-inset-bottom));
  border-top: 4px solid var(--accent-dark);
  background: var(--surface);
  box-shadow: 0 -8px 28px #1e341a30;
  color: var(--ink-soft);
  font: 800 12px/1.2 var(--font-body,"Nunito",sans-serif);
}

.ui-auth-shell .gate-footer nav{
  display: flex;
  align-items: center;
  gap: 12px;
}

.ui-auth-shell .gate-footer a{
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ui-auth-shell .gate-story:before,
.ui-auth-shell .gate-card:before{
  position: absolute;
  inset: 7px;
  border: 2px dashed var(--surface-2);
  border-radius: 14px;
  pointer-events: none;
}

.ui-auth-shell .gate-card>*{
  position: relative;
}

.ui-auth-shell .gate-story .ui-game-logo{
  min-width: 0;
  gap: 12px;
}

.ui-auth-shell .gate-story .ui-game-logo strong{
  text-shadow: 0 2px 0 #ffffff8f;
}

.ui-auth-shell .gate-story .ui-game-logo small{
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.ui-auth-shell .gate-panel>.gate-card{
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.ui-auth-shell .gate-card h2:has(+.form-intro){
  margin-bottom: 9px;
  padding-bottom: 0;
  border-bottom: 0;
}

.ui-auth-shell form.stack{
  display: grid;
  gap: 13px;
  margin: 0;
}

.ui-auth-shell label{
  display: grid;
  gap: 5px;
  font: 900 11px/1.2 "Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink);
}

.ui-auth-shell input:not([type=checkbox]){
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 3px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: 700 15px/1 "Nunito","Trebuchet MS",sans-serif;
  box-shadow: inset 0 3px #e8d7a740;
  transition: border-color .15s,box-shadow .15s;
}

.ui-auth-shell input:not([type=checkbox])::placeholder{
  color: var(--ink-soft);
  font-weight: 600;
}

.ui-auth-shell input:not([type=checkbox]):focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent)3d;
}

.ui-auth-shell .password-wrap{
  position: relative;
  display: block;
}

.ui-auth-shell .password-wrap input{
  padding-right: 82px;
}

.ui-auth-shell .password-wrap button{
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 11px;
  border: 2px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font: 900 10px/1 "Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ui-auth-shell .password-wrap button:hover{
  background: var(--surface-2);
}

.ui-auth-shell .form-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.ui-auth-shell .form-row a:hover,.ui-auth-shell .form-foot a:hover{
  color: var(--ink);
}

.ui-auth-shell label.check{
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 12px/1.35 "Nunito","Trebuchet MS",sans-serif;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.ui-auth-shell input[type=checkbox]{
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.ui-auth-shell .form-row a,.ui-auth-shell .form-foot a{
  color: var(--ink-soft);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ui-auth-shell .strength{
  height: 10px;
  margin-top: 7px;
  border: 2px solid var(--border);
  border-radius: 9px;
  background: #f1e4c1;
  overflow: hidden;
}

.ui-auth-shell .strength i{
  display: block;
  height: 100%;
  transition: width .25s;
}

.ui-auth-shell .strength-label{
  font: 800 11px/1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-mute);
}

.ui-auth-shell .password-rules{
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.ui-auth-shell .password-rules li{
  padding: 3px 8px;
  border: 2px solid var(--surface-2);
  border-radius: 8px;
  background: var(--surface-2);
  font: 800 10px/1.4 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
}

.ui-auth-shell .password-rules li.valid{
  border-color: var(--accent);
  background: #e6f6da;
  color: var(--positive);
}

.ui-auth-shell .password-rules li.valid:before{
  content: "✓ ";
}

.ui-auth-shell small[data-error]{
  min-height: 0;
  font: 700 11px/1.3 "Nunito","Trebuchet MS",sans-serif;
  color: #c9482f;
}

.ui-auth-shell small[data-match]{
  font: 800 11px/1.3 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
}

.ui-auth-shell button.primary{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 4px;
  border: 3px solid var(--accent-dark);
  border-radius: 14px;
  background: var(--accent);
  color: var(--surface);
  font: 900 16px/1 "Baloo 2","Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  box-shadow: 0 5px rgba(28,32,28,.10),inset 0 -4px rgba(28,32,28,.10);
  transition: transform .1s,box-shadow .1s,background .15s;
}

.ui-auth-shell button.primary:hover{
  background: var(--accent-dark);
}

.ui-auth-shell button.primary:active{
  transform: translateY(4px);
  box-shadow: 0 1px rgba(28,32,28,.10),inset 0 -2px rgba(28,32,28,.10);
}

.ui-auth-shell button.primary:disabled,.ui-auth-shell button.primary.is-loading{
  opacity: .68;
  cursor: progress;
}

@media (prefers-reduced-motion:reduce) {
  .ui-auth-shell .gate-cloud,.ui-auth-shell .gate-sun{
    animation: none;
  }
}

.ui-auth-shell .gate-hills i,
.ui-auth-shell .gate-front i{
  position: absolute;
  bottom: -2px;
  border-radius: 50% 50% 0 0/100% 100% 0 0;
}

.ui-auth-shell .gate-front i:nth-child(1){
  right: -20%;
  width: 86%;
  height: 152px;
  background: var(--surface-2);
}

.ui-auth-shell .gate-front i:nth-child(2){
  left: -18%;
  width: 76%;
  height: 122px;
  background: var(--surface-2);
}

.ui-auth-shell .gate-front i:nth-child(3){
  left: 34%;
  width: 78%;
  height: 96px;
  background: var(--surface-2);
}

.ui-auth-shell .gate-front b{
  position: absolute;
  width: 46px;
  height: 54px;
  background: var(--surface-2);
  border-radius: 50% 50% 42% 42%;
  box-shadow: inset -9px -7px 0 rgba(28,32,28,.10);
}

.ui-auth-shell .gate-front b:after{
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 10px;
  height: 15px;
  margin-left: -5px;
  border-radius: 0 0 3px 3px;
  background: #6f4a2e;
}

.ui-auth-shell .gate-front b:nth-child(4){
  left: 17%;
  bottom: 106px;
}

.ui-auth-shell .gate-front b:nth-child(5){
  left: 4%;
  bottom: 96px;
  transform: scale(.78);
}

.ui-auth-shell .gate-front b:nth-child(6){
  left: 69%;
  bottom: 78px;
  transform: scale(1.16);
}

.ui-auth-shell .gate-front b:nth-child(7){
  left: 92%;
  bottom: 62px;
  transform: scale(.86);
}

.ui-game-stage>.ui-game-column{
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ui-game-stage>.ui-game-column>.ui-game-content{
  flex: 1 0 auto;
}

.ui-game-footer{
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 13px 24px;
  background: var(--surface);
  border-top: 5px solid var(--accent-dark);
  box-shadow: 0 -4px 0 #56351f22;
}

.ui-game-footer .foot-brand{
  display: flex;
  align-items: center;
  gap: 5px;
}

.ui-game-footer .foot-brand>span{
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 3px #bd7d20);
}

.ui-game-logo div,
.ui-game-footer .foot-brand>div{
  display: flex;
  flex-direction: column;
}

.ui-game-footer .foot-brand strong{
  font: 900 19px/1.1 "Baloo 2","Nunito","Trebuchet MS",sans-serif;
}

.ui-game-footer .foot-brand small{
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9aa197;
}

.ui-game-footer .foot-links{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.ui-game-footer .foot-links a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 36px;
  padding: 0 15px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 3px rgba(28,32,28,.10);
  transition: transform .1s,box-shadow .1s,background .15s;
}

.ui-game-footer .foot-links a:hover{
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 5px rgba(28,32,28,.10);
}

.ui-game-footer .foot-links a:active{
  transform: translateY(1px);
  box-shadow: 0 1px rgba(28,32,28,.10);
}

.ui-game-content .ui-panel>header>h1 b,.ui-game-content .ui-panel>header>h2 b{
  font: 900 12px/1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-mute);
  vertical-align: middle;
}

.ui-game-content .ui-panel__tools{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-left: auto;
}

.ui-game-content .ui-panel>header input[type=search],.ui-game-content .ui-panel>header select{
  width: auto;
  min-width: 190px;
  height: 34px;
  padding: 0 11px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font: 700 13px/1 "Nunito","Trebuchet MS",sans-serif;
  box-shadow: inset 0 2px transparent;
}

.ui-game-content .ui-panel__body>:first-child{
  margin-top: 0;
}

.ui-game-content .ui-panel .catalog-group{
  margin: 0 0 14px;
}

.ui-game-content .ui-panel__body>.ui-actionbar{
  width: 100%;
  flex-wrap: wrap;
}

.ui-game-content .ui-panel__body>.ui-actionbar strong{
  margin: 0 auto 0 0;
  font: 700 15px/1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
}

.ui-game-content .ui-panel__body>.ui-actionbar select{
  width: auto;
  min-width: 240px;
  height: 40px;
  padding: 0 12px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font: 700 13px/1 "Nunito","Trebuchet MS",sans-serif;
  box-shadow: inset 0 2px transparent;
}

.ui-game-content .ui-panel>header button{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 13px;
  line-height: 1;
  font-size: 12.5px;
  border-radius: 10px;
  box-sizing: border-box;
}

.ui-game-content .ui-panel>header form{
  display: flex;
  align-items: center;
  height: 34px;
}

.offer-resource{
  display: flex;
  align-items: center;
  gap: 14px;
}

.offer-resource small,.offer-price small{
  color: var(--ink);
  font: 800 9px/1.2 "Nunito",sans-serif;
  letter-spacing: .08em;
}

.offer-resource h2{
  margin: 3px 0;
  color: var(--ink);
  font-size: 23px;
}

.offer-resource p{
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.offer-price{
  display: grid;
  gap: 4px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.offer-resource .catalogue-icon{
  display: grid;
  place-items: center;
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  border: 2px solid var(--border);
  background: var(--surface-2);
}

.offer-resource .extraction-sprite{
  width: 58px;
  height: 58px;
}

.extraction-wait{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 110px;
  padding: 20px;
  background: transparent;
  text-align: left;
}

.extraction-wait>span{
  font-size: 34px;
}

.extraction-wait h2{
  margin: 0 0 4px;
  color: var(--ink);
}

.extraction-wait p{
  margin: 0;
  color: var(--ink);
}

.extraction-offer{
  display: grid;
  align-items: center;
  gap: 18px;
  min-height: 104px;
  padding: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: 0 4px rgba(28,32,28,.10);
  grid-template-columns: minmax(0,1fr) 210px 230px;
}

.extraction-offer .offer-price{
  grid-template-columns: 1fr;
  gap: 3px;
}

.extraction-offer .offer-price small:nth-of-type(2){
  margin-top: 7px;
}

.ui-game-content .ui-panel__body>.ui-toolbar,.ui-game-content .ui-panel__body>.history-filters{
  width: 100%;
  margin: 0 0 13px;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.ui-game-content .ui-panel__body>.history-filters button{
  flex: 0 0 auto;
  min-height: 34px;
  height: 34px;
  padding: 0 13px;
  border: 2px solid var(--accent-dark);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font: 900 12px/1 "Nunito","Trebuchet MS",sans-serif;
}

.ui-game-content .ui-panel__body input[type=search]{
  width: auto;
  min-width: 230px;
  height: 34px;
  padding: 0 11px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font: 700 13px/1 "Nunito","Trebuchet MS",sans-serif;
  box-shadow: inset 0 2px transparent;
}

.ui-game-content .ui-panel>header input[type=search]:focus,
.ui-game-content .ui-panel>header select:focus,
.ui-game-content .ui-panel__body>.ui-actionbar select:focus,
.ui-game-content .ui-panel__body input[type=search]:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent)3d;
}

.ui-game-content .ui-panel__body>.catalog-group:first-child{
  margin-top: 0;
}

.ui-auth-shell .gate-story h1{
  margin: 16px 0 12px;
  font: 900 clamp(24px,2.6vw,38px)/1.1 "Baloo 2","Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
  text-shadow: none;
  white-space: nowrap;
  margin-top: 26px;
}

.ui-auth-shell .gate-slides>article.is-active{
  opacity: 1;
  transform: none;
}

.ui-auth-shell .gate-dots{
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}

.ui-auth-shell .gate-dots button.is-active{
  width: 24px;
  border-radius: 7px;
  border-color: var(--accent-dark);
  background: var(--accent);
}

.ui-game-logo>img{
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  margin-right: 10px;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #5a341f55);
}

.ui-game-footer .foot-brand>img{
  flex: 0 0 auto;
  width: 56px;
  height: 40px;
  border-radius: 0;
  object-fit: contain;
  transform: scale(1.3);
  transform-origin: center;
  filter: drop-shadow(0 2px 2px #5a341f55);
}

.ui-auth-shell .gate-slides span{
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 3px 0 #e8d7a7);
}

.ui-auth-shell .gate-slides strong{
  font: 800 18px/1.1 "Baloo 2","Trebuchet MS",sans-serif;
  color: var(--ink);
}

.ui-auth-shell .gate-slides p{
  max-width: 34ch;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink-mute);
}

.ui-auth-shell .gate-dots button{
  width: 10px;
  height: 10px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  transition: width .25s,background .25s,border-color .25s;
}

@media (prefers-reduced-motion:reduce) {
  .ui-auth-shell .gate-slides>article{
    transition: none;
  }
}

.ui-game>.ui-game-stage{
  flex: 1 0 auto;
  min-height: 0;
}

.ui-game-content .sell-form{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 7px;
  align-items: stretch;
}

.ui-game .ui-game-hud{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width:1351px) {
  .ui-game .ui-game-hud{
    width: calc(100% - 292px);
    max-width: calc(100% - 292px);
    margin-right: 0;
  }

}

.ui-game-content .ui-panel__body>.ui-actionbar .bulk-all{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 4px 0 0;
  padding: 0 11px 0 9px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  font: 900 11px/1 "Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink);
  cursor: pointer;
  box-shadow: inset 0 2px transparent;
}

.ui-game-content .ui-panel__body>.ui-actionbar .bulk-all:hover{
  background: var(--accent-soft);
}

.ui-game-content .contract-history-list article{
  grid-template-columns: 24px 1fr auto;
  gap: 9px;
  padding: 6px 14px;
}

.ui-game-content .contract-history-list article>span{
  font-size: 16px;
  line-height: 1;
}

.ui-game-content .contract-history-list article div{
  gap: 1px;
}

.ui-game-content .contract-history-list article strong{
  font-size: 13px;
  line-height: 1.25;
}

.ui-game-content .contract-history-list article>b{
  padding: 3px 8px;
  font-size: 10px;
}

.ui-game-content .world-card .world-grid{
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 10px;
}

.weather-impact{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:12px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface-2);
  color:var(--ink);
}
.weather-impact small{
  font:700 10px/1.35 var(--font-body);
  color:var(--ink-mute);
}

.weather-impact>div{
  display: grid;
  gap: 2px;
  min-width: 0;
}

.weather-impact strong{
  font: 900 12px/1.2 "Nunito","Trebuchet MS",sans-serif;
}

.weather-impact ul{
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0 0 0 14px;
  list-style: disc;
  font: 700 11px/1.4 var(--font-body);
}

.weather-impact li{
  color:var(--ink-soft);
}

.ui-game.weather-snow::after{
  opacity: .45;
  background-image: radial-gradient(circle,#fff 0 2px,transparent 2.5px),radial-gradient(circle,#fff 0 1.5px,transparent 2px);
  background-size: 70px 70px,45px 45px;
  background-position: 0 0,22px 18px;
  animation: none;
}

.ui-game.weather-fog::after{
  opacity: .12;
  background: linear-gradient(100deg,transparent,white 35%,transparent 70%);
  animation: none;
}

.ui-game.weather-ice::after,.ui-game.weather-frost::after{
  opacity: .12;
  background: linear-gradient(135deg,#dff6ff,transparent 42%,#c9efff);
}

.ui-game.weather-heat::after{
  opacity: .08;
  background: #f49b38;
}

.ui-game.weather-hail::after{
  opacity: 0;
  background-image: none;
  animation: none;
}

.ui-game::after{
  content: "";
  position: fixed;
  display: none;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .8s ease;
}

@media (prefers-reduced-motion:reduce) {
  .ui-game::after{
    animation: none;
  }
}

.soil-reading strong{
  color: var(--ink);
}

.soil-reading strong.soil-trop-sec{
  color: var(--ink-soft);
}

.soil-reading strong.soil-trop-humide,.soil-reading strong.soil-sature{
  color: var(--ink);
}

.soil-reading strong.soil-optimal{
  color: var(--ink);
}

.ui-auth-shell .gate-front{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  z-index: 2;
  display: none;
}

.ui-auth-shell .gate-crops{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 27%;
  min-height: 170px;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.ui-auth-shell .gate-fence{
  position: absolute;
  left: -3%;
  right: -3%;
  bottom: 26%;
  height: 38px;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(90deg,var(--surface-2) 0 9px,transparent 9px 94px);
  filter: drop-shadow(0 3px 0 #3a5c2b1f);
}

.ui-auth-shell .gate-fence:before,.ui-auth-shell .gate-fence:after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  box-shadow: inset 0 -3px 0 rgba(28,32,28,.10);
}

.ui-auth-shell .gate-fence:before{
  top: 6px;
}

.ui-auth-shell .gate-fence:after{
  top: 22px;
}

.ui-auth-shell .gate-crops .soil{
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg,#00000000 0 12px,#0000000f 12px 24px),linear-gradient(180deg,var(--surface-2) 0,#8b5832 45%,#704525 100%);
}

.ui-auth-shell .gate-crops .soil:before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 10px;
  background: var(--surface-2);
  box-shadow: 0 4px 0 #0000001a;
}

.ui-table-grid{overflow:hidden;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);}
.ui-table-grid>:is(header,article){display:grid;grid-template-columns:var(--ui-table-columns,minmax(0,1fr));align-items:center;gap:12px;padding:9px 14px;}
.ui-table-grid>header{background:var(--surface-3);font:800 10px/1.2 var(--font-body);text-transform:uppercase;}
.ui-table-grid>article{min-height:62px;border-bottom:1px solid var(--border);color:var(--ink);font:700 12px/1.35 var(--font-body);}
.ui-table-grid>article[hidden]{display:none;}
.ui-table-grid>article:nth-child(even){background:var(--surface-2);}
.ui-table-grid>article:last-of-type{border-bottom:0;}
.ui-table-grid>footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-top:1px solid var(--border);background:var(--surface-3);color:var(--ink-soft);font:700 12px/1.35 var(--font-body);}
.ui-table-grid--players>:is(header,article){grid-template-columns:40px minmax(140px,1fr) minmax(180px,1.4fr) minmax(200px,auto) 96px;}
.ui-table-icon{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--border-strong);border-radius:8px;background:var(--surface-2);color:var(--ink);font-size:17px;box-shadow:none;}
.ui-table-cell{display:grid;gap:3px;min-width:0;}
.ui-table-cell strong{overflow:hidden;color:var(--ink);font:800 12px/1.25 var(--font-body);text-overflow:ellipsis;white-space:nowrap;}
.ui-table-cell small{overflow:hidden;color:var(--ink);font:700 10px/1.35 var(--font-body);text-overflow:ellipsis;}
.ui-table-cell a{color:var(--ink);}
.ui-table-cell code{color:var(--ink);font:700 11px/1.4 ui-monospace,Consolas,monospace;word-break:break-word;}
.ui-table-time{justify-self:end;color:var(--ink);font:800 12px/1.3 var(--font-body);text-align:right;white-space:nowrap;}
.ui-table-tag{justify-self:start;padding:6px 9px;border:1px solid var(--border);border-radius:8px;background:var(--surface-2);color:var(--ink);font:900 10px/1 var(--font-body);text-transform:uppercase;white-space:nowrap;}
.ui-table-tag.is-danger{border-color:#9c3e31;background:var(--negative-soft);color:var(--negative-dark);}

.ui-form-list{display:grid;gap:10px;}
.ui-form-row{display:grid;grid-template-columns:180px minmax(0,1fr) auto;align-items:center;gap:9px 14px;padding:11px 14px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);}
.ui-form-row--danger{border-color:#d9a98f;background:var(--warning-soft);}
.ui-form-row>h2{grid-column:1;display:grid;gap:3px;margin:0;color:var(--ink);font:900 14px/1.25 var(--font-display);}
.ui-form-row--danger>h2{color:var(--negative-dark);}
.ui-form-fields{grid-column:2;display:flex;align-items:center;flex-wrap:wrap;gap:9px;min-width:0;}
.ui-form-fields>label{display:grid;gap:3px;min-width:0;color:var(--ink-mute);font:900 9px/1 var(--font-body);text-transform:uppercase;}
.ui-form-row :is(input,select){box-sizing:border-box;min-width:0;}
.ui-form-row [data-error]{color:var(--negative);font:800 11px/1.3 var(--font-body);text-transform:none;}
.ui-form-row [data-error]:empty{display:none;}

.ui-table-grid--assets>:is(header,article){grid-template-columns:40px minmax(140px,1fr) minmax(210px,1.6fr) minmax(130px,.9fr) 168px;}
.ui-table-grid--owned>:is(header,article){grid-template-columns:40px minmax(220px,1.8fr) minmax(140px,1fr) 168px;}
.ui-inline-form{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;}
.ui-inline-form input{box-sizing:border-box;width:96px;min-width:0;}

.ui-game.weather-rain::after,.ui-game.weather-storm::after{
  opacity: .18;
  background: repeating-linear-gradient(105deg,transparent 0 18px,rgba(82,124,155,.65) 19px 20px,transparent 21px 37px);
  animation: none;
  display: none;
}

.ui-game.weather-rain .ui-game-stage::before,.ui-game.weather-storm .ui-game-stage::before{
  content: "";
  position: absolute;
  inset: 0;
  height: auto;
  z-index: 0;
  pointer-events: none;
  opacity: .10;
  background: repeating-linear-gradient(105deg,transparent 0 18px,rgba(82,124,155,.65) 19px 20px,transparent 21px 37px);
  animation: none;
}

.ui-game .workshop-hint{
  margin: 0;
  font: 700 11px/1.45 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-soft);
}

.ui-game .workshop-hint.is-warning{
  color: var(--warning);
}

body .ui-game .recipe-preview :is([data-recipe-inputs],[data-recipe-outputs])>span{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  align-items: center;
  gap: 4px 10px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--surface-2);
}

body .ui-game .recipe-preview :is([data-recipe-inputs],[data-recipe-outputs])>span>b{
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font: 800 11px/1.3 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
}

body .ui-game .recipe-preview :is([data-recipe-inputs],[data-recipe-outputs])>span>b>i{
  flex: 0 0 auto;
  font-style: normal;
  font-size: 13px;
  opacity: .9;
}

body .ui-game .recipe-preview :is([data-recipe-inputs],[data-recipe-outputs])>span>b>span{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 800 11px/1.3 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
}

body .ui-game .recipe-preview :is([data-recipe-inputs],[data-recipe-outputs])>span>em{
  font: 900 11px/1.3 "Nunito","Trebuchet MS",sans-serif;
  font-style: normal;
  color: var(--ink-mute);
  white-space: nowrap;
}

body .ui-game .recipe-preview .recipe-materials>i{
  align-self: center;
}

.ui-game .player-rank{
  flex: 0 0 auto;
  padding-inline: 10px;
  color: inherit;
  text-decoration: none;
}

.ui-game .player-rank:hover{
  filter: brightness(1.03);
}

.farm-chat-panel>header small{
  font: 900 10px/1 "Nunito",sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.farm-chat-panel>header button{
  cursor: pointer;
}

.farm-chat-rooms button small{
  font-size: 9px;
  text-transform: uppercase;
  opacity: .75;
}

.farm-chat-rooms form{
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.farm-chat-rooms input{
  width: 100%;
  padding: 8px;
}

.farm-chat-rooms form button,.farm-chat-form button{
  cursor: pointer;
}

.farm-chat-empty{
  margin: auto;
  color: var(--ink);
  font: 800 13px "Nunito",sans-serif;
  text-align: center;
}

.farm-chat-bubble{
  font-size: 24px;
  transform: none;
}

.farm-chat-bubble span{
  font-size: 22px;
}

.farm-chat-bubble b{
  position: absolute;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  font: 900 11px/18px "Nunito",sans-serif;
  right: -9px;
  top: -8px;
}

.ui-chat{
  z-index: 70;
}

.farm-chat-bans{
  gap: 5px;
  padding: 8px;
  margin-top: 6px;
  border-radius: 10px;
}

.farm-chat-bans>small{
  color: var(--ink-mute);
  font: 900 9px/1 "Nunito",sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.farm-chat-bans button{
  display: grid;
  grid-template-columns: 16px minmax(0,1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 2px solid var(--accent-dark);
  border-radius: 9px;
  background: var(--negative-soft);
  color: var(--ink);
  box-shadow: none;
  font: 800 11px "Nunito",sans-serif;
  cursor: pointer;
}

.farm-chat-bans button b{
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--ink);
  font: 900 9px/1.4 "Nunito",sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.farm-chat-bans button:hover{
  background: var(--surface-2);
}

.farm-chat-messages{
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.farm-chat-bubble:hover{
  filter: brightness(1.04);
}

.ui-table-grid--board>header,.ui-table-grid--board>article{
  grid-template-columns: 40px minmax(160px,1.4fr) minmax(160px,1.2fr) minmax(150px,auto) 72px;
}

[data-admin-assets].is-loading{
  opacity: .55;
  transition: opacity .12s ease;
}

html{
  scrollbar-gutter: stable;
  scrollbar-color: #c6a56b #f3e7c4;
  scrollbar-width: thin;
}

.ui-game :is(.stock-dock-list,.farm-chat-messages,.farm-chat-rooms [data-chat-rooms],.ui-table-grid,.catalogue){
  scrollbar-color: #c6a56b #f3e7c4;
  scrollbar-width: thin;
}

::-webkit-scrollbar{
  width: 11px;
  height: 11px;
}

.ui-error-page{
  display: grid;
  place-items: center;
  padding: 24px;
}

.ui-auth-shell,.ui-error-page{
  background: var(--positive);
}

.ui-game ::selection{
  background: var(--surface-2);
  color: var(--ink);
}

.ui-error-page .error-page{
  display: grid;
  place-items: center;
  min-height: auto;
  padding: 0;
}

.ui-error-page .error-card{
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: min(520px,calc(100vw - 32px));
  padding: 26px 28px 28px;
  border: 3px solid #7a5333;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 6px #4f3423,0 18px 45px #14220f33;
  text-align: center;
}

.ui-error-page .error-logo{
  width: 170px;
  height: auto;
  margin-bottom: 2px;
}

.ui-error-page .error-card>span{
  font: 900 58px/1 "Baloo 2","Nunito",sans-serif;
  color: #c07a3a;
  letter-spacing: -.02em;
}

.ui-error-page .error-card h1{
  margin: 0;
  font: 800 24px/1.2 "Baloo 2","Nunito",sans-serif;
  color: var(--positive);
}

.ui-error-page .error-card p{
  margin: 0;
  color: var(--ink-soft);
  font: 700 13px/1.5 "Nunito","Trebuchet MS",sans-serif;
}

.ui-error-page .error-card pre{
  max-width: 100%;
  margin: 0;
  padding: 10px;
  overflow: auto;
  text-align: left;
  border: 1px solid #d5b981;
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
}

body{
  overflow-y: scroll;
  background: var(--surface-2);
}

.ui-game .resource-medal,.ui-game .dock-icon{
  border: 2px solid color-mix(in srgb,var(--resource,var(--border)) 55%,var(--border));
  border-radius: 9px;
  background: color-mix(in srgb,var(--resource,#8a5735) 18%,var(--surface));
  color: var(--ink);
  box-shadow: inset 0 -2px #8b684322;
}

body dialog:focus,body dialog:focus-visible{
  outline: none;
}

.ui-auth-shell{
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  background: var(--surface-2);
}

.ui-auth-shell .gate-scene{
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: url("../images/terravia-login-background.webp") center center/cover no-repeat;
}

.ui-auth-shell .gate-scene:before{
  left: 0;
  right: 0;
  content: "";
  position: absolute;
  inset: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(180deg,#0d1a0d55 0,#0d1a0d1a 40%,#0d1a0d7a 100%);
}

.ui-auth-shell .gate-scene:after{
  position: absolute;
  left: 0;
  right: 0;
  top: 54%;
  bottom: 0;
  background: radial-gradient(120% 70% at 50% 0,var(--surface-2) 0,var(--surface-2) 38%,transparent 72%),linear-gradient(180deg,var(--surface-2) 0,var(--surface-2) 30%,var(--surface-2) 100%);
  display: none;
  content: none;
}

.ui-auth-shell .gate-scene>*{
  display: none;
}

.ui-auth-shell .gate-story:before,.ui-auth-shell .gate-card:before{
  display: none;
  content: none;
}

.ui-auth-shell .gate-card h2{
  padding-bottom: 14px;
  margin: 0 0 18px;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border,var(--border));
  background: var(--surface-3,var(--surface-3));
  font: 800 20px/1.2 var(--font-title,"Nunito",sans-serif);
  color: var(--ink,var(--ink));
}

.ui-auth-shell .gate-card>form,.ui-auth-shell .gate-card>p,.ui-auth-shell .gate-card>div{
  margin-left: 22px;
  margin-right: 22px;
}

.ui-auth-shell .gate-card>*:last-child{
  margin-bottom: 20px;
}

.ui-auth-shell .gate-card input:not([type=checkbox]){
  border: 1px solid var(--border-strong,var(--border-strong));
  border-radius: var(--radius,10px);
  background: var(--surface,var(--surface));
  color: var(--ink,var(--ink));
}

.ui-auth-shell a{
  color: var(--accent-dark,var(--accent-dark));
}

.ui-auth-shell .gate-brand{
  display: block;
  margin: 0 auto;
  width: min(380px,86%);
}

.ui-auth-shell .gate-brand img{
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(28,32,28,.28));
}

.ui-auth-shell .gate-carousel{
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong,var(--border-strong));
}

.ui-auth-shell .gate-slides{
  position: relative;
  max-width:520px;
  margin: 0 auto;
  height:390px;
}

.ui-auth-shell .gate-slides>article{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .45s ease,transform .45s ease;
  pointer-events: none;
  gap: 0;
  justify-content: flex-start;
}

.ui-auth-shell .gate-slides>article>img{
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 1px solid var(--border,var(--border));
  border-radius: var(--radius,10px);
  box-shadow: var(--shadow,0 1px 2px rgba(28,32,28,.07));
}

.ui-auth-shell .gate-slides>article>strong{
  margin-top:14px;
  font-size:19px;
}

.ui-auth-shell .gate-slides>article>p{
  max-width: none;
  text-align:center;
  white-space:normal;
  font-size:13px;
  margin-top:6px;
}

.ui-auth-shell .gate-players b{
  color: var(--accent-dark,var(--accent-dark));
}

.ui-auth-shell .form-foot{
  margin: 16px 0 0;
  padding-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  border-top: 1px dashed var(--border-strong,var(--border-strong));
  border-bottom: 0;
  border-left: 0;
  border-right: 0;
}

.ui-auth-shell .form-intro{
  margin: 0 0 18px;
  padding-bottom: 15px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-mute);
  border-bottom: 1px dashed var(--border-strong,var(--border-strong));
  border-top: 0;
  border-left: 0;
  border-right: 0;
}

.ui-auth-shell .gate-card .form-foot{
  padding-top: 18px;
}

/* La hauteur en trop de la carte se place avant le bouton d'envoi : il descend
   au bas du formulaire, et le pointille reste entre lui et le lien du bas. */
.ui-auth-shell .gate-card form.stack{
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.ui-auth-shell .gate-card form.stack>button[type="submit"]{
  margin-top: auto;
}

.ui-auth-shell .gate-story{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 28px 28px;
  border: 4px solid var(--accent-dark);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 0 #56351f5c,0 22px 44px #1e341a3d;
  color: var(--ink);
  overflow: visible;
  height: auto;
  align-self: stretch;
  justify-content: center;
}

.ui-auth-shell .gate-players{
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong,var(--border-strong));
  font: 700 13px/1.5 var(--font-body,"Nunito",sans-serif);
  color: var(--ink-soft,var(--ink-soft));
}

.ui-auth-shell .gate-card{
  position: relative;
  width: 100%;
  border: 4px solid var(--accent-dark);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 0 #56351f5c,0 26px 50px #1e341a40;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

@media(max-width:760px){
  .ui-auth-shell .gate-shell{
    grid-template-columns: minmax(0,460px);
    gap: 18px;
    width: min(520px,100%);
    padding: 26px 22px 82px;
  }
}

.weather-sprite{
  display: inline-block;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  background-image: url("../img/weather/weather-spritesheet-v1.webp");
  background-repeat: no-repeat;
  background-size: 400% 300%;
  background-position: 0 0;
  font-size: 0;
  line-height: 0;
  filter: drop-shadow(0 1px 1px #2d241a33);
}

.weather-sprite--sun{
  background-position: 0% 0%;
}

.weather-sprite--clouds{
  background-position: 33.333% 0%;
}

.weather-sprite--rain{
  background-position: 66.666% 0%;
}

.weather-sprite--storm{
  background-position: 100% 0%;
}

.weather-sprite--fog{
  background-position: 0% 50%;
}

.weather-sprite--snow{
  background-position: 33.333% 50%;
}

.weather-sprite--frost{
  background-position: 66.666% 50%;
}

.weather-sprite--ice{
  background-position: 100% 50%;
}

.weather-sprite--hail{
  background-position: 0% 100%;
}

.weather-sprite--heat{
  background-position: 33.333% 100%;
}

.weather-sprite--dry{
  background-position: 66.666% 100%;
}

.weather-yield small{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  margin-top: 3px;
  padding: 3px 6px;
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--ink-soft);
  font: 900 9px/1 "Nunito","Trebuchet MS",sans-serif;
  white-space: nowrap;
}

.weather-yield small.is-bonus{
  background: var(--positive-soft);
  color: var(--positive);
}

.weather-yield small.is-malus{
  background: var(--warning-soft);
  color: #9a5130;
}

.weather-yield small.is-neutral{
  background: var(--warning-soft);
  color: var(--ink-soft);
}

.home-dashboard{
  display: grid;
  grid-template-columns: minmax(360px,.92fr) minmax(460px,1.08fr);
  gap: 14px;
  align-items: start;
}

.ui-metrics p{
  display: grid;
  gap: 2px;
  margin: 0;
  min-width: 0;
}

.world-card--compact .world-grid{
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}

.weather-impact--summary{
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  gap:7px;
  min-width:0;
  margin:0;
}

.world-card--compact .weather-station{
  align-items: center;
  margin-top: 9px;
}

.leaderboard-card{
  margin-top: 14px;
}

.leaderboard-list{
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-list li{
  display: grid;
  grid-template-columns: 58px minmax(0,1fr) 150px 140px;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  background: var(--surface);
}

.leaderboard-list li:nth-child(odd){
  background: var(--surface-2);
}

.leaderboard-list li.is-me{
  background: var(--positive-soft);
}

.leaderboard-list span{
  font: 900 17px/1 "Baloo 2","Nunito",sans-serif;
  color: var(--ink);
}

.leaderboard-list strong{
  font: 900 14px/1.2 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-list small{
  font: 800 11px/1.2 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-soft);
}

.leaderboard-list b{
  justify-self: end;
  font: 900 13px/1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
}

.leaderboard-mine{
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font: 900 12px/1.2 "Nunito","Trebuchet MS",sans-serif;
}

.ui-game-content.ui-game-home .leaderboard-card--preview .leaderboard-list li{
  grid-template-columns: 38px minmax(0,1fr) auto;
  gap: 5px 8px;
  min-height: 44px;
  padding: 8px 9px;
}

.ui-game-content.ui-game-home .leaderboard-card--preview .leaderboard-list li>b{
  grid-column: 3;
  justify-self: end;
  font-size: 11px;
  white-space: nowrap;
}

.leaderboard-list__meta{
  display:grid;
  align-content:center;
  justify-items:end;
  gap:3px;
  min-width:0;
  color:var(--ink);
}

.leaderboard-list__meta b,
.leaderboard-list__meta small{
  font:800 11px/1.15 var(--font-body);
  white-space:nowrap;
}

.ui-game-content.ui-game-home .leaderboard-card--preview .leaderboard-list li strong{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-card--preview .ui-panel__body{
  padding: 14px;
}

.weather-forecast span{
    display:grid;
    grid-template-columns:30px minmax(0,1fr);
    grid-template-rows:auto auto;
    align-items:center;
    gap:1px 6px;
    min-height:44px;
    padding:6px 8px;
    box-sizing:border-box;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
}

.weather-forecast small{
  font: 900 8px/1 "Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.weather-forecast b{
  min-width: 0;
  font: 900 10px/1.1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-card--preview .leaderboard-list{
  gap: 6px;
}

.leaderboard-card--preview .leaderboard-list li{
  grid-template-columns: 40px minmax(0,1fr) auto;
  min-height: 42px;
  padding: 7px 9px;
}

.leaderboard-card--preview .leaderboard-list small{
  display: none;
}

.leaderboard-card--preview .leaderboard-list b{
  grid-column: auto;
  font-size: 12px;
}

.ui-game-content.ui-game-home .domain-card .ui-metrics article:first-child p{
  display: grid;
  flex-wrap: wrap;
  align-items: initial;
  gap: 2px;
}

.ui-game-content.ui-game-home .domain-card .ui-metrics small{
  white-space: nowrap;
}

.ui-game-content.ui-game-home .world-card--compact .world-grid{
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
}

.ui-game-content.ui-game-home .domain-card{
  grid-column: 1;
  grid-row: 1;
}

.ui-game-content.ui-game-home .leaderboard-card--preview{
  margin-top: 0;
}

.ui-game-content.ui-game-home .home-dashboard{
  display: grid;
  align-items: start;
  grid-template-columns: minmax(360px,.92fr) minmax(520px,1.08fr);
  gap: 14px;
}

.ui-game-content.ui-game-home .home-dashboard>.home-column{
  display:grid;
  align-content:start;
  gap:12px;
  min-width:0;
}

.ui-game-content.ui-game-home .home-dashboard>.home-column>.ui-panel{
  width:100%;
}

@media(max-width:1180px){
  .ui-game-content.ui-game-home .home-dashboard{grid-template-columns:1fr}
}

.ui-game-content.ui-game-home .home-dashboard>.ui-panel{
  margin-bottom: 0;
}

.ui-game .ui-game-content.game-place.place-factory .supply-note{
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--positive);
}

.ui-game .ui-game-content.game-place.place-factory .supply-note.supply-low{
  color: var(--warning);
}

.ui-game .ui-game-content.game-place.place-factory .supply-note.supply-starving{
  color: #a2402a;
}

.ui-game .ui-game-content.game-place.place-factory .supply-note.supply-idle{
  color: #8d8672;
}

.weather-day{
  display: grid;
  gap: 7px;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
}

.weather-day>strong{
  font: 900 11px/1 "Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-mute);
}

.weather-day>div{
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 6px;
}

.weather-day span{
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 6px;
  min-height: 38px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
}

.weather-forecast .weather-sprite,
.weather-day .weather-sprite{
  grid-row: 1/3;
  width: 30px;
  height: 30px;
}

.weather-day small{
  font: 900 8px/1 "Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.weather-day b{
  min-width: 0;
  font: 900 10px/1.1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-day span.is-past{
  opacity: .5;
}

.weather-day span.is-current{
  border-color: var(--border);
  background: var(--surface-2);
  box-shadow: 0 2px rgba(28,32,28,.10);
}

.weather-alerts ul{
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.weather-alerts li b{
  font: 900 11px/1.1 "Nunito","Trebuchet MS",sans-serif;
}

.weather-alerts li em{
  font: 800 10px/1.2 "Nunito","Trebuchet MS",sans-serif;
  font-style: normal;
  text-align: right;
}

.weather-alerts li.weather-alert--danger{
  background: var(--negative-soft);
}

.weather-alerts li.weather-alert--danger b{
  color: var(--negative-dark);
}

.weather-yield{
  margin-top: 2px;
  font: 900 11px/1.2 "Nunito","Trebuchet MS",sans-serif;
  color: var(--positive);
}

.weather-yield--bad{
  color: #a2402a;
}

.weather-yield--neutral{
  color: var(--ink-soft);
}

.ui-game-content.ui-game-home .home-column>.ui-panel{
  margin: 0;
  grid-column: 1;
  grid-row: auto;
}

.ui-game-content.ui-game-home .home-dashboard>.world-card{
  grid-column: 2;
  grid-row: 1;
}

.ui-game .ui-game-content.game-place .extraction-sale .ui-panel__body.offer-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(max(300px,calc((100% - 24px) / 3)),1fr));
  gap: 12px;
  align-items: stretch;
}

.ui-game .ui-game-content.game-place .offer-grid .offer-resource h2{
  margin: 2px 0;
  font: 800 16px/1.2 "Baloo 2","Nunito",sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-game .ui-game-content.game-place .offer-grid .offer-resource p{
  font-size: 10px;
  line-height: 1.3;
}

.ui-game .ui-game-content.game-place .offer-grid .offer-price>p{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.ui-game .ui-game-content.game-place .offer-grid .offer-price small{
  font: 800 9px/1.5 "Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink);
}

.ui-game .ui-game-content.game-place .offer-grid .offer-price strong{
  font: 900 13px/1.5 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}

.ui-game .ui-game-content.game-place .offer-grid .offer-price input[type=number]{
  box-sizing: border-box;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--warning-soft);
  font: 900 13px/1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
  text-align: right;
}

.ui-game .ui-game-content.game-place .offer-grid .player-listing .offer-resource small{
  display: block;
  margin-top: 2px;
}

.ui-game .ui-game-content.game-place .offer-grid .extraction-offer form{
  display: block;
  align-self: end;
  margin: 0;
  padding: 0;
}

.ui-game .ui-game-content.game-place .offer-grid .extraction-wait h2{
  font-size: 16px;
  margin: 0;
}

.ui-game .ui-game-content.game-place .offer-grid .extraction-wait p{
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--ink);
}

.ui-game .ui-game-content.game-place .offer-grid .offer-resource{
  display: grid;
  grid-template-columns: 56px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ui-game .ui-game-content.game-place .offer-grid .offer-price{
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 0;
  border-left: 0;
  border-top: 2px dashed var(--border);
  padding-top: 8px;
}

.ui-game .ui-game-content.game-place .offer-grid .offer-resource .catalogue-icon{
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 9px;
}

.ui-game .ui-game-content.game-place .offer-grid .offer-resource .extraction-sprite{
  width: 46px;
  height: 46px;
}

.ui-game .ui-game-content.game-place .offer-grid .extraction-offer{
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 10px;
  min-height: 0;
  padding: 12px;
  border-radius: 11px;
  align-content: start;
}

.ui-game .ui-game-content.game-place .offer-grid .extraction-wait{
  grid-column: 1/-1;
  min-height: 88px;
}

.weather-forecast{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:7px;
    margin-top:9px;
    padding:9px 10px;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--surface);
    color:var(--ink);
    box-sizing:border-box;
}

.weather-forecast>strong{
  font: 900 11px/1 "Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-mute);
  grid-column: 1;
  align-self: center;
}

.weather-forecast>div{
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 6px;
  grid-column: 1/-1;
}

.weather-station-upgrade{
  grid-column: 2;
  justify-self: end;
  margin: 0;
  padding: 0;
}

.weather-station-upgrade button{
  height: 26px;
  padding: 0 10px;
  border: 2px solid var(--accent-dark);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font: 900 10px/1 "Nunito","Trebuchet MS",sans-serif;
  cursor: pointer;
}

.weather-station-upgrade button:hover:not(:disabled){
  background: var(--surface-2);
}

.weather-station-upgrade button:disabled{
  opacity: .5;
  cursor: not-allowed;
}

.weather-station-max{
  grid-column: 2;
  justify-self: end;
  align-self: center;
  font: 900 9px/1 "Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-mute);
  font-style: normal;
}

.place-admin .ui-toolbar{
  margin: 12px 0 0;
}

.herd-welfare.is-starving{
  border-color: #b9603f;
  background: var(--negative-soft);
  color: var(--negative-dark);
  animation: herdAlert 1.6s ease-in-out infinite;
}

@keyframes herdAlert {
  50% {
    box-shadow: 0 0 0 3px #b9603f33;
  }
}

.herd-hint.is-danger{
  border: 2px dashed #b9603f;
  background: var(--negative-soft);
  color: var(--negative-dark);
  font-weight: 900;
}

@media (prefers-reduced-motion:reduce) {
  .herd-welfare.is-starving{
    animation: none;
  }
}

/* Accent lisible : on garde la couleur produit pour le graphe,
   mais on assombrit les textes */

/* CHAÎNE ÉCONOMIQUE */

/* Les lignes de produits ne doivent plus être des cartes dans une carte */

/* Textes colorés : éviter le vert citron illisible */

.product-link{
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--ink-soft);
  text-underline-offset: 3px;
}

.ui-game .dock-resource .product-link{
  text-decoration-color: #c0a57080;
}

.product-chart .grid line{
  stroke: var(--surface-2);
  stroke-width: 1;
}

.product-chart .cursor{
  stroke: var(--ink-mute);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.product-chart .hit{
  fill: transparent;
}

.product-link:hover{
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.objective-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(max(280px,calc((100% - 24px) / 3)),1fr));
  gap: 12px;
}

.objective-card{
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.objective-card.is-ready{
  border-color: var(--positive-border);
  background: var(--positive-soft);
  box-shadow: 0 3px var(--positive-soft);
}

.objective-card.is-claimed{
  opacity: .72;
}

.objective-card>header{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
}

.objective-card>header>div{
  display: grid;
  gap: 2px;
  min-width: 0;
}

.objective-card>header strong{
  font: 800 14px/1.2 "Baloo 2","Nunito",sans-serif;
  color: var(--ink);
}

.objective-card>header small{
  font: 700 11px/1.35 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-mute);
}

.objective-icon{
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  font-size: 20px;
}
.objective-icon>.terravia-ui-icon{
  width:30px;
  height:30px;
}

.objective-gauge{
  position: relative;
  height: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.objective-gauge>i{
  display: block;
  height: 100%;
  background: linear-gradient(90deg,var(--accent),var(--positive));
}

.objective-gauge>b{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 900 9px/1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--positive);
}

.objective-card>footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
}

.objective-reward{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font: 800 11px/1.3 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-soft);
}
.objective-reward>.terravia-ui-icon{width:18px;height:18px}

.objective-done{
  font: 900 11px/1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.objective-progress{
  font: 900 12px/1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-mute);
}

.objective-ready{
  font: 900 9px/1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--positive);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Récapitulatif « Tout récupérer » */
.claim-recap__totals{display:flex;gap:10px;padding:14px 18px 4px}
.claim-recap__totals>div{flex:1;display:grid;gap:2px;padding:10px 12px;border:1px solid var(--positive-border);border-radius:8px;background:var(--positive-soft);text-align:center}
.claim-recap__totals small{font-size:11px;opacity:.8}
.claim-recap__totals strong{font-size:18px}
.claim-recap__list{display:grid;gap:4px;max-height:44vh;margin:0;padding:10px 18px 14px;overflow:auto;list-style:none}
.claim-recap__list li{display:grid;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:8px;padding:6px 8px;border-radius:6px;background:var(--surface-3)}
.claim-recap__list .terravia-ui-icon{width:22px;height:22px}
.claim-recap__list small{opacity:.8;white-space:nowrap}
.place-objectives .objective-group{
  margin: 16px 0 10px;
  font: 800 15px/1.2 "Baloo 2","Nunito",sans-serif;
  color: var(--ink);
}

.place-objectives .objective-group:first-of-type{
  margin-top: 0;
}

.profile-emblem>img{width:100%;height:100%;object-fit:cover}
.profile-emblem{
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  font: 900 24px/1 "Baloo 2","Nunito",sans-serif;
  color: var(--ink);
}

.profile-badges{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 0;
}

.profile-badges b{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font: 900 11px/1.2 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-soft);
}
.profile-badges b>.terravia-ui-icon{width:16px;height:16px}

.profile-badges b.is-coop{
  border-color: var(--border);
  background: var(--positive-soft);
  color: var(--ink);
}

.profile-badges b.is-staff{
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--ink);
}

.medal-group{
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 10px;
  font: 800 15px/1.2 "Baloo 2","Nunito",sans-serif;
  color: var(--ink);
}

.medal-group:first-of-type{
  margin-top: 0;
}

.medal-group em{
  font: 900 11px/1 "Nunito","Trebuchet MS",sans-serif;
  font-style: normal;
  color: var(--ink-mute);
}

.medal-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(150px,1fr));
  gap: 10px;
}

.medal-badge{
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 12px 10px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg,var(--surface),var(--surface-2));
}

.medal-badge>span{
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 3px solid var(--border);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%,var(--surface-2),var(--surface-2));
  box-shadow: 0 2px rgba(28,32,28,.10);
  font-size: 22px;
}
.medal-badge>span>.terravia-ui-icon{
  width:34px;
  height:34px;
}

.medal-badge>strong{
  font: 900 12px/1.25 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
}

.medal-badge>small{
  font: 800 10px/1 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-mute);
}

.profile-link:hover{
  color: var(--ink);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.ui-game-content .ui-panel > header button.vcard-back,.ui-game-content .ui-panel > header a.vcard-back{
  height: 28px;
  min-height: 28px;
  padding: 0 11px;
  font: 900 11px/1 "Nunito","Trebuchet MS",sans-serif;
  letter-spacing: .05em;
}

.ui-game-content .catalog-group>header>div{
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ui-game-content.place-water .ui-metrics{
  grid-template-columns: repeat(3,minmax(0,1fr));
}

html:has(.ui-game),html body:has(.ui-game){
  background: var(--page);
}

.ui-game .ui-game-stage{
  background-color: var(--page);
  background-image: none;
}

.ui-game .ui-game-column{
  background: transparent;
}

.ui-game-content .ui-panel{
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ui-game-content .ui-panel>header{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 58px;
  padding: 12px 16px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
}

body .ui-game-content .ui-panel>header h1,html body .ui-game-content .ui-panel>header h2{
  font: 800 16px/1.2 var(--font-title);
  letter-spacing: -.01em;
  color: var(--ink);
}

.ui-game-content .ui-panel__body{
  padding: 14px 16px 16px;
  background: var(--surface);
  color: var(--ink);
}

.ui-game-content .ui-badge{
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  text-transform: uppercase;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-soft);
  font: 800 11px/1 var(--font-body);
  letter-spacing: .04em;
}

.ui-game-content .catalog-group{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.ui-game-content .catalog-group>header{
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-3);
}

.ui-game-content .catalog-group>header h2{
  font: 800 14px/1.2 var(--font-title);
  color: var(--ink);
}

.ui-game-content .ui-metrics small{
  color: var(--ink-mute);
}

.ui-game-content :is(.weather-day,.weather-forecast,.weather-alerts){
  border-color: var(--border);
  background: var(--surface-2);
  box-shadow: none;
}

.ui-game-content :is(.weather-day,.weather-forecast) span{
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
}

.ui-game-home :is(.weather-day,.weather-forecast)>div{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.ui-game-home :is(.weather-day,.weather-forecast)>div>span{
  grid-template-columns:34px minmax(0,1fr);
  min-height:60px;
  padding:9px;
  gap:3px 8px;
  box-sizing:border-box;
}
.ui-game-home :is(.weather-day,.weather-forecast) .weather-sprite{
  width:34px;
  height:34px;
}
.ui-game-home :is(.weather-day,.weather-forecast) small{
  font-size:9px;
  line-height:1.25;
}
.ui-game-home :is(.weather-day,.weather-forecast) b{
  font-size:11px;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
}

.ui-game-content .weather-station{
  border-color: var(--border);
  background: var(--surface-2);
  box-shadow: none;
}

.ui-game-content button:disabled{
  opacity: .45;
  filter: grayscale(.3);
}

.ui-game-content :is(.objective-gauge,.store-gauge>i){
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}

body .ui-game-content .objective-gauge>i,.ui-game-content .store-gauge>i>span{
  background: linear-gradient(90deg,var(--progress-start),var(--progress-end));
}

.ui-game-content .store-gauge.is-tight>i>span{
  background: linear-gradient(90deg,var(--warning),#dcab5c);
}

.ui-game-content .store-gauge.is-full>i>span{
  background: linear-gradient(90deg,var(--negative),#c9634b);
}

.ui-game-content .store-gauge>b{
  color: var(--ink);
}

.ui-game-content .store-gauge>em{
  color: var(--ink-mute);
}

.ui-game-content .leaderboard-list li{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
}

.ui-game-content .leaderboard-list li.is-me{
  border-color: var(--positive-border);
  background: var(--positive-soft);
}

.ui-game-content.place-leaderboard .leaderboard-tabs{
  display: flex;
  gap: 8px;
}

.ui-game-content.place-leaderboard .leaderboard-list li{
  grid-template-columns: 56px minmax(0,1fr) auto;
  grid-template-rows: auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
}

.ui-game-content.place-leaderboard .leaderboard-list li>span{
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.ui-game-content.place-leaderboard .leaderboard-list li>strong{
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.ui-game-content.place-leaderboard .leaderboard-list li>b{
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: end;
}

/* Classement : rang sous le pseudo, réputation sous les points, même style de sous-ligne. */
.ui-game-content.place-leaderboard .leaderboard-list li>:is(strong,b){display:grid;gap:2px}
.ui-game-content.place-leaderboard .leaderboard-list li>b{justify-items:end}
.ui-game-content.place-leaderboard .leaderboard-list li>:is(strong,b)>small{font-size:12px;font-weight:600;opacity:.85}

.ui-game-content.place-leaderboard .ui-badge{
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.ui-game-content .objective-card.is-ready{
  border-color: var(--positive);
  background: var(--positive-soft);
}

.ui-game-content :is(.objective-icon,.profile-emblem){
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--ink);
}

.ui-game-content .medal-badge>span{
  border: 2px solid #cba15f;
  background: var(--warning-soft);
  box-shadow: none;
}

.ui-game-content :is(.objective-group,.medal-group){
  color: var(--ink);
}

.ui-game-content :is(input,select,textarea){
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.ui-game .ui-game-hud{
  gap: 14px;
  padding-inline: 18px;
  background: var(--shell);
  border-bottom: 1px solid var(--shell-border);
  box-shadow: none;
}

.ui-game .ui-game-hud :is(strong,small,p,span,em){
  color: var(--surface-sunken);
}

.ui-game .ui-game-footer{
  background: var(--shell);
  border-top: 1px solid var(--shell-border);
}

.ui-game .ui-game-inventory footer a{
  background: var(--accent);
  color: #fff;
  box-shadow: none;
  border-radius: var(--radius);
}

.ui-game .dock-resource{
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
}

.ui-game .dock-resource:hover{
  background: var(--accent-soft);
}

.ui-game .ui-game-logo{
  flex: 0 0 auto;
  min-width: 0;
  gap: 0;
  padding: 0 4px;
}

.ui-game .ui-game-wordmark{
  height: 44px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}

.ui-game .ui-game-inventory>header small{
  color: var(--ink-mute);
}

.ui-game .ui-game-inventory>header button{
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-soft);
}

.ui-game .dock-resource :is(strong,b,small){
  color: var(--ink);
}

.ui-game .dock-resource small{
  color: var(--ink-mute);
}

.ui-game .dock-resource.dock-empty{
  opacity: .5;
}

.ui-game .ui-game-footer .foot-links a{
  border: 1px solid var(--shell-border);
  border-radius: var(--radius);
  background: var(--shell-raised);
  color: var(--shell-muted);
  box-shadow: none;
  padding: 7px 12px;
  font-weight: 800;
}

.ui-game-content .ui-metrics .is-income{
  color: var(--positive);
}

.ui-game-content .ui-metrics .is-expense{
  color: var(--negative);
}

.ui-game-content :is(.finance-upkeep,.finance-chart){
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.ui-game-content :is(.finance-upkeep,.finance-chart)>header{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: none;
}

.ui-game-content :is(.finance-upkeep,.finance-chart)>header h2{
  margin: 0;
  font: 800 13px/1.2 var(--font-title);
  letter-spacing: .02em;
  color: var(--ink);
}

.ui-game-content .finance-upkeep>header b{
  font: 900 14px/1 var(--font-body);
  color: var(--ink);
}

.ui-game-content .finance-upkeep ul{
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-game-content .finance-upkeep li{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: baseline;
  gap: 4px 12px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.ui-game-content .finance-upkeep li strong{
  font: 800 12px/1.2 var(--font-body);
  color: var(--ink);
}

.ui-game-content .finance-upkeep li small{
  grid-column: 1;
  font: 700 10px/1 var(--font-body);
  color: var(--ink-mute);
}

.ui-game-content .finance-upkeep li b{
  grid-column: 2;
  grid-row: 1/3;
  align-self: center;
  justify-self: end;
  font: 900 13px/1 var(--font-body);
  color: var(--ink);
}

.ui-game-content .finance-legend{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ui-game-content .finance-legend span{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 800 11px/1 var(--font-body);
}

.ui-game-content .finance-legend span:before{
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}

.ui-game-content .finance-legend .is-income{
  color: var(--positive);
}

.ui-game-content .finance-legend .is-expense{
  color: var(--negative);
}

.ui-game-content .finance-plot{
  padding: 10px 10px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.ui-game-content .finance-plot svg{
  display: block;
  width: 100%;
  height: 190px;
}

.ui-game-content .finance-grid{
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ui-game-content .finance-line{
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.ui-game-content .finance-line.is-income{
  stroke: var(--progress-start);
}

.ui-game-content .finance-line.is-expense{
  stroke: var(--negative);
  stroke-dasharray: 5 4;
}

.ui-game-content .finance-scale{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  margin: 6px 0 0;
  padding: 0 0 8px;
  list-style: none;
}

.ui-game-content .finance-scale li{
  text-align: center;
  font: 800 9px/1.2 var(--font-body);
  letter-spacing: .03em;
  color: var(--ink-mute);
  cursor: default;
}

.ui-game-content .finance-scale li.is-current{
  color: var(--accent-dark);
}

.ui-game-content .history-filters button{
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-soft);
  box-shadow: none;
  font-weight: 800;
}

.ui-game .ui-game-footer .foot-links a:hover,
.ui-game-content .history-filters button.active{
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ui-game-content [data-history-row][data-history-family="upkeep"] .history-icon{
  filter: grayscale(.35);
  opacity: .85;
}

.ui-game-content [data-history-row][data-history-family="upkeep"]{
  box-shadow: inset 3px 0 var(--warning);
}

.ui-game-content .history-amount.income{
  color: var(--positive);
}

.ui-game-content .history-amount.expense{
  color: var(--negative);
}

.ui-game-content .resource-medal{
  background: color-mix(in srgb,var(--resource) 12%,var(--surface-2));
  border-color: color-mix(in srgb,var(--resource) 35%,var(--border-strong));
}

.ui-game-content .weather-yield small{
  color: var(--ink-mute);
}

.ui-game-content .weather-yield small.is-malus{
  color: var(--negative);
}

.ui-game-content .weather-yield small.is-bonus{
  color: var(--positive);
}

.ui-game-content .soil-reading{
  color: var(--ink-soft);
}

.ui-game-content .ui-actionbar{
  color: var(--ink);
  box-shadow: 0 4px rgba(28,32,28,.10);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.ui-game-content .ui-actionbar>strong{
  color: var(--ink);
}

.ui-game-content .ui-actionbar .bulk-all{
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink);
}

.ui-game-content .secondary{
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: none;
}

.ui-game-content .season-boon{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  min-width: 0;
  gap: 6px 10px;
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
  color: #2f6b3a;
  font: 700 11px/1.4 var(--font-body);
}

.ui-game-content .season-boon b{
  font: 900 12px/1 var(--font-body);
}

.ui-game-content .finance-grants li b,.ui-game-content .finance-grants>header b{
  color: var(--positive);
}

.ui-game-content .contract-icon{
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb,var(--resource,#8a9b6a) 14%,var(--surface-2));
  box-shadow: none;
}

.ui-game-content .contract-origin{
  padding: 2px 8px;
  border-radius: 999px;
  font: 900 9px/1.5 var(--font-body);
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink-mute);
  font-style: normal;
}

.ui-game-content .contract-origin--cooperative{
  border-color: var(--positive-border);
  background: var(--positive-soft);
  color: var(--positive-dark);
}

.ui-game-content .contract-lock{
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 6px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
}

.ui-game-content .ui-actions{
  display: grid;
  gap: 6px;
  justify-items: stretch;
}

.ui-game-content.place-contracts .contract-history-list article:first-child{
  border-top: 1px solid var(--border);
}

.ui-game-content.place-contracts .contract-history-list article>span{
  grid-column: 1;
  grid-row: auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
}

.ui-game-content.place-contracts .contract-history-list article>div{
  grid-column: 2;
  display: grid;
  gap: 1px;
  min-width: 0;
}

.ui-game-content.place-contracts .contract-history-list article strong{
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-game-content.place-contracts .contract-history-list article small{
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-game-content.place-contracts .contract-history-list article>b{
  grid-column: 3;
  justify-self: end;
  align-self: center;
  margin-top: 0;
  padding: 3px 6px;
  font-size: 10px;
}

.ui-game-content.place-contracts .contract-history-list{
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
  padding: 8px;
}

.ui-game-content .contract-lock small{
  color: var(--ink-mute);
  font-weight: 800;
}

.ui-game-content.place-contracts .contract-history-list article{
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  grid-template-rows: auto;
  align-items: center;
  gap: 8px;
  min-height: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.ui-game-content .contract-history-list b.is-done{
  color: var(--positive);
}

.ui-game-content .contract-history-list b.is-failed{
  color: var(--negative);
}

.ui-game-content .published-list article{
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.ui-game-content .published-list strong{
  font: 800 13px/1.3 var(--font-body);
  color: var(--ink);
}

.ui-game-content .published-list small{
  display: block;
  font: 700 11px/1.4 var(--font-body);
  color: var(--ink-mute);
}

.ui-game-content .contract-origin--rare{
  border-color: var(--warning);
  background: var(--warning-soft);
  color: #8a5f16;
}

.ui-game :is(.ui-summary--total,.sale-suggestion,.recipe-preview,.equipment-soil,.equipment-irrigate,.herd-modal-form){
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--ink-soft);
}

.history-pagination :is(button,a):hover:not(:disabled):not([aria-disabled="true"]),
.ui-game-content .contract-origin--player,
.ui-game-content .profile-badges b.is-rank{
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.ui-game-content .rank-strip{
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.ui-game-content .rank-strip>header{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
}

.ui-game-content .rank-strip>header>div{
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.ui-game-content .rank-strip small{
  font: 700 10px/1.4 var(--font-body);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.ui-game-content .rank-strip strong{
  font: 800 18px/1.1 var(--font-title);
  color: var(--ink);
}

.ui-game-content .rank-strip p{
  margin: 0;
  font: 700 12px/1.25 var(--font-body);
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rang commercial : cases fixes par cle, jamais par ordre du bareme. */
.rank-sprite{
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  vertical-align: middle;
  background-image: url("../images/rank-sprites-v1.webp");
  background-repeat: no-repeat;
  background-size: 500% 200%;
  background-position: 0% 0%;
}
.rank-sprite--unknown{background-position:0% 0%}
.rank-sprite--local{background-position:25% 0%}
.rank-sprite--regional{background-position:50% 0%}
.rank-sprite--house{background-position:75% 0%}
.rank-sprite--industrial{background-position:100% 0%}
.rank-sprite--national{background-position:0% 100%}
.rank-sprite--manufacturer{background-position:25% 100%}
.rank-sprite--advanced{background-position:50% 100%}
.rank-sprite--strategic{background-position:75% 100%}
.rank-sprite--space{background-position:100% 100%}
.weather-alerts .weather-sprite,
.contract-ranks-list .rank-sprite{width:30px;height:30px}

.ui-game-content .rank-strip .rank-title{
  flex: 0 0 auto;
}

/* La pastille garde sa taille : seul le libelle se tronque. */
.ui-game-content .rank-strip .rank-outlet{
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: visible;
}

.ui-game-content .rank-strip .rank-outlet>span:first-child{
  display: inline-flex;
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font: 900 10px/1.4 var(--font-body);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ui-game-content .rank-strip .rank-outlet-text{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-game-content .rank-strip>header>b{
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface-2);
  font: 900 13px/1 var(--font-body);
  color: var(--accent-dark);
}

.ui-game-content .rank-progress-row{
  display: block;
}

.ui-game-content .rank-bar{
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.ui-game-content .rank-bar>i{
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg,var(--accent),var(--accent-dark));
}

.ui-game-content .rank-meta-row{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
}

.ui-game-content .rank-meta-row>small{
  text-transform: none;
  letter-spacing: 0;
  font: 700 11px/1.35 var(--font-body);
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
}

.ui-game .farm-chat-bubble b{
  border: 2px solid var(--shell-raised);
  border-color: var(--surface);
  background: var(--negative);
  color: #fff;
}

.ui-game .farm-chat-panel{
  color: var(--ink);
}

.ui-game .ui-game-inventory header,
.ui-game .farm-chat-panel>header{
  border-bottom: 1px solid var(--border);
  background: var(--surface-3);
}

.ui-game-content :is(input,select,textarea):focus,
.ui-game :is(.farm-chat-rooms input,.farm-chat-form input,.farm-chat-room-select):focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(169,112,63,.18);
  outline: none;
}

.ui-game :is(.farm-chat-rooms input,.farm-chat-form input,.farm-chat-room-select),
.ui-game .farm-chat-bans button{
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.ui-game .farm-chat-bans{
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
}

.ui-game .farm-chat-bans>small{
  color: var(--ink-mute);
}

.home-upkeep-reminder{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:6px 16px;
  margin:0 0 14px;
  padding:10px 12px;
  border-radius:var(--radius);
  background:var(--accent-soft);
  color:var(--ink-soft);
  font:600 12px/1.5 var(--font-body);
}
.home-upkeep-reminder strong{
  color:var(--ink);
}
.home-upkeep-reminder a{
  color:var(--accent-dark);
  font-weight:800;
  text-decoration:underline;
  text-underline-offset:3px;
}

.ui-game-content .upkeep-notice{
  display: grid;
  gap: 9px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.ui-game-content .upkeep-notice.is-warning{
  border-color: #c98a2e;
  border-left-color: #c98a2e;
  background: var(--warning-soft);
}

.ui-game-content .upkeep-notice.is-held{
  border-color: var(--border);
  border-left-color: var(--ink-mute);
  background: var(--surface-2);
}

.ui-game-content .upkeep-notice>header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
}

.ui-game-content .upkeep-notice>header>div{
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ui-game-content .upkeep-notice small{
  font: 700 10px/1.4 var(--font-body);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.ui-game-content .upkeep-notice strong{
  font: 800 17px/1.2 var(--font-title);
  color: var(--ink);
}

.ui-game-content .upkeep-notice p{
  margin: 0;
  font: 700 12px/1.45 var(--font-body);
  color: var(--ink-soft);
}

.ui-game-content .upkeep-notice form{
  margin: 0;
}

.ui-game-content .upkeep-steps{
  display: flex;
  gap: 5px;
}

.ui-game-content .upkeep-steps i{
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  cursor: help;
}

.ui-game-content .upkeep-steps i.is-passed{
  background: var(--negative);
}

.ui-game-content .upkeep-steps i.is-next{
  background: repeating-linear-gradient(90deg,var(--accent) 0 5px,transparent 5px 10px);
}

.ui-game-content .upkeep-notice>small{
  text-transform: none;
  letter-spacing: 0;
  font: 700 11px/1.6 var(--font-body);
  color: var(--ink-soft);
}

.ui-game-content .upkeep-notice>small b{
  color: var(--ink);
}

.ui-game-content .origin-columns{
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
  gap: 12px;
}

.ui-game-content .origin-columns>article{
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.ui-game-content .origin-columns h3{
  margin: 0;
  font: 800 14px/1.2 var(--font-title);
  color: var(--ink);
}

.ui-game-content .origin-list{
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-game-content .origin-list li{
  display: grid;
  grid-template-columns: 26px minmax(0,1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.ui-game-content .origin-list li>span{
  font-size: 16px;
  text-align: center;
}

.ui-game-content .origin-list strong{
  font: 800 12px/1.25 var(--font-title);
  color: var(--ink);
}

.ui-game-content .help-card>span{
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-3);
  font-size: 16px;
}

.ui-game-content .help-card>span>.terravia-ui-icon{
  width:26px;
  height:26px;
}

.ui-game-content .help-card>div{
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ui-game-content .help-card strong{
  font: 800 13px/1.3 var(--font-title);
  color: var(--ink);
}

.ui-game-content .help-card small{
  font: 700 11px/1.5 var(--font-body);
  color: var(--ink-mute);
}

.ui-game-content .help-article>header{
  display: grid;
  grid-template-columns: 46px minmax(0,1fr);
  gap: 13px;
  align-items: start;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
}

.ui-game-content .help-article h2{
  margin: 0;
  font: 800 20px/1.25 var(--font-title);
  color: var(--ink);
}

.ui-game-content .help-article p{
  margin: 0;
  font: 600 13px/1.7 var(--font-body);
  color: var(--ink);
}

.ui-game-content [data-help-count]{
  margin-left: auto;
  font: 700 11px/1.4 var(--font-body);
  color: var(--ink-mute);
}

.ui-game-content [data-help-card][hidden],html body .ui-game-content [data-help-group][hidden]{
  display: none;
}

.ui-game-content .help-list{
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(320px,1fr));
  gap: 8px;
  padding: 12px;
}

.ui-game-content .help-card{
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  gap: 11px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color .12s,background .12s;
}

.ui-game-content .help-article{
  max-width: 70ch;
  margin: 0 0 18px;
  display: grid;
  gap: 12px;
}

.ui-game-content .help-emblem{
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 21px;
}

.ui-game-content .help-emblem>.terravia-ui-icon{
  width:36px;
  height:36px;
}

.ui-game-content .help-lead{
  margin: 5px 0 0;
  font: 800 13px/1.55 var(--font-body);
  color: var(--accent-dark);
}

.ui-game-content .help-article :is(ul,ol){
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.ui-game-content .help-article li{
  font: 600 13px/1.6 var(--font-body);
  color: var(--ink);
}

.ui-game-content .help-article li::marker{
  color: var(--accent);
}

.ui-game-content .help-note{
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  font: 700 12px/1.65 var(--font-body);
  color: var(--ink);
}

.ui-game-content .help-table{
  overflow-x: auto;
}

.ui-game-content .help-table table{
  width: 100%;
  border-collapse: collapse;
  font: 700 12px/1.5 var(--font-body);
}

.ui-game-content .help-table :is(th,td){
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: left;
  color: var(--ink);
}

.ui-game-content .help-table thead th{
  background: var(--surface-3);
  font-weight: 800;
  color: var(--ink-soft);
}

.ui-game-content .help-table tbody th{
  background: var(--surface-2);
  white-space: nowrap;
}

.ui-game-content .help-links{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ui-game-content .help-links small{
  font: 700 10px/1.4 var(--font-body);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.ui-game .ui-game-footer .foot-brand{
  flex-direction: column;
}

.ui-game :is(.resource-medal,.dock-icon){
  border: 1px solid color-mix(in srgb,var(--resource,var(--border)) 45%,var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb,var(--resource,var(--surface-2)) 22%,var(--surface-2));
  box-shadow: none;
}

::-webkit-scrollbar-track{
  background: var(--surface-2);
}

::-webkit-scrollbar-thumb{
  background: var(--border-strong);
  border: 2px solid var(--surface-2);
  border-radius: 9px;
}

::-webkit-scrollbar-thumb:hover{
  background: var(--ink-mute);
}

::-webkit-scrollbar-corner{
  background: var(--surface-2);
}

.ui-game .product-info-dialog .product-modal-title{
    display:flex;
    align-items:center;
    gap:12px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Ajustement ciblé champs : filtre compact et cartes blanches */

/* Boutons unifiés */

/* Cartes d’actifs communes : champs,élevages,mines,usines et puits.
   Modifier ce bloc pour changer leur structure sur toutes les pages.
   Les variantes décrivent le contenu (grille large, aménagements),pas le métier. */

.asset-grid{
  --asset-grid-track: max(420px,calc((100% - 20px) / 3));
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(min(100%,var(--asset-grid-track)),1fr));
  align-items:start;
  gap: 10px;
  margin: 0;
}

.asset-grid--wide{
  --asset-grid-track: max(560px,calc((100% - 10px) / 2));
}

.asset-card{
  --asset-equipment-width: 0px;
  position: relative;
  display: grid;
  grid-template-columns: 82px var(--asset-equipment-width) minmax(0,1fr) 144px;
  min-width: 0;
  min-height: 126px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  align-self:start;
}

.asset-card--equipped{
  --asset-equipment-width: 30px;
}

.asset-card__visual{
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

@supports (color:color-mix(in lab, red, red)) {
  /* Meme teinte que les icones du dock entrepot, sur toute la case. */
  .asset-card__visual{
    background: color-mix(in srgb,var(--crop,#87967c)24%,var(--surface-2));
  }
}

.asset-card__visual>span{
  display: grid;
  place-items: center;
  font-size: 38px;
  filter: drop-shadow(0 7px 5px #0003);
}

.asset-card__body{
  grid-column: 3;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-content: start;
  gap: 4px 8px;
  min-width: 0;
  padding: 10px;
}

.asset-card__header{
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 30px;
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: 2px dashed var(--border);
}

.asset-card__header>h2{
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font: 800 15px/1.2 var(--font-title);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card__badge{
  flex: 0 0 auto;
  padding: 2px 8px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-mute);
  font: 900 10px/1.5 var(--font-body);
  letter-spacing: .03em;
  white-space: nowrap;
}

.asset-card__body>p{
  display: contents;
}

.asset-card__body>p>span,.asset-card__body>p>strong{
  min-width: 0;
  overflow: hidden;
  line-height: 16.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card__body>p>span{
  grid-column: 1;
  color: var(--ink-mute);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.asset-card__body>p>strong{
  grid-column: 2;
  color: var(--ink);
  font-size: 11px;
  text-align: right;
}

.asset-card__actions{
  grid-column: 4;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-content: end;
  gap: 7px;
  min-width: 0;
  padding: 8px 8px 10px;
  border-left: 1px solid var(--border);
  background: var(--surface-2);
}

.asset-card__actions form{
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.ui-game-content .contract-history-list article small,
.asset-card__actions>small,
.asset-card__actions>strong{
  font-size: 11px;
  line-height: 1.2;
}

.asset-card__selection{
  position: absolute;
  top: 7px;
  right: 9px;
  z-index: 1;
  display: flex;
  padding: 0;
}

.ui-game-content .ui-panel__body>.ui-actionbar .bulk-all input,
.asset-card__selection input{
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.asset-card__equipment{
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 1px;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
}

.asset-card__equipment-item{
  display: grid;
  place-items: center;
  width: 22px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 15px;
  filter: grayscale(.7);
  opacity: .72;
}

.asset-card__equipment-item.is-installed{
  border-color: var(--positive-border);
  background: var(--positive-soft);
  filter: none;
  opacity: 1;
}

.asset-card__calendar{
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(12,minmax(0,1fr));
  gap: 2px;
  margin-top: 4px;
}

.asset-card__calendar>span{
  display: grid;
  place-items: center;
  height: 15px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--ink-mute);
  font: 800 7px/1 var(--font-body);
}

/* Mois en cours : pastille pleine (un contour se faisait rogner par les cartes). Même rendu partout. */
.asset-card__calendar>.is-current,
.asset-card__calendar>.is-current.is-growing{
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.asset-card__body>[data-plot-yield-row]>small{
  display: none;
}

.asset-card__calendar>.is-growing,
.asset-card__badge.welfare-good{
  border-color: var(--positive-border);
  background: var(--positive-soft);
  color: var(--positive);
}

.asset-card__badge.welfare-fair{
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.asset-card__badge:is(.welfare-poor,.is-crowded){
  border-color: var(--negative);
  background: var(--negative-soft);
  color: var(--negative);
}

.asset-card__body>p>strong.wear-good{
  color: var(--positive);
}

.asset-card__body>p>strong.wear-fair{
  color: var(--warning);
}

.asset-card__body>p>strong.wear-poor,.asset-card__actions>.is-depleted{
  color: var(--negative);
}

/* === Composants communs Terravia === */

.ui-empty{
  box-sizing: border-box;
  grid-column: 1/-1;
  display: grid;
  place-items: center;
  gap: 6px;
  width: 100%;
  min-height: 120px;
  margin: 0;
  padding: 24px;
  color: var(--ink-soft);
  font: 700 12px/1.45 var(--font-body);
  text-align: center;
}
.ui-empty>span{
  font-size: 36px;
  line-height: 1;
}
.ui-empty h2{
  margin: 0;
  color: var(--ink);
  font: 800 18px/1.2 var(--font-title);
}
.ui-empty[hidden]{
  display: none;
}

.product-info-dialog .market-analysis-list>div:last-child{
  border-bottom: 0;
}

.product-info-dialog .product-chart .grid line{
  stroke: var(--border);
  stroke-opacity: .65;
}

.product-info-dialog .product-chart .cursor{
  stroke: var(--market-accent);
  stroke-dasharray: 3 3;
}

.product-info-dialog .price-up{
  color: var(--positive);
}

.product-info-dialog .price-down{
  color: var(--negative);
}

/* Les alias historiques restent actifs durant la migration.
   Ils seront supprimés uniquement lorsque toutes les vues/partials auront été audités. */

.ui-panel{
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  box-sizing: border-box;
}

.ui-panel__body{
  min-width:0;
}

.ui-panel__tools{
  display:flex;
  align-items:center;
}

.ui-badge{
  box-sizing:border-box;
}

.ui-toolbar{
  flex-wrap: wrap;
  align-items: center;
  gap: .7rem;
  margin: 1.2rem 0;
  display: flex;
  box-sizing: border-box;
}

.ui-field{
  box-sizing:border-box;
}

.ui-field :is(input,select,textarea){
  box-sizing:border-box;
}

.ui-metrics{
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 8px;
  margin-top: 12px;
  box-sizing: border-box;
}

.ui-summary{
  box-sizing:border-box;
}

.ui-tabs{
  box-sizing:border-box;
}

.ui-actions,.ui-hint{
  box-sizing:border-box;
}

.ui-actions{
  display:flex;
  align-items:center;
}

.ui-data-list{
  display:block;
  min-width:0;
  margin:0;
  padding:0;
  border:0;
  background:var(--surface);
  box-sizing:border-box;
}

.ui-data-card{
  display:grid;
  align-items:center;
  min-width:0;
  box-sizing:border-box;
}

.ui-data-card>*{
  min-width:0;
}

.ui-data-sub{
  color:var(--ink-mute);
  font:700 10px/1.2 var(--font-body);
  text-transform:none;
  letter-spacing:0;
}

.ui-data-cell{
  display:grid;
  align-content:center;
  min-height:42px;
  padding-left:12px;
  border-left:1px solid var(--border);
}

.ui-data-cell>strong{
  color:var(--ink);
  font:800 14px/1.35 var(--font-body);
  white-space:nowrap;
}

.ui-data-cell--value>strong,
.ui-data-cell--gain>strong{
  color:var(--positive);
}

.ui-actionbar{
  box-sizing:border-box;
  z-index: 20;
  color: #eef3ea;
  gap: .7rem;
  margin: 1rem 0;
  padding: .7rem 1rem;
  position: sticky;
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 5px transparent;
  top: 76px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.ui-game,.ui-page,.ui-chat,.ui-chat-body{
  box-sizing:border-box;
}

.ui-page,.ui-chat-body{
  min-width:0;
}

.ui-game-content.ui-game-home .home-column{
  align-content: start;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.ui-game-content.ui-game-home .home-dashboard > *,.ui-game-content.ui-game-home .home-column > *,.ui-game-content.ui-game-home .ui-panel{
  min-width: 0;
}

.ui-game-content.ui-game-home .ui-panel > .ui-panel__body{
  padding: 14px 16px;
  box-sizing: border-box;
}

.ui-game-content.ui-game-home .domain-card .ui-metrics{
  display: grid;
  gap: 9px;
  margin-top: 0;
  margin: 0;
}

.ui-game-content.ui-game-home .world-card--compact > .ui-panel__body{
  display: grid;
  gap: 10px;
}

.ui-game-content.ui-game-home .world-card--compact .world-grid,.ui-game-content.ui-game-home .world-card--compact .weather-day,.ui-game-content.ui-game-home .world-card--compact .weather-forecast,.ui-game-content.ui-game-home .world-card--compact .weather-alerts{
  margin-top: 0;
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .ui-game-content.ui-game-home .home-dashboard{
    grid-template-columns: 1fr;
  }

  .ui-game-content.ui-game-home .home-dashboard > .world-card{
    grid-column: 1;
    grid-row: auto;
  }
}

/* Contrats + stock : compatibilité des vues legacy encore présentes */
.catalogue-grid>article:hover{
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: inset 0 2px #ffffff14,0 8px transparent;
}
.catalogue-grid>article{
  gap: .55rem;
  padding: 1rem;
  display: grid;
  border-width: 3px;
  padding-top: 1.2rem;
  position: relative;
  overflow: hidden;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: inset 0 2px #ffffff10,0 5px transparent;
  transition: all .14s;
}
.catalogue-grid p,.catalogue-grid article>div small{
  color: var(--ink-soft);
}

.game-place .catalogue-grid{
  display: block;
  margin-top: 0;
}

.ui-game-content.place-contracts,.ui-game-content.place-history{
  gap: 8px;
  row-gap: 8px;
}

.ui-game-content .ui-panel__body>.catalog-group:last-child{
  margin-bottom: 0;
}

.ui-dashboard,.ui-page,.ui-panel--domain{
  box-sizing:border-box;
}

/* Contrats : finition visuelle */

/* Modale produit : restauration des styles du terminal de marché */
.product-info-dialog{
  --market-accent-strong: color-mix(
    in srgb,
    var(--market-accent) 68%,
    var(--ink) 32%
  );
}
.product-info-dialog .market-meter{
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  align-content: start;
}
.product-info-dialog .market-meter>header span{
  color: var(--ink-mute);
  font: 800 9px/1.2 var(--font-body);
  letter-spacing: 0;
  text-transform: uppercase;
}
.product-chart{
  position: relative;
  padding: 8px 4px 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
}
.product-chart svg{
  display: block;
  width: 100%;
  height: auto;
}
.product-tip{
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  padding: 5px 9px;
  border: 2px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 3px #00000018;
  pointer-events: none;
  text-align: center;
}
.product-tip b{
  display: block;
  font: 900 12px/1.2 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
}
.product-tip small{
  font: 800 9px/1.2 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-mute);
}
.product-chart-empty{
  margin: 0;
  padding: 18px;
  color: var(--ink-mute);
  font: 800 12px "Nunito",sans-serif;
  text-align: center;
}

.product-values summary{
  color: var(--ink);
  font: 900 11px/1.4 "Nunito","Trebuchet MS",sans-serif;
  cursor: pointer;
}
.product-values table{
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font: 700 11px/1.4 "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
}
.product-values th{
  padding: 6px 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}
.product-values td{
  padding: 5px 8px;
  border-top: 1px solid var(--surface-2);
}
.product-trades ul{
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.product-trades li{
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font: 700 11px "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink-soft);
}
.product-trades h3{
  margin: 0;
  font: 900 10px/1.2 "Nunito","Trebuchet MS",sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.product-trades b{
  font: 900 12px "Nunito","Trebuchet MS",sans-serif;
  color: var(--ink);
}
.product-trades small{
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}
.product-chart .axis{
  fill: var(--ink);
  font: 800 9px/1 "Nunito","Trebuchet MS",sans-serif;
}
.product-chart .base{
  stroke: var(--ink-soft);
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}
.product-chart .area{
  fill: #4f8b4522;
  stroke: none;
}
.product-chart .line{
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.product-chart .dot{
  fill: var(--ink);
  stroke: var(--surface);
  stroke-width: 2;
}

dialog.product-info-dialog .origin-columns{
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
  gap: 10px;
  padding: 0 0 4px;
}
dialog.product-info-dialog .origin-columns h3{
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: 800 13px/1.2 var(--font-title);
  color: var(--ink);
}
dialog.product-info-dialog .origin-list{
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
dialog.product-info-dialog .origin-list li{
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}
.ui-game-content .origin-list li.is-byproduct,
dialog.product-info-dialog .origin-list li.is-byproduct{
  background: var(--surface-3);
  opacity: .82;
}
dialog.product-info-dialog .origin-list li>span{
  font-size: 14px;
  text-align: center;
}
.weather-alerts li>span,
.ui-game-content .origin-list li>div,
dialog.product-info-dialog .origin-list li>div{
  display: grid;
  gap: 1px;
  min-width: 0;
}
dialog.product-info-dialog .origin-list strong{
  font: 800 11px/1.25 var(--font-title);
  color: var(--ink);
}
dialog.product-info-dialog .origin-list small{
  font: 700 10px/1.35 var(--font-body);
  color: var(--ink-mute);
}
dialog.product-info-dialog .origin-list li>b{
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-3);
  font: 800 9px/1.4 var(--font-body);
  color: var(--accent-dark);
  white-space: nowrap;
}
.product-info-dialog .product-modal-icon{
    flex:0 0 38px;
    width:38px;
    height:38px;
    border-color:color-mix(in srgb,var(--market-accent) 45%,var(--border));
    background:color-mix(in srgb,var(--surface) 84%,var(--market-accent) 16%);
}
.product-info-dialog .market-analysis,.product-info-dialog .market-main,.product-info-dialog .market-order{
  display: grid;
  gap: 10px;
  min-width: 0;
}
.product-info-dialog .market-main{
  grid-template-rows: auto 1fr auto;
}
.product-info-dialog .market-analysis-list{
  display: grid;
  overflow: hidden;
}
.product-info-dialog .market-analysis-list>div{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.product-info-dialog .market-analysis-list strong{
  font: 900 11px/1.2 var(--font-body);
  font-variant-numeric: tabular-nums;
}
.product-info-dialog .market-meter>header{
  align-items: center;
  gap: 10px;
  min-height: 0;
  margin: 0;
  display: flex;
  justify-content: space-between;
  padding: 0;
  border: 0;
  background: none;
}
.product-info-dialog .market-meter>div{
  height: 7px;
  margin: 6px 0;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.product-info-dialog .market-meter>div>i{
  border-radius: 999px;
  display: block;
  height: 100%;
  background: var(--market-accent);
}
.product-info-dialog .market-meter small{
  margin-top: 2px;
  display: block;
  margin: 0;
  color: var(--ink-mute);
  font: 700 9px/1.25 var(--font-body);
}

.product-info-dialog .market-chart-head{
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.product-info-dialog .market-chart-head span{
  color: var(--ink-mute);
  font: 900 9px/1 var(--font-body);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.product-info-dialog .market-chart-head strong{
  font: 900 13px/1.2 var(--font-title);
}
.product-info-dialog .market-range-tabs{
  display: grid;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-3);
}
.product-info-dialog .market-range-tabs{
  grid-template-columns: repeat(3,auto);
}
.product-info-dialog .market-range-tabs button:is(:hover,.is-active),.product-info-dialog .ui-quick-amounts button:hover{
  background: var(--surface);
  color: var(--market-accent);
  box-shadow: var(--shadow);
}
.product-info-dialog .market-chart-host,.product-info-dialog .product-chart{
  min-height: 330px;
}
.product-info-dialog .product-chart{
  height: 100%;
  padding: 7px 6px 0;
}
.product-info-dialog .product-chart svg{
  width: 100%;
  height: 100%;
  min-height: 315px;
}
.product-info-dialog .product-chart .line{
  stroke: var(--market-accent);
  stroke-width: 3;
  fill: none;
}
.product-info-dialog .product-chart .area{
  fill: url(#marketArea);
}
.product-info-dialog .product-chart .dot{
  fill: var(--surface);
  stroke: var(--market-accent);
  stroke-width: 2.5;
}
.product-info-dialog .product-chart .base{
  stroke: var(--ink-mute);
  stroke-dasharray: 6 5;
}
.product-info-dialog .product-tip{
  min-width: 120px;
  padding: 8px 10px;
  border-color: color-mix(in srgb,var(--market-accent) 45%,var(--border));
}
.product-info-dialog .product-tip em{
  display: block;
  margin-top: 3px;
  font: 900 9px/1.2 var(--font-body);
  font-style: normal;
}
.product-info-dialog .market-order>header span,.product-info-dialog .market-order-field,.product-info-dialog .market-order-total>span{
  color: var(--ink-mute);
  font: 900 9px/1 var(--font-body);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.product-info-dialog .market-order>header strong{
  font: 900 14px/1.1 var(--font-title);
}
.product-info-dialog .market-order>header>b{
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--market-accent);
  font: 900 8px/1 var(--font-body);
}
.product-info-dialog .market-order-stock,.product-info-dialog .market-order-lines p{
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.product-info-dialog .market-order-lines p{
  margin: 0;
}
.product-info-dialog .market-price-hero>small,
.product-info-dialog .market-order-lines span{
  color: var(--ink-mute);
  font: 800 9px/1.2 var(--font-body);
}
.product-info-dialog .market-order-lines strong{
  font: 900 10px/1.2 var(--font-body);
}
.product-info-dialog .market-order-total>strong{
  display: block;
  margin: 3px 0;
  color: var(--market-accent);
  font: 900 21px/1.05 var(--font-title);
}
.product-info-dialog .market-order-total>small{
  color: var(--ink-mute);
  font: 700 9px/1.2 var(--font-body);
}
.product-info-dialog .market-chain-section,.product-info-dialog .market-secondary{
  margin-inline: 18px;
}
.product-info-dialog .market-chain-section>header span{
  display: block;
  margin: 0;
  line-height: 1;
  color: var(--market-accent);
  font: 900 9px/1 var(--font-body);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.product-info-dialog .market-chain-section>header strong{
  color: var(--ink);
  display: block;
  margin: 0;
  line-height: 1.2;
  font: 900 13px/1.2 var(--font-title);
}
.product-info-dialog .market-secondary{
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.product-info-dialog .market-data-details,.product-info-dialog .market-trades{
  overflow: hidden;
}
.product-info-dialog .market-data-details table{
  margin: 0;
}
.product-info-dialog .market-trades{
  padding: 11px;
}

.product-info-dialog .market-terminal__body{
  display: grid;
  gap: 14px;
  padding: 16px 18px 14px;
  align-items: stretch;
    grid-template-columns: 250px minmax(0,1fr) 286px;
}
.product-info-dialog .market-price-hero>span,.product-info-dialog .market-price-hero>strong,.product-info-dialog .market-price-hero>small,.product-info-dialog .market-price-hero>b{
    display: block;
    min-width: 0;
}
.product-info-dialog .market-price-hero>strong{
  margin-top: 4px;
  color: var(--market-accent);
  font: 900 28px/1 var(--font-title);
    white-space: nowrap;
}

/* Modale produit — ajustements ciblés sans toucher à la grille 3 colonnes */
.product-info-dialog .market-analysis{
    grid-template-rows: auto auto auto;
    align-content: start;
}
.product-info-dialog .market-order>header>strong{
    font: 900 14px/1.1 var(--font-title);
}
.product-info-dialog .market-chain-section .origin-column{
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
    padding: 12px 14px;
}
.product-info-dialog .market-chain-section .origin-list li{
  border-left: 0;
  box-shadow: none;
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
}
.product-info-dialog .market-data-details summary{
  padding: 10px 12px;
  cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    list-style: none;
}
.product-info-dialog .market-data-details summary::-webkit-details-marker{
    display: none;
}
.product-info-dialog .market-data-details[open] summary>span{
    transform: rotate(180deg);
}

/* Modale produit — finition phase 30 */
.product-info-dialog .market-price-hero{
  position: relative;
  min-height: 130px;
  padding: 15px;
  border-color: color-mix(in srgb,var(--market-accent) 45%,var(--border));
  background: color-mix(in srgb,var(--surface) 90%,var(--market-accent) 10%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  align-content: center;
    padding-top: 12px;
    padding-bottom: 12px;
}
.ui-data-title,
.product-info-dialog .market-price-hero>span{
    color: var(--ink);
    font: 800 13px/1.2 var(--font-body);
}
.product-info-dialog .market-price-hero>b{
  font: 900 10px/1.2 var(--font-body);
    margin-top: 1px;
}
.product-info-dialog .market-chain-section>header>strong{
    margin: 0;
    color: var(--ink);
    font: 900 13px/1.2 var(--font-title);
}
.product-info-dialog .market-chain-section .origin-columns{
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  margin: 0;
  padding: 0;
  gap: 0;
    position: relative;
}
.product-info-dialog .market-chain-section .origin-column+.origin-column{
  margin-left: 0;
  padding-left: 14px;
    border-left: 0;
}

/* Modale produit — finition phase 31 */

/* Un peu plus d'air avant la tendance mensuelle. */
.product-info-dialog .market-trend-label{
  color: var(--ink-mute);
  font: 800 9px/1.2 var(--font-body);
  letter-spacing: .05em;
  text-transform: uppercase;
    margin-top: 12px;
}

/* Le stepper réagit comme un seul composant au survol/focus. */

/* Axes du graphique plus lisibles. */
.product-info-dialog .product-chart .axis{
    font-size: 11px;
    font-weight: 900;
}

/* Chaîne économique : le bandeau touche réellement le cadre. */

/* Séparation entre le titre de colonne et son contenu. */

/* Modale produit — finition phase 32 */

/* Plus d'air avant la première carte de chaque colonne. */
.product-info-dialog .market-chain-section .origin-list{
    margin-top: 7px;
}

/* Le thème de la chaîne suit la couleur du produit. */
.product-info-dialog .market-chain-section{
  margin: 0 18px 14px;
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
    border-color: color-mix(in srgb,var(--market-accent) 42%,var(--border));
}
.product-info-dialog .market-chain-section>header{
  position: static;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 11px 13px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  border-radius: 0;
    background: color-mix(in srgb,var(--surface) 91%,var(--market-accent) 9%);
    border-bottom-color: color-mix(in srgb,var(--market-accent) 32%,var(--border));
}
.product-info-dialog .market-chain-section .origin-columns::before{
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 1px;
    background: color-mix(in srgb,var(--market-accent) 30%,var(--border));
}
.product-info-dialog .market-chain-section .origin-column h3{
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
    border-bottom-color: color-mix(in srgb,var(--market-accent) 28%,var(--border));
}

/* "Voir les X autres" devient une vraie action compacte. */
.product-info-dialog .origin-more{
    justify-self: start;
    width: auto;
    min-height: 30px;
    height: 30px;
    margin-top: 4px;
    padding-inline: 10px;
    text-decoration: none;
}

/* Disponible remonte immédiatement sous le header. */

/* Le panneau vente et son input suivent eux aussi la couleur du produit. */
.product-info-dialog .ui-number-stepper{
  border-color: color-mix(in srgb,var(--market-accent) 42%,var(--border-strong));
}
.product-info-dialog .ui-number-stepper:hover,.product-info-dialog .ui-number-stepper:focus-within{
    border-color: var(--market-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb,var(--market-accent) 18%,transparent);
}
.product-info-dialog .ui-number-stepper:hover button,.product-info-dialog .ui-number-stepper:focus-within button{
    background: color-mix(in srgb,var(--surface) 82%,var(--market-accent) 18%);
    color: var(--ink);
}
.product-info-dialog .ui-number-stepper input:focus{
    outline: 0;
}

/* Contrats + confirmation + retour haut — phase 42 */

/* Livrer / Rendre : vrai conteneur d'actions, avec le même espace partout. */

.ui-game .ui-modal--confirm .confirm-copy{
    margin: 0;
}

/* Bouton retour en haut : même esprit sombre que le chat, flèche blanche. */
.back-to-top{
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}
.back-to-top.is-visible{
  visibility: visible;
  transform: translateY(0);
    opacity: .9;
}
.back-to-top:hover,.back-to-top:focus-visible{
    background: #111a16;
    color: #fff;
    border-color: #111a16;
}

/* Entrepôt — aligné sur les autres pages */
.place-warehouse{
    align-content:start;
    justify-content:stretch;
    grid-auto-rows:max-content;
    grid-template-rows:none;
    row-gap:12px;
}
.place-warehouse>.warehouse-shell{
    width:100%;
    margin:0;
}
.place-warehouse .warehouse-shell>.ui-panel__body{
    display:block;
}

/* Même hauteur et même padding que les autres headers de page. */
.place-warehouse .warehouse-shell>header .ui-panel__tools{
    margin-left:auto;
}
.place-warehouse .warehouse-shell>header .warehouse-level{
    min-height:28px;
}

/* Recherche compacte, exactement dans le body comme les autres toolbars. */
.place-warehouse .warehouse-toolbar{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:9px;
    width:100%;
    margin:0 0 13px;
    padding:0 0 12px;
    border:0;
    border-bottom:1px solid var(--border);
    background:none;
}
.place-warehouse .warehouse-toolbar input[type=search]{
    width:280px;
    min-width:230px;
    height:34px;
    box-sizing:border-box;
    padding:0 11px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    color:var(--ink);
    font:700 12px/1 var(--font-body);
}
.place-warehouse .warehouse-stock-only,.ui-game .ui-check{
    display:inline-flex;
    align-items:center;
    gap:7px;
    margin:0;
    color:var(--ink);
    font:800 12px/1 var(--font-body);
}
.place-warehouse .warehouse-stock-only input,.ui-game .ui-check input{
    width:17px;
    height:17px;
    margin:0;
    accent-color:var(--accent);
}

.place-flows .flow-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px;padding-bottom:12px;border-bottom:1px solid var(--border)}
.place-flows .flow-tabs .ui-btn{gap:8px;min-width:150px}
.place-flows .flow-tabs .ui-btn.active,.place-flows .flow-tabs .ui-btn.active:hover{border-color:var(--accent-dark);background:var(--accent);color:#fff}
.place-flows .flow-tabs b{margin-left:auto;color:inherit;font-size:inherit}
.place-warehouse.place-flows .flow-data-card{grid-template-columns:52px minmax(160px,1.4fr) repeat(3,minmax(120px,1fr))}
.place-flows .flow-positive{color:var(--positive)}
.place-flows .flow-negative{color:var(--negative)}
.place-flows .flow-group .catalog-empty{padding:18px;text-align:center}
/* Mobile : les flux reprennent la carte de l'entrepôt (produit sur une ligne, trois chiffres dessous). */
@media (max-width:760px){
  .place-warehouse.place-flows .ui-data-list>.flow-data-card{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-areas:"name name name" "quantity price value"}
  .place-warehouse.place-flows .flow-data-card .resource-medal{grid-area:name;justify-self:start}
  .place-warehouse.place-flows .flow-data-card .ui-data-title{padding-left:54px}
}

.place-profile .profile-hero .profile-badges{flex-direction:column;align-items:center}

/* Groupe stock : header + lignes, sans carte autour de chaque ligne. */
.place-warehouse .warehouse-group{
    margin:0 0 14px;
    overflow:hidden;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:var(--surface);
}
.place-warehouse .warehouse-group>header{
    display:flex;
    align-items:center;
    gap:12px;
    min-height:52px;
    padding:8px 12px;
    box-sizing:border-box;
    border-bottom:1px solid var(--border);
    background:var(--surface-2);
}
.place-warehouse .warehouse-group>header>:first-child{
    margin-right:auto;
}
.place-warehouse .warehouse-group>header>b{
    padding:0;
    border:0;
    background:transparent;
    color:var(--ink);
    text-align:right;
    font-size:11px;
}
.place-warehouse .warehouse-group>header progress{
    width:170px;
    height:7px;
    accent-color:var(--positive);
}

/* STOCK = retour au rendu d'avant : lignes pleine largeur. */
.place-warehouse .ui-data-list{
    display:block;
    margin:0;
    padding:0;
    border:0;
    background:var(--surface);
}

.place-warehouse .ui-data-card:nth-child(even){
    background:var(--surface-2);
}
.place-warehouse .ui-data-card:last-child{
    border-bottom:0;
}
.place-warehouse .ui-data-card:hover{
    background:var(--accent-soft);
}

/* Icône comme avant : petite, accolée au nom. */
.place-warehouse .ui-data-card .resource-medal{
    width:34px;
    height:34px;
    min-width:34px;
    border-width:1px;
    border-radius:8px;
    font-size:15px;
}
.ui-game .product-info-dialog .product-modal-icon :is(.crop-sprite,.extraction-sprite,.workshop-sprite),
.place-warehouse .ui-data-card .resource-medal :is(.crop-sprite,.extraction-sprite,.workshop-sprite){
    width:80%;
    height:80%;
}
.place-warehouse .ui-data-title{
    font-size:13px;
}
.place-warehouse .ui-data-title>.ui-data-sub{margin-top:4px}

.place-warehouse .ui-data-card .ui-data-cell--quantity>strong{
    color:var(--positive);
}

/* Entrepôt — jauge de capacité restaurée comme avant */
.place-warehouse .store-gauge{
    display:grid;
    gap:4px;
    justify-items:end;
    margin-left:auto;
    min-width:170px;
}
.place-warehouse .store-gauge>b{
    margin:0;
    color:var(--ink);
    font:900 11px/1 var(--font-body);
    white-space:nowrap;
}
.place-warehouse .store-gauge>i{
    display:block;
    width:170px;
    height:9px;
    box-sizing:border-box;
    border:1px solid var(--border-strong);
    border-radius:999px;
    background:var(--surface-2);
    overflow:hidden;
}
.place-warehouse .store-gauge>em{
    margin:0;
    color:var(--ink-mute);
    font:800 10px/1 var(--font-body);
    font-style:normal;
    white-space:nowrap;
}
.place-warehouse .store-gauge.is-tight>i>span{
    background:linear-gradient(90deg,var(--warning),#dcab5c);
}
.place-warehouse .store-gauge.is-tight>em{
    color:var(--warning);
}
.place-warehouse .store-gauge.is-full>i>span{
    background:linear-gradient(90deg,var(--negative),#c9634b);
}
.place-warehouse .store-gauge.is-full>:is(b,em){
    color:var(--negative-dark);
}

/* Eau — actions prospection réellement présentes dans la vue */

/* UI canonique — résidus legacy migrés */
.ui-feedback{
    display:none;
    margin:10px 0 0;
    padding:9px 11px;
    border:2px solid var(--border);
    border-radius:9px;
    background:#f8d8c9;
    color:var(--ink);
    font-size:12px;
    font-weight:800;
}
.ui-feedback.visible{
    display:block;
}
.ui-empty p,
.ui-hint--compact{
    margin:0;
    color:var(--ink-soft);
    font-size:11px;
}
.ui-summary--total{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px;
    border-radius:10px;
    background:var(--surface-2);
}
.ui-summary--total span{
    font-size:11px;
    font-weight:900;
    text-transform:uppercase;
}
.offer-price strong,
.ui-summary--total strong{
    font-size:21px;
    color:var(--ink);
}

/* Accueil — aperçu objectifs */
.ui-game-content.ui-game-home .objective-card--preview>.ui-panel__header .ui-panel__tools{
    margin-left:auto;
}
.ui-game-content.ui-game-home .objective-card--preview>.ui-panel__body{
    padding:12px 14px 14px;
}
.ui-game-content.ui-game-home .objective-preview{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    margin:0;
    padding:0;
    list-style:none;
}
.ui-game-content.ui-game-home .objective-preview>li{
    display:grid;
    grid-template-columns:30px minmax(0,1fr) auto;
    align-items:center;
    gap:9px;
    min-height:58px;
    padding:9px 10px;
    box-sizing:border-box;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:var(--surface-2);
}
.ui-game-content.ui-game-home .objective-preview>li.is-ready{
    border-color:var(--positive-border);
    background:var(--positive-soft);
}
.ui-game-content.ui-game-home .objective-preview>li>span{
    display:grid;
    place-items:center;
    font-size:18px;
}
.ui-game-content.ui-game-home .objective-preview>li>div{
    display:grid;
    gap:5px;
    min-width:0;
}
.ui-game-content.ui-game-home .objective-preview strong{
    overflow:hidden;
    color:var(--ink);
    font:900 12px/1.2 var(--font-body);
    text-overflow:ellipsis;
    white-space:nowrap;
}
.ui-game-content.ui-game-home .objective-preview small,.ui-game-content.ui-game-home .objective-ready{
    color:var(--ink-mute);
    font:900 10px/1 var(--font-body);
    white-space:nowrap;
}
.ui-game-content.ui-game-home .objective-gauge{
    overflow:hidden;
    border:1px solid var(--border-strong);
    border-radius:999px;
    background:var(--surface);
}
.ui-game-content.ui-game-home .objective-gauge>i{
    display:block;
    height:100%;
    background:var(--positive);
}
@media(max-width:1180px){
    .ui-game-content.ui-game-home .objective-preview{
        grid-template-columns:1fr;
    }
}

/* Eau — composants propres */
/* Eau : les puits utilisent asset-card. */
/* Prospection */
.place-water .water-survey-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
}
.place-water .water-survey-card{
    display:grid;
    gap:10px;
    align-content:start;
    min-height:0;
    padding:12px;
    border:1px solid var(--border);
    border-radius:11px;
    background:var(--surface);
}
.place-water .water-survey-resource{
    display:flex;
    align-items:center;
    gap:10px;
    padding-bottom:10px;
    border-bottom:1px dashed var(--border);
}
.place-water .water-survey-icon{
    display:grid;
    place-items:center;
    width:44px;
    height:44px;
    flex:0 0 44px;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--surface-2);
    font-size:22px;
}
.place-water .water-survey-resource small{
    color:var(--ink-mute);
    font:900 9px/1.2 var(--font-body);
    letter-spacing:.06em;
}
.place-water .water-survey-resource h2{
    margin:3px 0 0;
    color:var(--ink);
    font:900 13px/1.2 var(--font-title);
}
.place-water .water-survey-metrics p{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin:0;
}
.product-info-dialog .market-analysis-list span,
.place-water .water-survey-metrics small{
    color:var(--ink-mute);
    font:800 9px/1.2 var(--font-body);
    text-transform:uppercase;
}
.place-water .water-survey-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    align-self:end;
    margin-top:auto;
}

.place-water .water-survey-grid>.ui-table-grid{
    grid-column:1/-1;
}

@media(max-width:1100px){
    .place-water .water-survey-grid{
        grid-template-columns:1fr;
    }
}

/* Accueil — le header Objectifs colle au cadre du panel */
.ui-game-content.ui-game-home .objective-card--preview{
  display:block;
  width:100%;
  margin:0;
    padding:0;
    overflow:hidden;
}
.ui-game-content.ui-game-home .objective-card--preview>.ui-panel__header{
  display:flex;
  align-items:center;
  min-height:58px;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
    margin:0;
    border-radius:0;
}
.ui-game .contract-ranks-list{
    display:grid;
    gap:7px;
    min-height:0;
    padding:12px 14px;
    overflow-y:auto;
    overflow-x:hidden;
}
.ui-game .contract-ranks-list article{
    display:grid;
    grid-template-columns:34px minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    min-height:58px;
    padding:9px 11px;
    box-sizing:border-box;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--surface-2);
    opacity:.5;
}
.ui-game .contract-ranks-list article.is-reached{
    opacity:1;
    background:var(--surface);
}
.ui-game .contract-ranks-list article>span{
    text-align:center;
    font-size:19px;
}
.ui-game .contract-ranks-list article>div{
    display:grid;
    gap:2px;
    min-width:0;
}
.ui-game .contract-ranks-list strong{
    color:var(--ink);
    font:900 13px/1.2 var(--font-body);
}
.ui-form-row>h2 small,
.ui-game-content .origin-list small,
.ui-game .contract-ranks-list small{
    color:var(--ink-mute);
    font:700 11px/1.35 var(--font-body);
}
.ui-game .contract-ranks-list b{
    color:var(--accent-dark);
    font:900 13px/1 var(--font-body);
    white-space:nowrap;
}
.ui-game .contract-ranks-note{
    margin:0 auto 0 0;
    color:var(--ink-soft);
    font:700 10px/1.4 var(--font-body);
}
body .ui-game .product-info-dialog .market-terminal__body{
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
    overflow:visible;
    min-height:0;
}
body .ui-game .product-info-dialog .market-chain-section,body .ui-game .product-info-dialog .market-secondary{
    margin-inline:18px;
}
body .ui-game .product-info-dialog .market-chain-section{
    margin-top:8px;
}
body .ui-game .product-info-dialog .market-secondary{
    margin-top:12px;
    margin-bottom:14px;
}

/* Vente immédiate : plus de ligne 1fr qui déplace "Vous recevez". */
.product-info-dialog .market-order{
  border-radius: var(--radius);
  overflow: hidden;
  border-color: color-mix(in srgb,var(--market-accent) 48%,var(--border));
    display:grid;
    grid-template-rows:none;
    grid-auto-rows:auto;
    align-content:start;
    gap:10px;
    padding:0 12px 12px;
}
.product-info-dialog .market-order>header{
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  min-height: 42px;
  background: color-mix(in srgb,var(--surface) 90%,var(--market-accent) 10%);
  border-bottom-color: color-mix(in srgb,var(--market-accent) 30%,var(--border));
    margin:0 -12px;
}
.product-info-dialog .market-order-stock{
  border-bottom: 1px dashed var(--border);
  margin-top: 0;
    margin:0;
    padding:10px 0 9px;
}
.product-info-dialog .market-order-field{
  display: grid;
  gap: 6px;
    margin:0;
}
.product-info-dialog .market-order-lines{
  display: grid;
  gap: 5px;
  border-block: 1px dashed var(--border);
    margin:2px 0 0;
    padding:10px 0;
}
.product-info-dialog .market-order-total{
  padding: 11px;
  border-color: color-mix(in srgb,var(--market-accent) 38%,var(--border));
  background: color-mix(in srgb,var(--surface) 92%,var(--market-accent) 8%);
    align-self:auto;
    margin:6px 0 0;
}
.product-info-dialog .market-sell-button{
    width:100%;
    height:38px;
    min-height:38px;
    margin:0;
}

/* Modales : cadre, en-tête et actions partagés par toutes les vues. */
body .ui-game .ui-modal{
    --ui-modal-width:520px;
    --modal-pad:18px;
    --modal-gap:14px;
    --modal-control-h:46px;
    position:fixed;
    inset:0;
    margin:auto;
    width:min(var(--ui-modal-width),calc(100vw - 28px));
    max-width:none;
    height:max-content;
    max-height:calc(100dvh - 28px);
    box-sizing:border-box;
    padding:0;
    border:1px solid var(--border-strong);
    border-radius:14px;
    background:var(--surface);
    color:var(--ink);
    box-shadow:0 22px 64px rgba(17,24,20,.38);
    overflow:hidden;
}
.ui-modal[open]{isolation:isolate;}
.ui-modal::backdrop{
    background:rgba(20,27,23,.72);
    backdrop-filter:blur(5px);
}
body .ui-game .ui-modal--sm{--ui-modal-width:420px;}
body .ui-game .ui-modal--md{--ui-modal-width:560px;}
body .ui-game .ui-modal--lg{--ui-modal-width:900px;}
body .ui-game .ui-modal--xl{--ui-modal-width:1460px;}
body .ui-game .ui-modal > :is(form,.ui-modal-shell){
    display:block;
    width:100%;
    max-height:calc(100dvh - 30px);
    margin:0;
    padding:0;
    background:var(--surface);
    overflow-y:auto;
    overflow-x:hidden;
}
body .ui-game .ui-modal .ui-modal-header{
    position:sticky;
    top:0;
    z-index:4;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    min-height:68px;
    box-sizing:border-box;
    margin:0;
    border:0;
    border-bottom:1px solid var(--border);
    border-radius:0;
    background:color-mix(in srgb,var(--surface) 95%,var(--market-accent,var(--accent)) 5%);
}
.ui-modal-header > div{min-width:0;}
body .ui-game .ui-modal .ui-modal-title{
    margin:0;
    color:var(--ink);
    font:900 18px/1.15 var(--font-title);
    overflow-wrap:anywhere;
}
body .ui-game .ui-modal .ui-modal-close{
    display:grid;
    place-items:center;
    flex:0 0 36px;
    width:36px;
    height:36px;
    min-height:36px;
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    color:var(--ink-mute);
    font:500 22px/1 var(--font-body);
    cursor:pointer;
}
body .ui-game .ui-modal .ui-modal-close:hover{color:var(--ink);}
body .ui-game .ui-modal .ui-modal-footer{
    position:sticky;
    bottom:0;
    z-index:4;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    min-height:58px;
    box-sizing:border-box;
    margin:14px 0 0;
    border:0;
    border-top:1px solid var(--border);
    background:var(--surface-2);
}
/* Le produit garde son centre en trois colonnes et son défilement interne. */
.product-info-dialog .market-terminal{
    display:grid;
    grid-template-rows:auto minmax(0,1fr) auto;
    width:100%;
    max-height:calc(100dvh - 30px);
    margin:0;
    padding:0;
    background:var(--surface);
    overflow:hidden;
}
.product-info-dialog .market-terminal__scroll{
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
}
body .ui-game .product-info-dialog .ui-modal-footer{margin:0;}

body .ui-game .ui-modal .ui-modal-section{
    margin:12px 14px 0;
}
body .ui-game .ui-modal .ui-modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    margin-top:10px;
}

/* Statuts réutilisables dans les modales */
body .ui-game .ui-modal .ui-status{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:12px 14px 0;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--surface-2);
}
body .ui-game .ui-modal .ui-status>span{
    color:var(--ink-mute);
    font:800 10px/1.2 var(--font-body);
}
body .ui-game .ui-modal .ui-status--welfare .welfare-fair{
    color:var(--warning);
}
body .ui-game .ui-modal .ui-status--welfare .welfare-poor{
    color:var(--negative);
}
body .ui-game .ui-modal .ui-status--feed .feed-ok{
    color:var(--positive);
}
body .ui-game .ui-modal .ui-status--feed .feed-low{
    color:var(--warning);
}
body .ui-game .ui-modal .ui-status--feed .feed-starving{
    color:var(--negative);
}

/* Elevage — contenu aéré et actions alignées */
body .ui-game .ui-modal--herd .herd-hint{
    margin:8px 14px 0;
    padding:9px 11px;
    border-left:3px solid var(--border-strong);
    border-radius:0 8px 8px 0;
    background:var(--surface-2);
    color:var(--ink-soft);
    font:700 11px/1.45 var(--font-body);
}
body .ui-game .ui-modal--herd .herd-hint.is-warning{
    border-left-color:var(--warning);
    background:var(--warning-soft);
}
body .ui-game .ui-modal--herd .herd-modal-form{
    margin-top:14px;
    padding:13px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--surface-2);
}
body .ui-game .ui-modal--herd .herd-modal-form .ui-field{
    display:grid;
    gap:6px;
    margin-top:0;
}
body .ui-game .ui-modal--herd .livestock-capacity{
    margin:8px 0 0;
    color:var(--ink-mute);
    font:700 11px/1.35 var(--font-body);
}
body .ui-game .ui-modal--herd .ui-summary--total{
    margin-top:10px;
}
body .ui-game .ui-modal--herd .ui-feedback{
    margin-top:8px;
}

/* Équipements — layout seulement, couleurs gérées par ui-btn */

/* UI — équipements de modale */
body .ui-game .ui-modal .ui-equipment-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    margin:12px var(--modal-pad);
}
body .ui-game .ui-modal .ui-equipment-item{
    display:grid;
    align-items:center;
    box-sizing:border-box;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--surface);
}
body .ui-game .ui-modal .ui-equipment-item>span:first-child{
    display:grid;
    place-items:center;
}
body .ui-game .ui-modal .ui-equipment-item>div{
    display:grid;
    gap:3px;
    min-width:0;
}
body .ui-game .ui-modal .ui-equipment-item small{
    color:var(--ink-soft);
    font:700 9px/1.3 var(--font-body);
}
body .ui-game .ui-modal .ui-equipment-item form{
    display:block;
    margin:0;
    padding:0;
}

/* Badges de statut utilisables dans toutes les modales. */
body .ui-game .ui-modal .ui-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:26px;
    padding:0 9px;
    border:1px solid var(--border);
    border-radius:999px;
    background:var(--surface-2);
    color:var(--ink-mute);
    font:900 9px/1 var(--font-body);
    white-space:nowrap;
}
body .ui-game .ui-modal .ui-badge--success{
    border-color:var(--positive-border);
    background:var(--positive-soft);
    color:var(--positive);
}
body .ui-game .ui-modal .ui-badge--muted{
    color:var(--ink-mute);
    background:var(--surface-2);
}

@media(max-width:760px){
    body .ui-game .ui-modal .ui-equipment-list{
        grid-template-columns:1fr;
    }
}

/* UI BUTTONS — composant canonique global */

/* UI BUTTONS — variantes globales */

/* Entrepôt : dimensions seulement ; le visuel vient de ui-btn. */

/* =========================================================
   UI BUTTONS — système unique
   ========================================================= */
.ui-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    min-height:34px;
    padding:0 14px;
    border:1px solid transparent;
    border-radius:8px;
    font:900 11px/1 var(--font-body);
    text-decoration:none;
    white-space:nowrap;
    cursor:pointer;
    appearance:none;
}
.ui-btn--primary{
    border-color:var(--accent-dark);
    background:var(--accent);
    color:#fff;
}
.ui-btn--secondary{
    border-color:var(--accent-dark);
    background:var(--surface);
    color:var(--ink);
}
.ui-btn--danger{
    border-color:var(--negative-dark);
    background:var(--negative);
    color:#fff;
}
.ui-btn--sm{
    min-height:29px;
    padding:0 10px;
    border-radius:7px;
    font-size:9px;
}
.ui-btn--lg{
    min-width:96px;
    min-height:40px;
    padding:0 18px;
}
.ui-btn--block{
    width:100%;
}

/* Les zones d'actions gèrent uniquement la largeur. */
.asset-card__actions>.ui-btn,.asset-card__actions>form>.ui-btn{
    width:100%;
}
.place-water .water-survey-actions form,
.water-survey-actions>form{
    display:flex;
    width:100%;
    min-width:0;
    margin:0;
}
.water-survey-actions>.ui-btn,.water-survey-actions>form>.ui-btn{
    width:100%;
}

/* Entrepôt — la ligne dimensionne l'action, le bouton reste 100 % ui-btn */
.place-warehouse .ui-data-card>.ui-btn{
    align-self:center;
}
.place-warehouse .ui-data-card>form{
    width:100%;
    min-width:0;
    margin:0;
}

/* Entrepôt — ligne stock propre : icône | nom | quantité | cours | valeur | action */
.place-warehouse .ui-data-card{
    display:grid;
    grid-template-columns:44px minmax(220px,1fr) minmax(150px,.72fr) minmax(150px,.72fr) minmax(170px,.82fr) 122px;
    align-items:center;
    gap:0;
    min-height:58px;
    padding:7px 12px;
    box-sizing:border-box;
    border:0;
    border-bottom:1px solid var(--border);
    border-radius:0;
    background:var(--surface);
    box-shadow:none;
    transform:none;
}
.place-warehouse .ui-data-card[hidden]{
    display:none;
}
.place-warehouse .ui-data-card>.ui-btn,.place-warehouse .ui-data-card>form>.ui-btn{
    width:100%;
}

/* Parcelle — même logique visuelle que Cheptel */
.ui-modal .ui-status--water{
    border-color:var(--water-border);
    background:var(--water-soft);
}
body .ui-game .ui-modal .ui-status--welfare,
body .ui-game .ui-modal .ui-equipment-item.is-installed,
.ui-modal .ui-status--fertility{
    border-color:var(--positive-border);
    background:var(--positive-soft);
}
.ui-modal .ui-modal-action-card{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:12px;
    padding:11px 12px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--surface-2);
}
.ui-modal .ui-modal-action-card>div{
    display:grid;
    gap:3px;
    min-width:0;
}
.ui-modal .ui-modal-action-card small{
    color:var(--ink-soft);
    font:700 9px/1.35 var(--font-body);
}
.ui-modal .ui-modal-action-card>.ui-btn{
    min-width:112px;
}

/* =========================================================
   ADMIN — layout uniquement, composants UI réutilisés
   ========================================================= */

.place-admin .ui-tabs{
    margin:0 0 13px;
}
.history-pagination>:last-child,
.place-admin .ui-form-row>.ui-btn{
    grid-column:3;
    justify-self:end;
}
.place-admin .ui-inline-form .ui-btn{
    flex:0 0 auto;
    min-width:34px;
    padding-inline:10px;
}

.place-admin .ui-toolbar>select{
    padding:0 11px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--surface);
    color:var(--ink);
    font:700 12px/1 var(--font-body);
}
@media(max-width:760px){
    .place-admin .ui-form-row{
        grid-template-columns:1fr;
    }
    .place-admin .ui-form-row>h2,.place-admin .ui-form-row .ui-form-fields,.place-admin .ui-form-row>.ui-btn{
        grid-column:1;
    }
    .place-admin .ui-form-row>.ui-btn{
        justify-self:stretch;
    }
}

/* Marché — données détaillées */
.product-info-dialog .market-data-details{
    overflow:hidden;
}
.product-info-dialog .market-data-details>summary{
    display:flex;
    align-items:center;
    gap:8px;
    min-height:38px;
    padding:0 12px;
    cursor:pointer;
    list-style:none;
    border-bottom:0;
    background:var(--surface);
    color:var(--ink);
    font:900 11px/1 var(--font-body);
}
.product-info-dialog .market-data-details>summary::-webkit-details-marker{
    display:none;
}
.product-info-dialog .market-data-details summary>span,
.product-info-dialog .market-data-details>summary>span{
    display:inline-block;
    transition:transform .16s ease;
}
.product-info-dialog .market-data-details[open]>summary{
    border-bottom:1px solid var(--border);
    background:var(--surface-2);
}
.product-info-dialog .market-data-details[open]>summary>span{
    transform:rotate(180deg);
}
.product-info-dialog .market-data-table-wrap{
    overflow:auto;
}
.product-info-dialog .market-data-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    background:var(--surface);
}
.product-info-dialog .market-data-table th{
    padding:9px 12px;
    border-bottom:1px solid var(--border);
    background:var(--surface-3);
    color:var(--ink-mute);
    font:900 9px/1.2 var(--font-body);
    letter-spacing:.06em;
    text-transform:uppercase;
    text-align:left;
}
.product-info-dialog .market-data-table td{
    padding:9px 12px;
    border-bottom:1px solid var(--border);
    color:var(--ink);
    font:800 10px/1.25 var(--font-body);
}
.product-info-dialog .market-data-table tbody tr:nth-child(even){
    background:var(--surface-2);
}
.product-info-dialog .market-data-table tbody tr:hover{
    background:var(--accent-soft);
}
.product-info-dialog .market-data-table tbody tr:last-child td{
    border-bottom:0;
}
.product-info-dialog .market-data-table td:nth-child(2),.product-info-dialog .market-data-table td:nth-child(3){
    font-variant-numeric:tabular-nums;
}
.ui-modal--recap .ui-modal-body{
    overflow:auto;
    padding:16px;
}
.ui-modal--recap .recap-lead{
    margin:0;
    color:var(--ink);
    font:700 13px/1.45 var(--font-body);
}
.ui-modal--recap .recap-metrics{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
}
.ui-modal--recap .recap-metrics article{
    display:grid;
    gap:5px;
    min-width:0;
    padding:11px 12px;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--surface-2);
}
.ui-modal--recap .recap-metrics span{
    color:var(--ink-mute);
    font:900 9px/1.2 var(--font-body);
    letter-spacing:.06em;
    text-transform:uppercase;
}
.ui-modal--recap .recap-metrics strong{
    color:var(--ink);
    font:900 15px/1.1 var(--font-body);
    font-variant-numeric:tabular-nums;
}
.ui-modal--recap .recap-section h3{
    margin:0;
    padding:9px 12px;
    border-bottom:1px solid var(--border);
    background:var(--surface-2);
    color:var(--ink);
    font:900 11px/1.2 var(--font-body);
}
.ui-modal--recap .recap-list{
    display:grid;
    margin:0;
    padding:0;
    list-style:none;
}
.ui-modal--recap .recap-list li{
    display:grid;
    grid-template-columns:28px minmax(0,1fr) auto;
    align-items:center;
    gap:8px;
    min-height:38px;
    padding:7px 12px;
    border-bottom:1px solid var(--border);
}
.ui-modal--recap .recap-list li:last-child{
    border-bottom:0;
}
.ui-modal--recap .recap-icon{
    display:grid;
    place-items:center;
    width:28px;
    height:28px;
    border-radius:7px;
    background:var(--surface-2);
    font-size:16px;
}
.product-info-dialog .market-meter>header strong,
.place-water .water-survey-metrics strong,
body .ui-game .ui-modal .ui-equipment-item strong,
.ui-modal .ui-modal-action-card strong,
.ui-modal--recap .recap-list strong{
    color:var(--ink);
    font:900 11px/1.2 var(--font-body);
}
.ui-modal--recap .recap-list b{
    color:var(--ink);
    font:900 11px/1 var(--font-body);
    font-variant-numeric:tabular-nums;
}
.ui-modal--recap .recap-section--warning{
    border-color:var(--negative-border);
}
@media(max-width:680px){
    .ui-modal--recap .recap-metrics{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

/* Admin — métriques compactes : 6 colonnes sur desktop. */
.place-admin .ui-metrics,.place-admin .admin-world-panel>.ui-panel__body>.ui-metrics{
    grid-template-columns:repeat(6,minmax(0,1fr));
}

.place-admin .admin-world-panel .weather-impact strong{
    font-size:11px;
}
.place-admin .admin-world-panel .weather-impact small,.place-admin .admin-world-panel .weather-impact li{
    font-size:9px;
}

/* Les deux bandes météo utilisent exactement le même cadre. */
.place-admin .admin-world-panel .weather-day,.place-admin .admin-world-panel .weather-forecast{
    width:100%;
    margin-top:9px;
    padding:9px 10px;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--surface-2);
    box-sizing:border-box;
}
.place-admin .admin-world-panel .weather-day>strong,.place-admin .admin-world-panel .weather-forecast>strong{
    font-size:10px;
}
.place-admin .admin-world-panel :is(.weather-day,.weather-forecast) small{
    font-size:8px;
}
.place-admin .admin-world-panel :is(.weather-day,.weather-forecast) b{
    font-size:9px;
}

@media(max-width:1200px){
    .place-admin .ui-metrics,.place-admin .admin-world-panel>.ui-panel__body>.ui-metrics{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
}
@media(max-width:700px){
    .place-admin .ui-metrics,.place-research .ui-metrics,.place-admin .admin-world-panel>.ui-panel__body>.ui-metrics{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .place-research .ui-metrics{
        grid-auto-flow:row;
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .place-admin .admin-world-panel .weather-day>div,.place-admin .admin-world-panel .weather-forecast>div{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}
/* États vides — même gabarit sur champs, élevages, puits et autres actifs. */
.ui-game-content .asset-grid>.ui-empty{
    width:100%;
    min-height:138px;
    margin:0;
    padding:24px;
    box-sizing:border-box;
}

/* =========================================================
   PHASE 91 — corrections ciblées
   ========================================================= */
.ui-game-content.ui-game-home .world-grid.weather-essentials{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
}
.ui-game-content.ui-game-home .world-grid.weather-essentials>article{
    min-width:0;
    width:auto;
}
@media(max-width:640px){
    .ui-game-content.ui-game-home .world-grid.weather-essentials{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}
.ui-game-content.place-admin .ui-panel__body>.admin-nav,.ui-game-content.place-admin>.ui-panel .admin-nav{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:9px;
    width:100%;
    margin:0 0 14px;
    padding:0 0 15px;
    box-sizing:border-box;
    border:0;
    border-bottom:2px dashed var(--border-strong);
    border-radius:0;
    background:transparent;
    box-shadow:none;
}

/* Admin — champs de filtre compacts, même gabarit partout. */
.place-admin .ui-toolbar>input[type="search"],.place-admin .ui-toolbar>select{
    flex:0 1 280px;
    width:280px;
    min-width:220px;
    max-width:100%;
    height:34px;
    margin:0;
}
.place-admin .ui-toolbar>.ui-btn{
    flex:0 0 auto;
}

/* Cartes d'actifs — 3 colonnes, puis 2, puis 1 quand l'espace manque. */
@media(max-width:1340px){
    .asset-grid:not(.asset-grid--wide){
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}
@media(max-width:760px){
    .asset-grid,.asset-grid:not(.asset-grid--wide),.asset-grid--wide{
        grid-template-columns:1fr;
    }
}

/* Usines : grille d'exploitations. */

/* =========================================================
   PHASE 95 — header responsive + modale produit
   ========================================================= */

/* Quand le layout se compacte, les trois ressources du HUD
   passent sur une seconde ligne au lieu d'être écrasées. */

/* Modale produit :
   le graphique prend toute la largeur utile quand 3 colonnes
   deviendraient trop étroites. */
@media(max-width:1320px){
    .product-info-dialog .market-terminal__body{
        grid-template-columns:minmax(0,1fr) minmax(0,1fr);
        grid-template-areas:
            "main main"
            "analysis order";
        align-items:start;
    }

    .product-info-dialog .market-main{
        grid-area:main;
        min-width:0;
    }

    .product-info-dialog .market-analysis{
        grid-area:analysis;
        min-width:0;
    }

    .product-info-dialog .market-order{
        grid-area:order;
        min-width:0;
    }

    .product-info-dialog .market-chart-host,.product-info-dialog .product-chart{
        width:100%;
        min-width:0;
    }

    .product-info-dialog .product-chart svg{
        width:100%;
        min-width:0;
        min-height:340px;
    }
}

@media(max-width:860px){
    .product-info-dialog .market-terminal__body{
        grid-template-columns:1fr;
        grid-template-areas:
            "main"
            "analysis"
            "order";
    }

}

/* =========================================================
   NAVIGATION RESPONSIVE — bloc canonique
   ========================================================= */

.ui-game-menu{
    display:none;
}

@media(max-width:1350px){
    .ui-game .ui-game-hud{
        height:auto;
        min-height:76px;
        flex-wrap:wrap;
        align-items:center;
        row-gap:8px;
        overflow:visible;
        padding-block:8px 10px;
    }

    .ui-game .ui-game-logo,.ui-game .player-rank{
        flex:0 0 auto;
    }

    .ui-game .ui-game-inventory{
        display:none;
    }

    .ui-game .ui-game-stage{
        grid-template-columns:minmax(0,1fr);
    }

    .ui-game .ui-game-hud{
        width:100%;
        max-width:100%;
        margin-right:0;
    }

}

@media(max-width:760px){

    .ui-game .player-rank i{
        background:var(--shell-raised);
    }

    .ui-game-menu>strong{
        flex:1 1 auto;
        margin:0;
        text-align:left;
    }

    .ui-game-menu>i{
        font-style:normal;
        transition:transform .16s ease;
    }

    .ui-game-menu.is-open>i{
        transform:rotate(180deg);
    }

    .asset-card__visual,.asset-card__equipment,.asset-card__equipment-item,.place-water .water-survey-icon{
        display:none;
    }

}

/* =========================================================
   PHASE 101 — navigation stable + entrepôt mobile
   ========================================================= */

/* Admin et déconnexion suivent désormais exactement le même gabarit
   que les autres entrées de navigation. Aucun changement de taille au clic. */

/* Entrepôt : desktop reste en tableau dense, mobile devient une série de cartes. */
@media(max-width:760px){

    .place-warehouse .ui-data-card,.place-warehouse .ui-data-card:nth-child(even){
        display:grid;
        /* Produit + bouton sur une ligne, quantité / cours / valeur côte à côte dessous. */
        grid-template-columns:44px repeat(3,minmax(0,1fr));
        grid-template-areas:
            "icon name name action"
            "quantity quantity price value";
        gap:8px 0;
        min-height:0;
        padding:10px;
    }

    /* La mise en carte ci-dessus repasse en display:grid apres la regle
       [hidden] du mode large : on la neutralise ici, sinon le filtre
       « Uniquement mes stocks » n'a plus aucun effet en mobile. */
    .place-warehouse .ui-data-card[hidden],
    .place-warehouse .ui-data-card[hidden]:nth-child(even){
        display:none;
    }

    .place-warehouse .ui-data-card .resource-medal{
        grid-area:icon;
        align-self:center;
    }

    .place-warehouse .ui-data-title{
        grid-area:name;
        align-self:center;
        min-width:0;
    }

    .place-warehouse .ui-data-card .ui-data-cell--quantity{
        grid-area:quantity;
    }

    .place-warehouse .ui-data-card .ui-data-cell--price{
        grid-area:price;
    }

    .place-warehouse .ui-data-card .ui-data-cell--value{
        grid-area:value;
    }

    .place-warehouse .ui-data-card :is(.ui-data-cell--quantity,.ui-data-cell--price,.ui-data-cell--value){
        display:grid;
        gap:2px;
        min-height:0;
        padding:7px 0 0 10px;
        border-left:1px solid var(--border);
        border-top:1px solid var(--border);
    }
    /* Séparations comme au marché : filet vertical entre les chiffres, pas avant le premier. */
    .place-warehouse .ui-data-card .ui-data-cell--quantity{padding-left:0;border-left:0}

    .place-warehouse .ui-data-card :is(.ui-data-cell--quantity,.ui-data-cell--price,.ui-data-cell--value)>strong{
        min-width:0;
        white-space:nowrap;
    }

    .place-warehouse .ui-data-card>form,.place-warehouse .ui-data-card>.ui-btn{
        grid-area:action;
        align-self:center;
    }
}

/* =========================================================
   PHASE 104 — alerte impayés uniquement
   Le menu desktop reste strictement celui de la phase 101.
   ========================================================= */

.ui-game-content .upkeep-notice.is-severe{
  border-left-color: var(--negative);
    border-color:var(--negative);
    border-left:4px solid var(--negative);
    background:var(--negative-soft);
}

.ui-game-content .upkeep-notice.is-severe>header strong{
    color:var(--negative-dark);
}

.ui-game-content .upkeep-notice form button,.ui-game-content .upkeep-notice form .ui-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:34px;
    padding:0 13px;
    border:1px solid var(--negative-dark);
    border-radius:8px;
    background:var(--negative);
    color:#fff;
    box-shadow:none;
    font:900 11px/1 var(--font-body);
    text-decoration:none;
    cursor:pointer;
}

.ui-game-content .upkeep-notice form button:hover,.ui-game-content .upkeep-notice form .ui-btn:hover{
    background:var(--negative-dark);
    color:#fff;
    transform:none;
}

@media(max-width:760px){

    .ui-game-content .upkeep-notice form,.ui-game-content .upkeep-notice form button,.ui-game-content .upkeep-notice form .ui-btn{
        width:100%;
    }
}

/* =========================================================
   PHASE 105 — stabilité des entrées du menu mobile
   ========================================================= */

/* =========================================================
   PHASE 106 — admin : suppression du hover blanc
   ========================================================= */

/* =========================================================
   PHASE 107 — entrepôt mobile compact sans cartes séparées
   ========================================================= */
@media(max-width:760px){
    /* Le groupe devient un seul bloc continu :
       header collé aux lignes, sans arrondi en bas. */
    .place-warehouse .warehouse-group{
        margin:0;
        overflow:hidden;
        border:1px solid var(--border);
        border-radius:var(--radius) var(--radius) 0 0;
        background:var(--surface);
    }

    .place-warehouse .ui-data-list{
  grid-template-columns:1fr;
        display:block;
        margin:0;
        padding:0;
        gap:0;
        background:var(--surface);
    }

    /* Les produits ne sont plus des cartes individuelles :
       pas de bordure, pas d'arrondi, pas d'espace entre eux. */
    .place-warehouse .ui-data-card,.place-warehouse .ui-data-card:nth-child(even){
        margin:0;
        border:0;
        border-bottom:1px solid var(--border);
        border-radius:0;
        box-shadow:none;
        background:var(--surface);
    }

    .place-warehouse .ui-data-card:last-child{
        border-bottom:0;
    }

    .place-warehouse .ui-data-card:hover{
        background:var(--surface);
    }
}

/* =========================================================
   PHASE 108 — correction des cartes gameplay mobile
   ========================================================= */
@media(max-width:760px){
    /* Les changements "entrepôt compact" restent limités à .place-warehouse.
       Les cartes de gameplay gardent leur propre apparence. */
    .asset-card,.asset-card--equipped{
        display:grid;
        grid-template-columns:minmax(0,1fr);
        grid-template-rows:auto auto;
        min-height:0;
        overflow:hidden;
        border:1px solid var(--border);
        border-radius:var(--radius);
        background:var(--surface);
        box-shadow:var(--shadow);
    }

    .asset-card__body{
        grid-column:1;
        grid-row:1;
        min-width:0;
        padding:10px;
    }

    .asset-card__actions{
        grid-column:1;
        grid-row:2;
        display:grid;
        grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
        gap:7px;
        padding:8px 10px 10px;
        border-left:0;
        border-top:1px solid var(--border);
        background:var(--surface-2);
    }

    .asset-card__selection{
        position:absolute;
        top:7px;
        right:9px;
        z-index:2;
        grid-column:auto;
        grid-row:auto;
    }

    /* Puits : même logique, contenu puis actions en dessous.
       L'icône reste masquée comme demandé. */

    /* Prospections : pas de modification de carte, seulement l'icône déjà masquée. */
    .place-water .water-survey-resource{
        grid-template-columns:minmax(0,1fr);
    }
}

/* =========================================================
   PHASE 109 — champs + entrepôt mobile compact
   ========================================================= */
@media(max-width:760px){
    /* Champs : la checkbox ne chevauche plus le badge hectares. */
    .place-farmyard .asset-card__selection{
        top:10px;
        right:62px;
        width:18px;
        height:18px;
        padding:0;
    }

    .place-farmyard .asset-card__selection input{
        width:18px;
        height:18px;
        margin:0;
    }

    /* Entrepôt : titre et bouton d'agrandissement sur la même ligne.
       Le badge de niveau est retiré côté JS. */
    .place-warehouse .warehouse-shell>header{
        display:flex;
        align-items:center;
        justify-content:space-between;
        flex-wrap:nowrap;
        gap:10px;
    }

    .place-warehouse .warehouse-shell>header>h1{
        flex:1 1 auto;
        min-width:0;
        margin:0;
    }

    .place-warehouse .warehouse-shell>header .ui-panel__tools{
        flex:0 0 auto;
        width:auto;
        margin-left:auto;
        display:flex;
        flex-wrap:nowrap;
        gap:0;
    }

    .place-warehouse .warehouse-shell>header .warehouse-level{
        display:none;
    }

    .place-warehouse .warehouse-shell>header .ui-btn{
        white-space:nowrap;
    }

    /* Catégories : titre + capacité compacte + petite jauge sur une ligne. */
    .place-warehouse .warehouse-group>header{
  flex-wrap:wrap;
  margin-bottom:7px;
  margin:0;
  border:0;
  border-bottom:1px solid var(--border);
  border-radius:var(--radius) var(--radius) 0 0;
        display:grid;
        grid-template-columns:minmax(0,1fr) 130px;
        grid-template-rows:auto auto;
        align-items:center;
        gap:2px 10px;
        min-height:48px;
        padding:8px 12px;
    }

    .place-warehouse .warehouse-group>header>:first-child{
        grid-column:1;
        grid-row:1;
        margin:0;
        min-width:0;
    }

    .place-warehouse .store-gauge{
        grid-column:2;
        grid-row:1 / span 2;
        display:grid;
        grid-template-columns:minmax(0,1fr);
        align-items:center;
        justify-items:end;
        gap:3px;
        width:auto;
        min-width:0;
        margin-left:auto;
    }

    .place-warehouse .store-gauge>b{
        grid-column:1;
        grid-row:1;
        font-size:10px;
    }

    .place-warehouse .store-gauge>i{
        grid-column:1;
        grid-row:2;
        width:100%;
        height:7px;
    }

    .place-warehouse .store-gauge>em{
        grid-column:1;
        grid-row:3;
        justify-self:end;
        font-size:9px;
    }
}

/* =========================================================
   PHASE 110 — eau mobile : compteurs retirés
   ========================================================= */
@media(max-width:760px){
    .place-water .water-well-count,.place-water .water-survey-count{
        display:none;
    }
}

/* =========================================================
   CONSORTIUM — reprend ui-panel / published-list / contract-history-list.
   Ne contient que ce qui n'existe pas déjà dans le design system.
   ========================================================= */
.ui-game-content.place-consortium{display:grid;align-content:start;gap:0;padding-top:24px;min-width:0;}

.place-consortium .coop-tab-panel{display:grid;gap:0;min-width:0;}
.place-consortium .coop-tab-panel[hidden]{display:none;}

.place-consortium .coop-actions{display:flex;gap:6px;justify-content:flex-end;}

.place-consortium .coop-settings-form{display:grid;gap:10px;padding:12px 16px;}
.place-consortium .coop-manage-actions{display:flex;justify-content:flex-end;align-items:center;gap:12px;padding-top:0;border-top:0;}
.place-consortium .coop-emblem-picker{margin:0;padding:0;border:0;}
.place-consortium .coop-emblem-picker legend{margin-bottom:6px;font:900 10px/1 var(--font-body);text-transform:uppercase;letter-spacing:.05em;}
.leaderboard-tabs,
.place-consortium .coop-emblem-picker>div{display:flex;flex-wrap:wrap;gap:6px;}
.place-consortium .coop-emblem-picker label{position:relative;display:inline-block;}
.place-consortium .coop-emblem-picker input{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;margin:0;cursor:pointer;}
.place-consortium .coop-emblem-picker span{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--border);border-radius:8px;background:var(--surface);font-size:19px;cursor:pointer;}
.place-consortium .coop-emblem-picker input:checked+span{border-color:var(--accent-dark);background:var(--accent-soft);box-shadow:inset 0 0 0 2px var(--accent);}

.coop-list-title{margin:0 0 6px;padding:0;color:var(--ink-soft);font:900 10px/1 var(--font-body);text-transform:uppercase;letter-spacing:.07em;display:flex;align-items:center;gap:8px;}
.coop-list-title .ui-badge{margin-left:auto;}
.coop-list-title em{margin-left:auto;font-style:normal;color:var(--ink-mute);font-weight:700;}
.coop-list-title:first-child{margin-top:0;}

.ui-data-list--table{overflow:hidden;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);}
.ui-data-list--table>.ui-data-card{grid-template-columns:44px minmax(210px,1fr) minmax(120px,.62fr) minmax(120px,.62fr) minmax(135px,.68fr) minmax(105px,.55fr) minmax(136px,.55fr);gap:0;min-height:62px;padding:8px 12px;border:0;border-bottom:1px solid var(--border);background:var(--surface);}
.ui-data-list--table>.ui-data-card:nth-child(even){background:var(--surface-2);}
.ui-data-list--table>.ui-data-card:last-child{border-bottom:0;}
.ui-data-list--table>.ui-data-card:hover{background:var(--accent-soft);}
.place-contracts .ui-data-list--table>.ui-data-card.is-exceptional,
.place-consortium .ui-data-list--table>.ui-data-card.is-mystery{
  background:var(--warning-soft);
  box-shadow:inset 4px 0 var(--warning);
}
.place-contracts .ui-data-list--table>.ui-data-card.is-exceptional:hover,
.place-consortium .ui-data-list--table>.ui-data-card.is-mystery:hover{
  background:var(--warning-soft);
}
.ui-data-list--table>.ui-data-card>*{min-width:0;}
.ui-data-list--table>.ui-data-card .resource-medal{display:grid;place-items:center;width:34px;height:34px;margin-right:0;border:1px solid var(--border);border-radius:8px;background:var(--surface);font-size:18px;}
.ui-data-list--table>.ui-data-card .ui-data-title{padding:0 14px 0 10px;line-height:1.2;display:grid;gap:2px;}
.ui-data-list--table>.ui-data-card .ui-data-cell--price>.is-ready{color:var(--positive);}
.ui-data-list--table>.ui-data-card :is(.ui-data-cell--quantity,.ui-data-cell--price,.ui-data-cell--deadline,.ui-data-cell--gain){padding:3px 12px;min-height:44px;}
.ui-data-list--table>.ui-data-card :is(.ui-data-cell--quantity,.ui-data-cell--price,.ui-data-cell--deadline,.ui-data-cell--gain)>strong{overflow:hidden;text-overflow:ellipsis;}
.ui-data-list--table>.ui-data-card>form,.ui-data-list--table>.ui-data-card>.contract-actions,.ui-data-list--table>.ui-data-card>.ui-btn{margin-left:10px;}
.ui-data-list--table>.ui-data-card>form{width:auto;min-width:0;}
.ui-data-list--table>.ui-data-card>form>.ui-btn,.ui-data-list--table>.ui-data-card .contract-actions .ui-btn{width:100%;min-height:34px;padding-inline:10px;}
.ui-data-list--table .contract-origins{display:flex;flex-wrap:wrap;gap:4px;}
.ui-data-list--table .contract-lock{margin-left:12px;}

/* Consortium — onglets, tenders 6 colonnes, améliorations à paliers, identité en 2 colonnes. */
.place-consortium .coop-summary .ui-panel__body{padding:12px 16px;display:block;}
:is(.place-consortium,.place-research,.place-market-product) .coop-tabs{margin:0;gap:6px;flex-wrap:wrap;}
:is(.place-consortium,.place-research,.place-market-product) .coop-tabs .ui-btn.active,:is(.place-consortium,.place-research,.place-market-product) .coop-tabs .ui-btn.active:hover{background:var(--accent);color:#fff;border-color:var(--accent-dark);}
/* Consortium etroit : les 5 onglets deviennent un menu deroulant. */
:is(.place-consortium,.place-research,.place-market) .coop-tabs-select{display:none;}
@media(max-width:900px){
  :is(.place-consortium,.place-research,.place-market) .coop-tabs{display:block;}
  :is(.place-consortium,.place-research) .coop-tabs .ui-btn,
  .place-market .coop-tabs [data-market-filter]{display:none;}
  :is(.place-consortium,.place-research,.place-market) .coop-tabs-select{display:block;width:100%;min-height:0;padding:9px 30px 9px 12px;font:800 13px/1.2 var(--font-body);}
}

.contract-actions{display:grid;grid-template-columns:minmax(58px,1fr) minmax(58px,1fr);gap:5px;margin-left:12px;}
.contract-actions form{margin:0;}
.contract-actions .ui-btn{height:auto;padding:7px 8px;white-space:normal;}
.contract-actions small{grid-column:1 / -1;color:var(--ink-mute);font:700 10px/1.3 var(--font-body);}
@media(max-width:1100px){
  .place-forum .ui-data-card{grid-template-columns:34px minmax(0,1fr) minmax(110px,.6fr);gap:8px;}
  .place-forum .ui-data-card .ui-data-title{grid-column:2 / -1;}
  .place-forum .ui-data-card :is(.ui-data-cell--quantity,.ui-data-cell--price,.ui-data-cell--deadline,.ui-data-cell--gain){grid-column:auto;min-width:0;}
  .place-forum .ui-data-card > :is(form,.contract-actions,.contract-lock,.ui-btn,.ui-panel__tools){grid-column:2 / -1;margin:0;width:auto;}
  .place-forum .ui-data-card .ui-data-cell--quantity{grid-column:1 / 3;}
  .place-forum .ui-data-card .ui-data-cell--deadline{grid-column:1 / 3;}
}

/* Améliorations — cartes avec paliers de progression 5 pastilles */
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px 16px;}
.place-forum .coop-upgrade-grid{grid-template-columns:minmax(0,1fr);padding:0;}
@media(max-width:900px){:is(.place-consortium,.place-forum,.place-research) .coop-upgrade-grid{grid-template-columns:1fr;}}
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade{display:grid;grid-template-rows:auto auto auto auto;gap:10px;padding:12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2);}
/* Carte R&D : trois blocs, la description absorbe la hauteur pour que les pieds d'une meme ligne restent alignes. */
.place-research .coop-upgrade{grid-template-rows:auto 1fr auto;}
/* Le programme en cours suit la meme respiration que les metriques : 12px. */
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade.is-maxed{opacity:.7;background:var(--surface);}
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade>header{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:10px;}
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade-icon{display:grid;place-items:center;width:44px;height:44px;border:1px solid var(--border);border-radius:10px;background:var(--surface);font-size:22px;}
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade>header strong{font:900 14px/1.15 var(--font-body);color:var(--ink);}
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade>header small{display:block;color:var(--ink-soft);font:700 11px/1.3 var(--font-body);}
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade-level{padding:5px 10px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--ink);font:900 11px/1 var(--font-body);}
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade-desc{margin:0;color:var(--ink-soft);font:700 12px/1.4 var(--font-body);}
:is(.place-consortium,.place-forum) .coop-upgrade-steps{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:5px;}
:is(.place-consortium,.place-forum) .coop-upgrade-steps i{display:block;height:8px;border-radius:999px;background:var(--surface);border:1px solid var(--border);}
:is(.place-consortium,.place-forum) .coop-upgrade-steps i.is-on{background:var(--accent);border-color:var(--accent-dark);}
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade>footer{display:flex;justify-content:flex-end;align-items:center;gap:10px;padding-top:8px;border-top:1px dashed var(--border);}
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade-max,:is(.place-consortium,.place-forum,.place-research) .coop-upgrade-cost{padding:6px 10px;border-radius:8px;background:var(--surface);color:var(--ink);font:900 11px/1 var(--font-body);border:1px solid var(--border);}
:is(.place-consortium,.place-forum,.place-research) .coop-upgrade-max{color:var(--positive);border-color:var(--positive);}
/* Symetrique du pastillage vert : un verrou de respect se voit au premier coup d'oeil. */

/* Réglages — aperçu à gauche + formulaire à droite */
:is(.place-consortium,.place-forum) .coop-identity-form{display:grid;grid-template-columns:minmax(220px,280px) minmax(0,1fr);gap:0;padding:0;width:100%;min-width:0;}
@media(max-width:900px){:is(.place-consortium,.place-forum) .coop-identity-form{grid-template-columns:1fr;}}
:is(.place-consortium,.place-forum) .coop-identity-preview{display:grid;justify-items:center;gap:12px;padding:24px 20px;background:var(--surface-2);border-right:2px dashed var(--border-strong);text-align:center;align-content:center;}
:is(.place-consortium,.place-forum) .coop-identity-emblem{display:grid;place-items:center;width:96px;height:96px;border:2px solid var(--accent);border-radius:16px;background:var(--surface);font-size:52px;box-shadow:0 2px 0 var(--accent-dark);}
:is(.place-consortium,.place-forum) .coop-identity-preview strong{font:900 18px/1.2 "Baloo 2",var(--font-body);color:var(--ink);}
:is(.place-consortium,.place-forum) .coop-identity-preview p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;color:var(--ink-soft);font:700 12px/1.45 var(--font-body);}
:is(.place-consortium,.place-forum) .coop-identity-fields textarea{padding:12px 16px;line-height:1.5;resize:vertical;}

/* Consortium — titre du bandeau : emblème + nom + | + description */
:is(.place-consortium,.place-forum,.place-research,.place-market) .coop-summary-sep-line{border-top:2px dashed var(--border-strong);margin:0;}

/* Retire le titre du marché commun mais garde un peu d'air en tête de liste. */
/* Consortium — icône et nom en tête, description en dessous. */
.place-consortium .coop-presentation{display:grid;grid-template-columns:52px minmax(0,1fr);grid-template-rows:auto auto;gap:4px 14px;align-items:start;align-content:start;padding:0 4px;}
.place-consortium .coop-presentation-emblem{grid-row:1 / 3;display:grid;place-items:center;box-sizing:border-box;width:52px;height:52px;border:2px solid var(--accent);border-radius:11px;background:var(--surface);font-size:28px;box-shadow:0 2px 0 var(--accent-dark);}
.place-consortium .coop-presentation>strong{min-width:0;overflow-wrap:anywhere;font:900 20px/1.15 "Baloo 2",var(--font-body);color:var(--ink);}
.place-consortium .coop-presentation>p{grid-column:2;margin:0;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink-soft);font:700 13px/1.5 var(--font-body);}

/* Consortium — bandeau présentation + métriques sur une ligne, séparés en pointillé */
.place-consortium .coop-summary-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:stretch;padding:12px 0;}
.place-consortium .coop-summary-row>.coop-presentation{padding-right:16px;border-right:2px dashed var(--border-strong);}
.place-consortium .coop-summary-metrics{margin-top:0;grid-template-columns:1fr 1fr;gap:8px;width:100%;}
.place-consortium .coop-summary-metrics .coop-metric-wide{grid-column:1 / -1;}
@media(max-width:900px){
  .place-consortium .coop-summary-row{grid-template-columns:1fr;}
  .place-consortium .coop-summary-row>.coop-presentation{border-right:0;border-bottom:2px dashed var(--border-strong);padding-right:0;padding-bottom:12px;}
}

.place-consortium .coop-summary-row>.coop-summary-metrics{align-content:center;}

/* Séparation simple des lots actifs, sans cadre interne autour du tableau. */
.coop-tenders-active{margin:6px 0 12px;padding:0;border-bottom:1px solid var(--border);}

/* Consortium — historique "Derniers lots" en petites cartes 3 par ligne */
.place-consortium .coop-claims-sep{margin:24px 16px;border-top:2px dashed var(--border-strong);}
.place-consortium .coop-claims-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:0 16px 12px;}
@media(max-width:900px){.place-consortium .coop-claims-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){.place-consortium .coop-claims-grid{grid-template-columns:1fr;}}
.place-consortium .coop-claim-card{display:grid;gap:4px;padding:6px 8px;border:1px solid var(--border);border-radius:8px;background:var(--surface-2);min-width:0;}
.place-consortium .coop-claim-card>header{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;}
.place-consortium .coop-claim-resource-icon{display:grid;place-items:center;width:28px;height:28px;border:1px solid var(--border);border-radius:6px;background:var(--surface);font-size:15px;}
.place-consortium .coop-claim-card>header>div{display:grid;gap:2px;min-width:0;}
.place-consortium .coop-claim-card>header strong{font:900 11px/1.2 var(--font-body);color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.place-consortium .coop-claim-card>header small{color:var(--ink-soft);font:700 9px/1.2 var(--font-body);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;}
.place-consortium .coop-claim-card>footer{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-top:2px;padding-top:4px;border-top:1px dashed var(--border);}
.place-consortium .coop-claim-status{padding:2px 6px;border-radius:4px;font:900 9px/1 var(--font-body);text-transform:uppercase;letter-spacing:.05em;}
.place-consortium .coop-claim-status.is-done{background:var(--positive-soft);color:var(--positive-dark);}
.place-consortium .coop-claim-status.is-progress{background:var(--surface);color:var(--ink-soft);border:1px solid var(--border);}
.place-consortium .coop-claim-points{color:var(--positive);font:900 10px/1 var(--font-body);}

/* Lots perdus — statut négatif et points en rouge */
.place-consortium .coop-claim-status.is-failed{background:var(--negative-soft);color:var(--negative-dark);}
.place-consortium .coop-claim-points--negative{color:#c94a3e;}
.place-consortium .coop-claim-card--forfeit{background:var(--surface);}

/* Reglages — formulaire pleine largeur avec padding interne */
:is(.place-consortium,.place-forum) .coop-identity-fields{
  display:grid;
  gap:12px;
  align-content:start;padding:16px 20px;}

/* =========================================================
   TOASTS
   ========================================================= */
#toast-root{
  position:fixed;
  top:16px;
  right:308px;
  z-index:10000;
  display:grid;
  gap:10px;
  width:min(380px,calc(100vw - 32px));
  pointer-events:none;
}
.toast{
  position:relative;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  min-height:62px;
  padding:10px 11px;
  border:1px solid var(--border-strong);
  border-left-width:4px;
  border-radius:8px;
  background:var(--surface);
  color:var(--ink);
  box-shadow:0 10px 28px rgba(20,28,24,.22);
  font:700 12px/1.35 var(--font-body,"Nunito",sans-serif);
  pointer-events:auto;
  overflow:hidden;
  animation:toast-in .22s ease-out both;
}
.toast-icon{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:8px;
  background:#fff;
  font-size:17px;
  font-weight:900;
}
.toast-content{display:grid;gap:2px;min-width:0}
.toast-content strong{color:var(--ink);font-size:12px;font-weight:900}
.toast-message{color:var(--ink-soft);font-size:12px;font-weight:700;overflow-wrap:anywhere}
.toast-success{
  border-left-color:var(--positive,#5f8f68);
  background:var(--positive-soft,#eef5e8);
}
.toast-success .toast-icon::before{
  content:"✓";
  color:var(--positive,#5f8f68);
}
.toast-error{
  border-left-color:var(--negative,#b95c4b);
  background:var(--negative-soft,#fdeee4);
}
.toast-error .toast-icon::before{
  content:"!";
  color:var(--negative,#b95c4b);
}
.toast-warning{
  border-left-color:var(--warning,#c08a36);
  background:var(--warning-soft,#fbf3e2);
}
.toast-warning .toast-icon::before{
  content:"!";
  color:var(--warning,#c08a36);
}
.toast-info{
  border-left-color:#397bb5;
  background:#eef5fa;
}
.toast-info .toast-icon::before{
  content:"i";
  color:#397bb5;
}
.toast p,.toast span{
  min-width:0;
  margin:0;
}
.toast button{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  padding:0;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--ink-soft);
  font:900 18px/1 var(--font-body,"Nunito",sans-serif);
  cursor:pointer;
}
.toast button:hover{
  background:var(--surface-2);
  color:var(--ink);
}
.toast.is-leaving,.toast.toast-out{
  animation:toast-out .18s ease-in both;
}
.modal-toast{
  position:fixed;
  top:16px;
  right:308px;
  z-index:2147483647;
  width:min(380px,calc(100vw - 32px));
}
@keyframes toast-in{
  from{opacity:0;transform:translate3d(18px,-6px,0) scale(.98)}
  to{opacity:1;transform:none}
}
@keyframes toast-out{
  from{opacity:1;transform:none}
  to{opacity:0;transform:translate3d(18px,-4px,0) scale(.98)}
}
@media(max-width:1350px){
  #toast-root,.modal-toast{right:16px}
}
@media(max-width:520px){
  #toast-root,.modal-toast{
    top:10px;
    right:10px;
    left:10px;
    width:auto;
  }
  .toast{
    min-height:50px;
    padding:9px 10px;
  }
}
@media(prefers-reduced-motion:reduce){
  .toast,.toast.is-leaving,.toast.toast-out{animation:none}
}

/* Étape 7.1 — première partie guidée */
.first-steps-card{border-left:3px solid var(--accent,#a9703f)}
.first-steps-kicker{display:block;margin-bottom:.2rem;font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--accent,#a9703f)}
.first-steps-body{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1rem;align-items:center;padding-block:1rem}
.first-steps-body p{margin:.1rem 0 .65rem;color:var(--ink-soft,#6b7069)}
.first-steps-actions{align-self:center;white-space:nowrap}
.first-steps-banner{margin-bottom:1rem;border-left:3px solid var(--accent,#a9703f)}
.first-steps-banner>.ui-panel__body{display:flex;gap:1rem;align-items:center;justify-content:space-between}
.catalog-group>header>div,
.first-steps-banner>.ui-panel__body>div{display:grid;gap:.15rem}
.first-steps-banner span{color:var(--ink-soft,#6b7069)}
.objective-card.is-guided{outline:2px solid var(--accent,#a9703f);outline-offset:2px}
@media(max-width:720px){.first-steps-body{grid-template-columns:1fr;gap:.8rem}.first-steps-actions{align-self:stretch}.first-steps-actions .ui-btn{width:100%}.first-steps-banner>.ui-panel__body{align-items:stretch;flex-direction:column}}

/* Ajustement visuel 7.1 — guide dans le corps de carte */
.first-steps-card .ui-panel__header{align-items:center}
.first-steps-card .ui-panel__title{margin:0}
.first-steps-main{min-width:0}
.first-steps-main .first-steps-kicker{margin-bottom:.4rem}
.first-steps-main p{margin:0 0 .7rem;line-height:1.45}
.first-steps-main .objective-gauge{max-width:none}
@media(max-width:720px){
  .first-steps-card .ui-panel__header{align-items:flex-start}
}

/* 7.1 final — la progression occupe réellement toute la carte. */
.first-steps-progress{
  grid-column:1 / -1;
  width:100%;
  max-width:none;
  box-sizing:border-box;
  margin-top:.05rem;
}
@media(max-width:720px){
  .first-steps-progress{grid-column:1}
}

/* Étape 8 — lisibilité boutiques / logistique.
   On conserve les composants du thème ; seules la grille explicative et
   les lignes de stock boutiques sont précisées ici. */

.ui-modal--recap .recap-section,
.place-shops .ui-data-list{
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
}
.place-shops .ui-data-card{
  grid-template-columns:44px minmax(160px,1fr) minmax(150px,.7fr);
  min-height:58px;
  padding:7px 12px;
  border-bottom:1px solid var(--border);
}
.place-shops .ui-data-card:last-child{border-bottom:0}
.place-shops .ui-data-card .ui-data-title{
  padding-left:10px;
}

@media(max-width:760px){
  .place-shops .ui-data-card{grid-template-columns:40px minmax(0,1fr)}
  .place-shops .ui-data-card .ui-data-cell--quantity{
    grid-column:2;
    border-left:0;
    padding-left:10px;
    min-height:0;
  }
}

/* Boutiques — synthèse compacte */
.place-shops .shop-location-metrics article{
  min-height:46px;
}

/* Étape 8 — boutiques / flotte : cartes de gestion */

.place-shops .shop-location-metrics{
  width:100%;
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.fleet-card>header{
  min-height:52px;
}

.fleet-card .ui-panel__tools form{
  margin:0;
}

.fleet-card .ui-panel__tools .ui-btn{
  white-space:nowrap;
}

@media(max-width:760px){

  .place-shops .shop-location-metrics{
    grid-template-columns:1fr;
  }
}

/* Correctif boutiques / organisation flotte */
.place-shops .shop-shelves{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:10px;
  margin:10px 0 14px;
}

.place-shops .shop-shelf-card{
  display:grid !important;
  grid-template-columns:48px minmax(0,1fr) minmax(150px,auto);
  align-items:center;
  gap:12px;
  min-height:64px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-2);
  box-sizing:border-box;
}

.place-shops .shop-shelf-icon{
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  font-size:21px;
}

.place-shops .shop-shelf-main strong,
.place-shops .shop-shelf-stock strong{
  color:var(--ink);
  font:900 14px/1.25 var(--font-body);
}

.place-shops .shop-shelf-stock{
  min-width:150px;
  padding-left:14px;
  border-left:1px solid var(--border);
  text-align:right;
}

@media(max-width:760px){
  .place-shops .shop-shelf-card{
    grid-template-columns:42px minmax(0,1fr);
  }
  .place-shops .shop-shelf-stock{
    grid-column:2;
    min-width:0;
    padding-left:0;
    border-left:0;
    text-align:left;
  }
}

/* Logistique — bas de page en deux colonnes */
.logistics-lower-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:12px;
  align-items:start;
}
.logistics-lower-grid>.ui-panel,
.logistics-lower-grid>div>.ui-panel{
  margin:0;
}

@media(max-width:1100px){
  .logistics-lower-grid{
    grid-template-columns:1fr;
  }
}

/* Logistique globale */

/* Votre flotte : colonnes fixes */

/* Logistique globale — même rail flottant que le chat */
.global-logistics-toggle{
  align-items:center;
  gap:7px;
  cursor:pointer;
  position:relative;
  display:grid;
  place-items:center;
}
.global-logistics-toggle>span{
  font-size:22px;
}
.global-logistics-toggle>b{
  position:absolute;
  top:-8px;
  right:-14px;
  min-width:34px;
  height:21px;
  padding:0 5px;
  border:2px solid var(--surface);
  border-radius:999px;
  background:var(--shell-raised);
  color:var(--surface-2);
  font:900 10px/17px var(--font-body);
  white-space:nowrap;
}
@media(max-width:760px){
  .global-logistics{
    left:-3px;
    right:auto;
    bottom:158px;
  }
}

/* Popover logistique — finition compacte */

/* Popover transport — finition visuelle */
.global-logistics-panel{
  position:absolute;
  margin:0;
  border-left:0;
  left:62px;
  right:auto;
  bottom:-2px;
  width:328px;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  box-shadow:0 14px 34px rgba(24,36,28,.22);
}

.global-logistics-panel>header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:52px;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  background:var(--surface-2);
}

.global-logistics-panel>header h3::before{
  content:"🚛";
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface);
  font-size:16px;
}

.global-logistics-panel .ui-panel__tools{
  margin:0 0 0 auto;
}

.global-logistics-panel .ui-btn{
  min-height:31px;
  padding:5px 10px;
  border-radius:8px;
  font-size:10px;
  white-space:nowrap;
}

.global-logistics-panel .ui-panel__body{
  padding:10px;
}

.water-survey-actions,
.global-logistics-stats{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}

.global-logistics-stats p{
  display:grid;
  gap:2px;
  margin:0;
  position:relative;
  min-height:66px;
  padding:10px 11px;
  align-content:center;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-2);
}

.global-logistics-stats small{
  display:block;
  margin-bottom:4px;
  color:var(--ink-mute);
  font-size:9px;
  font-weight:900;
  line-height:1.1;
  letter-spacing:.07em;
  text-transform:uppercase;
}

.global-logistics-toggle[aria-expanded="true"]{
  z-index:2;
  border-color:var(--border);
}

@media(max-width:760px){
  .global-logistics-panel{
    left:58px;
    width:min(318px,calc(100vw - 70px));
  }
}

@media(max-width:460px){
  .global-logistics-stats{
    grid-template-columns:1fr;
  }

  .global-logistics-panel{
    width:min(285px,calc(100vw - 70px));
  }
}

/* Popover transport — nombres compacts */
.global-logistics-stats p::after{
  position:absolute;
  left:10px;
  right:10px;
  bottom:7px;
  height:2px;
  border-radius:999px;
  background:var(--border);
  opacity:.7;
  content:none;
  display:none;
}
.global-logistics-stats strong{
  display:block;
  color:var(--ink);
  font-size:12px;
  font-weight:900;
  line-height:1.25;
  overflow:visible;
  text-overflow:clip;
  white-space:nowrap;
}

/* Chat — harmonisation avec le popover logistique */

.farm-chat-tools.ui-chat button{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  padding:0;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--ink);
  font-size:14px;
  cursor:pointer;
}

.farm-chat-tools.ui-chat button:hover{
  background:var(--surface-2);
}

.ui-chat-body{
  overflow: auto;
}

.farm-chat-rooms.ui-chat{
  display:flex;
  flex-direction:column;
  gap:7px;
  min-width:0;
  padding:10px 8px;
  border-right:1px solid var(--border);
  background:var(--surface-2);
}

.farm-chat-room-select.ui-chat{
  min-height:34px;
  padding:6px 8px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--ink);
  font:800 10px/1.1 var(--font-body);
}

.farm-chat-rooms.ui-chat [data-chat-rooms] button,
.farm-chat-dm-open.ui-chat{
  display:flex;
  align-items:center;
  gap:6px;
  width:100%;
  min-height:34px;
  padding:6px 8px;
  border:1px solid transparent;
  border-radius:8px;
  background:transparent;
  color:var(--ink);
  font:800 10px/1.1 var(--font-body);
  text-align:left;
}

.farm-chat-rooms.ui-chat [data-chat-rooms] button.is-active,
.farm-chat-rooms.ui-chat [data-chat-rooms] button[aria-current="true"]{
  border-color:var(--border);
  background:var(--surface);
  color:var(--ink);
  box-shadow:0 2px 8px rgba(24,36,28,.06);
}

.farm-chat-thread.ui-chat{
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  min-width:0;
  min-height:0;
  background:var(--surface);
}

[data-chat-message]{
  margin:0 0 8px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-2);
  color:var(--ink);
}

[data-chat-message]:last-child{
  margin-bottom:0;
}

[data-chat-message] strong{
  color:var(--ink);
}

[data-chat-message] small{
  color:var(--ink-mute);
}

[data-chat-compose]{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  padding:10px 12px;
  border-top:1px solid var(--border);
  background:var(--surface-2);
}

[data-chat-compose] input,
[data-chat-compose] textarea{
  min-width:0;
  min-height:36px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface);
  color:var(--ink);
  font:700 11px/1.25 var(--font-body);
  outline:none;
}

[data-chat-compose] input:focus,
[data-chat-compose] textarea:focus{
  border-color:var(--ink-mute);
  box-shadow:0 0 0 2px rgba(40,58,45,.08);
}

[data-chat-compose] button{
  min-width:74px;
  min-height:36px;
  padding:7px 11px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface);
  color:var(--ink);
  font:900 10px/1 var(--font-body);
  cursor:pointer;
}

[data-chat-compose] button:hover{
  background:var(--surface-2);
}

/* Neutralise les anciens aplats orange du chat */
.ui-chat [style*="background"],
.ui-chat [style*="background-color"]{
  background-color:inherit;
}

@media(max-width:760px){

  .farm-chat-rooms.ui-chat{
    padding:8px 6px;
  }
}

@media(max-width:520px){

  .farm-chat-rooms.ui-chat{
    border-right:0;
    border-bottom:1px solid var(--border);
  }
}

/* Chat v2 — structure saine et thème Terravia */

section.ui-chat[data-chat] .farm-chat-bubble{
  position:relative;
  place-items:center;
  cursor:pointer;
}

section.ui-chat[data-chat] .farm-chat-bubble:hover{
  transform:translateX(2px);
}

section.ui-chat[data-chat] .farm-chat-panel{
  position:absolute;
  overflow:hidden;
  border:1px solid var(--border);
  background:var(--surface);
  box-shadow:0 14px 34px rgba(24,36,28,.22);
}

section.ui-chat[data-chat] .farm-chat-panel>header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  height:auto;
  min-height:52px;
  padding:10px 12px;
  border:0;
  border-bottom:1px solid var(--border);
  border-radius:0;
}

.global-logistics-panel>header h3,
section.ui-chat[data-chat] .farm-chat-panel>header strong{
  display:flex;
  align-items:center;
  gap:7px;
  margin:0;
  color:var(--ink);
  font:900 13px/1.1 var(--font-body);
}

section.ui-chat[data-chat] .farm-chat-panel>header strong::before{
  /* Remplacee par le salon actif : voir setTitle() dans chat.js. */
  content:var(--chat-icon,"💬");
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface);
  font-size:15px;
}

section.ui-chat[data-chat] .farm-chat-tools{
  display:flex;
  gap:6px;
}

section.ui-chat[data-chat] .farm-chat-tools button{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  padding:0;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--ink);
  box-shadow:none;
  font-size:14px;
}

section.ui-chat[data-chat] .farm-chat-room-select{
  display:none;
}

section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms]{
  display:grid;
  gap:6px;
  overflow:auto;
}

section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms] button,
section.ui-chat[data-chat] .farm-chat-dm-open{
  display:grid;
  grid-template-columns:20px minmax(0,1fr);
  align-items:center;
  gap:6px;
  width:100%;
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:var(--ink);
  box-shadow:none;
  text-align:left;
  cursor:pointer;
}

.farm-chat-bans button strong,
section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms] button strong{
  overflow:hidden;
  font-size:11px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ui-game-content.game-place .catalogue-icon,
.farm-chat-rooms.ui-chat [data-chat-rooms] button:hover,
.farm-chat-dm-open.ui-chat:hover,
section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms] button:hover,
section.ui-chat[data-chat] .farm-chat-dm-open:hover{
  border-color:var(--border);
  background:var(--surface);
}

section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms] button.is-active{
  border-color:var(--border-strong);
  background:var(--surface);
  color:var(--ink);
  box-shadow:0 2px 8px rgba(24,36,28,.07);
}

section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms] button.is-active :is(strong,small,span){
  color:inherit;
}

section.ui-chat[data-chat] .farm-chat-dm-open{
  display:flex;
  justify-content:center;
  margin-top:auto;
  font:900 10px/1 var(--font-body);
}

section.ui-chat[data-chat] .farm-chat-line:hover{
  background:var(--surface-2);
}

section.ui-chat[data-chat] .farm-chat-line time{
  font-size:9px;
}

section.ui-chat[data-chat] .farm-chat-line b{
  color:var(--ink);
}

section.ui-chat[data-chat] .farm-chat-form input:focus{
  border-color:var(--border-strong);
  outline:none;
  box-shadow:0 0 0 2px rgba(40,58,45,.07);
}

@media(max-width:620px){
  section.ui-chat[data-chat] .farm-chat-panel{
    left:58px;
  }
}

/* Chat — bouton actif + grande fenêtre */

@media(max-width:900px){
  section.ui-chat[data-chat] .farm-chat-panel{
    height:min(620px,80vh);
  }
}

/* Chat XL — bulles identiques + fenêtre agrandie */
section.ui-chat[data-chat] .farm-chat-bubble,
.global-logistics-toggle,
section.ui-chat[data-chat] .farm-chat-bubble[aria-expanded="true"],
.global-logistics-toggle[aria-expanded="true"]{
  min-height:0;
}

/* Boutons flottants — gris fermé, blanc ouvert, forme inchangée */
section.ui-chat[data-chat] .farm-chat-bubble,
.global-logistics-toggle{
  width:54px;
  height:64px;
  min-height:0;
  padding:0;
  border:1px solid var(--shell-border);
  border-left:0;
  border-radius:0 17px 17px 0;
  background:var(--shell);
  color:var(--surface-2);
  box-shadow:var(--shadow-lift);
}

section.ui-chat[data-chat] .farm-chat-bubble:hover,
.global-logistics-toggle:hover{
  border-color:#4e5a52;
  background:var(--shell-raised);
  color:var(--surface-2);
}

section.ui-chat[data-chat] .farm-chat-bubble[aria-expanded="true"],
.global-logistics-toggle[aria-expanded="true"]{
  width:54px;
  height:64px;
  padding:0;
  border:1px solid var(--border);
  border-left:0;
  border-radius:0 17px 17px 0;
  background:var(--surface);
  color:var(--ink);
  box-shadow:0 8px 22px rgba(24,36,28,.15);
}

/* L'ouverture change uniquement les couleurs : pas de pointe ni de silhouette différente. */
section.ui-chat[data-chat] .farm-chat-bubble[aria-expanded="true"]::after{
  position:absolute;
  right:-7px;
  top:50%;
  width:12px;
  height:12px;
  transform:translateY(-50%) rotate(45deg);
  border-top:1px solid var(--border);
  border-right:1px solid var(--border);
  background:var(--surface);
  content:none;
}

/* Chat XXL — grande fenêtre desktop */
section.ui-chat[data-chat] .farm-chat-panel{
  width:min(1180px,calc(100vw - 110px));
  height:min(860px,92vh);
}

section.ui-chat[data-chat] .ui-chat-body{
  display:grid;
  grid-template-columns:240px minmax(0,1fr);
  height:calc(100% - 52px);
  min-height:0;
  max-height:none;
  background:var(--surface);
}

section.ui-chat[data-chat] .farm-chat-rooms{
  position:static;
  display:flex;
  flex-direction:column;
  gap:7px;
  min-width:0;
  border:0;
  border-right:1px solid var(--border);
  background:var(--surface-2);
  padding:16px 14px;
}

section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms] button,
section.ui-chat[data-chat] .farm-chat-dm-open{
  min-height:46px;
  padding:9px 11px;
}

section.ui-chat[data-chat] .farm-chat-form input{
  min-width:0;
  width:auto;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface);
  color:var(--ink);
  box-shadow:none;
  font:700 11px/1.2 var(--font-body);
  min-height:42px;
  padding:9px 12px;
  font-size:12px;
}

section.ui-chat[data-chat] .farm-chat-form button{
  padding:7px 11px;
  border:1px solid var(--border-strong);
  border-radius:9px;
  color:var(--ink);
  box-shadow:none;
  font:900 10px/1 var(--font-body);
  min-width:104px;
  min-height:42px;
  font-size:11px;
}

@media(max-width:1350px){
  section.ui-chat[data-chat] .farm-chat-panel{
    width:min(1020px,calc(100vw - 100px));
    height:min(800px,90vh);
  }

  section.ui-chat[data-chat] .ui-chat-body{
    grid-template-columns:210px minmax(0,1fr);
  }
}

@media(max-width:1050px){
  section.ui-chat[data-chat] .farm-chat-panel{
    width:min(880px,calc(100vw - 90px));
    height:min(720px,88vh);
  }

  section.ui-chat[data-chat] .ui-chat-body{
    grid-template-columns:180px minmax(0,1fr);
  }
}

@media(max-width:760px){
  section.ui-chat[data-chat] .farm-chat-panel{
    width:calc(100vw - 72px);
    height:min(650px,84vh);
  }

  section.ui-chat[data-chat] .ui-chat-body{
    grid-template-columns:130px minmax(0,1fr);
  }
}

/* Chat — les salons système ne sont jamais quittables */
section.ui-chat[data-chat] .farm-chat-tools button[hidden]{
  display:none !important;
}

/* Économie v2 — Finances */
.place-finance .finance-command__metrics{
  /* Les indicateurs tiennent sur une ligne ; en dessous de 200 px chacun,
     la grille se replie d'elle-meme plutot que de comprimer les montants. */
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  margin-bottom:12px;
}

/* Fiscalite et charges : deux lectures du meme mois, cote a cote. */
.place-finance .finance-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  align-items:start;
}
.place-finance .finance-row>section{
  margin-bottom:12px;
}

.place-finance .finance-tax,
.place-finance .finance-specific-costs{
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
}

.place-finance :is(.finance-tax,.finance-specific-costs) h2{
  margin:0;
  color:var(--ink);
  font:800 13px/1.2 var(--font-title);
}

.place-finance :is(.finance-tax,.finance-specific-costs) header small{
  display:block;
  margin-bottom:2px;
  color:var(--ink-mute);
  font-size:9px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.place-finance .finance-tax,
.place-finance .finance-specific-costs{
  margin-bottom:12px;
  padding:13px 14px;
}

.place-finance .finance-tax>header,
.place-finance .finance-specific-costs>header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 11px;
  padding:0;
  border:0;
  background:none;
}

.place-finance .finance-tax>header>strong,
.place-finance .finance-specific-costs>header>strong{
  color:var(--ink);
  font-size:13px;
}

.place-finance .finance-tax-flow{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
  align-items:stretch;
}

.place-finance .finance-tax-flow article{
  display:grid;
  gap:3px;
  padding:9px 10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface-2);
}

.place-finance .finance-tax-flow small{
  color:var(--ink-mute);
  font-size:9px;
  font-weight:800;
}

.place-finance .finance-tax-flow b{
  color:var(--ink);
  font-size:12px;
}

.place-finance .finance-specific-costs__grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}

.place-finance .finance-specific-costs__grid article{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface-2);
}

.product-info-dialog .market-chart-head>div:first-child,
.product-info-dialog .product-modal-title>div,
.product-info-dialog .market-order>header>div,
.product-info-dialog .market-chain-section>header>div,
.place-finance .finance-specific-costs__grid article>div{
  display:grid;
  gap:2px;
}

.player-rank small,
.place-finance .finance-specific-costs__grid strong{
  color:var(--ink);
  font-size:11px;
}

.place-finance .finance-specific-costs__grid small{
  color:var(--ink-mute);
  font-size:9px;
}

.place-finance .finance-specific-costs__grid b{
  color:var(--ink);
  font-size:11px;
  white-space:nowrap;
}

@media(max-width:760px){

  .place-finance .finance-specific-costs__grid{
    grid-template-columns:1fr;
  }

  .place-finance .finance-row,
  .place-finance .finance-tax-flow{
    grid-template-columns:1fr;
  }
}

/* Finances — bouton de filtre actif */

.place-finance [data-history-filter].is-active,
.place-finance [data-history-filter].is-active:hover,
.place-finance [data-history-filter].is-active:focus,
.place-finance [data-finance-filter].is-active,
.place-finance [data-finance-filter].is-active:hover,
.place-finance [data-finance-filter].is-active:focus{
  color:#fff !important;
}

/* Chat — actions de modération sur la même ligne, à droite */

section.ui-chat[data-chat] .farm-chat-line>span:not(.farm-chat-tools-cell){
  min-width:0 !important;
}

section.ui-chat[data-chat] .farm-chat-tools-cell{
  position:static !important;
  right:auto !important;
  top:auto !important;
  display:flex !important;
  align-items:center !important;
  align-self:center !important;
  justify-self:end !important;
  gap:3px !important;
  padding:0 !important;
  background:none !important;
  box-shadow:none !important;
  visibility:hidden;
}

section.ui-chat[data-chat] .farm-chat-line:hover .farm-chat-tools-cell,
section.ui-chat[data-chat] .farm-chat-tools-cell:focus-within{
  visibility:visible !important;
}

@media(max-width:720px){
  section.ui-chat[data-chat] .farm-chat-tools-cell{
    visibility:hidden !important;
  }
  section.ui-chat[data-chat] .farm-chat-line:hover .farm-chat-tools-cell,
  section.ui-chat[data-chat] .farm-chat-tools-cell:focus-within{
    visibility:visible !important;
  }
}

.ui-data-list--table .ui-data-cell--gain{
  position:relative;
}

.ui-game-content .farm-help-button{
  display:grid;
  flex-shrink:0;
  place-items:center;
  width:26px;
  min-width:26px;
  height:26px;
  padding:0;
  border:1px solid var(--border-strong);
  border-radius:50%;
  background:var(--surface);
  color:var(--ink);
  font:900 12px/1 var(--font-body);
  text-decoration:none;
  cursor:pointer;
}

.ui-game-content .farm-help-button:hover{
  background:var(--surface-2);
  border-color:var(--accent);
}

/* Logistique — typographie moins lourde, limitée à cette page */
.place-logistics .ui-panel--note,
.place-logistics .ui-panel__body > p{
  font-weight:500;
}

.place-logistics .ui-panel--note strong,
.place-logistics .ui-panel__body > p strong{
  font-weight:600;
}

.place-logistics .ui-metrics small,
.place-logistics .ui-table-grid small{
  font-weight:600;
}

.place-logistics .ui-metrics strong,
.place-logistics .fleet-card h3,
.place-logistics .ui-table-grid strong{
  font-weight:700;
}

/* Finances — filtres Transactions sur une seule ligne */
.place-finance .history-filters{
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  flex-wrap:nowrap;
}

.place-finance .history-year-filter>span{
  font:700 10px/1 var(--font-body);
  font-size:9px !important;
  color:var(--ink-mute);
}

/* Logistique — tableaux du bas alignés sur la typographie de l'historique */
/* Logistique — panneau bas seul */
.place-logistics .logistics-lower-grid--single{
  grid-template-columns:1fr;
}

/* Finances — filtre année compact, ancré à droite */
.place-finance .history-year-filter{
  display:flex;
  align-items:center;
  gap:6px;
  margin-left:auto !important;
  width:auto !important;
  white-space:nowrap;
}

.place-finance .history-year-filter select{
  width:92px !important;
  min-width:92px !important;
  height:30px !important;
  padding:0 24px 0 9px !important;
  font-size:10px !important;
}

@media(max-width:760px){
  .place-finance .history-filters{
    flex-wrap:wrap;
  }

  .place-finance .history-year-filter{
    width:100% !important;
    margin-left:0 !important;
  }
}

/* ── Étape 8b — catalogue flotte : cartes véhicules ────────────────
   Remplace l'ancien rendu « panneau générique » du bloc
   « Agrandir la flotte » (app/Views/game/logistics.twig). */
.fleet-card__id{min-width:0}
.fleet-card__flag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:26px;
  padding:0 7px;
  border:1px solid var(--border);
  background:var(--surface);
  font:800 10px/1 var(--font-body);
  color:var(--ink-soft);
}
.fleet-card__flag--lock{
  border-color:var(--border-strong);
  background:var(--surface-3);
  font-size:11px;
}
.fleet-card__bar>span{
  display:block;
  height:100%;
  border-radius:inherit;
  background:var(--fleet-accent);
}

.fleet-card__note{
  margin:0;
  font:700 11px/1.35 var(--font-body);
  color:var(--ink-soft);
}
.fleet-card__note--warn{color:var(--warning)}

.weather-station>div,
body .ui-game .recipe-preview :is([data-recipe-inputs],[data-recipe-outputs]),
.place-shops .shop-shelf-main,
.place-shops .shop-shelf-stock,
.fleet-card__rep{
  display:grid;
  gap:3px;
}
.fleet-card__rep-bar{
  height:4px;
  overflow:hidden;
  border-radius:999px;
  background:var(--surface-sunken);
  border:1px solid var(--border);
}
.fleet-card__rep-bar>span{
  display:block;
  height:100%;
  border-radius:inherit;
  background:var(--border-strong);
}
.fleet-card__rep small{
  font:700 11px/1.35 var(--font-body);
  color:var(--ink-soft);
}
.fleet-card.is-locked:hover{transform:none;box-shadow:var(--shadow)}
.fleet-card.is-locked .fleet-card__title{color:var(--ink-soft)}
.fleet-card.is-locked .fleet-card__bar>span{background:var(--border-strong)}
.fleet-card.is-locked .ui-btn{
  border-color:var(--border-strong);
  background:var(--surface-3);
  color:var(--ink-mute);
  cursor:not-allowed;
}

/* Catalogue flotte : une carte horizontale complete par vehicule. */
.fleet-catalog{
  display:grid;grid-template-columns:minmax(0,1fr);gap:9px}
.fleet-card{
  --fleet-accent:var(--accent);
  position:relative;
  flex-direction:column;
  margin:0;
  border:1px solid var(--border);
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;display:grid;grid-template-columns:minmax(180px,1.1fr) minmax(140px,.72fr) minmax(245px,1.25fr) minmax(290px,1.3fr);align-items:stretch;min-width:0;overflow:hidden;border-radius:10px;background:var(--surface);box-shadow:0 3px 10px rgba(28,32,28,.08)}
.fleet-card::before{
  content:"";
  height:3px;
  background:var(--fleet-accent);display:none}
.fleet-card:hover{
  border-color:var(--border-strong);
  box-shadow:var(--shadow-lift);transform:translateX(2px)}
.fleet-card__head{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;grid-column:1;min-width:0;gap:11px;padding:15px 14px 15px 17px}
.fleet-card__icon{
  display:grid;
  place-items:center;
  border:1px solid var(--border);
  box-shadow:inset 0 -2px 0 rgba(28,32,28,.05);
  line-height:1;width:46px;height:46px;border-radius:9px;background:var(--surface-2);font-size:24px}
.fleet-card__id>small{display:block;margin-bottom:4px;color:var(--ink-mute);font:800 9px/1 var(--font-body);text-transform:uppercase}
.fleet-card__title{
  margin:0;
  font:900 13px/1.2 var(--font-body);
  color:var(--ink);font-size:15px;line-height:1.2}
.fleet-card__flag{height:25px;border-radius:6px;font-size:10px}
.fleet-card__gauge{
  display:grid;grid-column:2;align-content:center;gap:8px;margin:0;padding:13px 15px;border:0;border-left:1px solid var(--border);border-radius:0;background:var(--surface-2)}
.fleet-card__gauge-head{
  align-items:baseline;
  justify-content:space-between;display:grid;gap:4px}
.fleet-card__gauge-head small{
  font:800 10px/1.2 var(--font-body);
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--ink);font-size:9px}
.fleet-card__gauge-head strong{
  font:900 12px/1.2 var(--font-body);
  color:var(--ink);font-size:17px;line-height:1.1}
.fleet-card__bar{
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface-sunken);height:5px}
.fleet-card .fleet-card__bar>span{background:var(--negative)}
.fleet-card__stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  list-style:none;
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);grid-column:3;align-items:center;gap:0;margin:0;padding:12px 5px;border:0;border-left:1px solid var(--border);border-radius:0;background:var(--surface);overflow:hidden}
.fleet-card__stats li{
  display:grid;
  gap:2px;
  min-width:0;
  text-align:center;min-height:44px;padding:6px 8px;border-right:1px solid var(--border);background:var(--surface)}
.fleet-card__stats li:last-child{border-right:0}
.fleet-card__stats small{
  font:800 10px/1.2 var(--font-body);
  text-transform:uppercase;
  color:var(--ink);font-size:8px;letter-spacing:.06em}
.fleet-card__stats strong{
  font:900 12px/1.2 var(--font-body);
  color:var(--ink);font-size:12px;line-height:1.35}
.fleet-card__foot{
  display:grid;
  align-items:center;
  margin-top:auto;grid-column:4;grid-template-columns:minmax(95px,1fr) 140px;gap:8px;margin:0;padding:12px;border:0;border-left:1px solid var(--border);background:var(--surface-2)}
.fleet-card__price small{
  display:block;
  font:800 10px/1.2 var(--font-body);
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--ink);font-size:9px}
.fleet-card__price strong{
  font:900 12px/1.2 var(--font-body);
  color:var(--ink);font-size:14px;line-height:1.3}
.fleet-card__price span{display:block;margin-top:2px;color:var(--ink-mute);font:700 9px/1.25 var(--font-body)}
.fleet-card__foot form{
  margin:0;display:grid;grid-template-columns:minmax(0,1fr);gap:6px;min-width:0}
.fleet-card__quantity{width:100%;max-width:140px;height:32px;box-sizing:border-box}
.fleet-card__quantity input{min-width:38px;width:42px}
.fleet-card__quantity button{width:34px}
.fleet-card__foot .ui-btn{
  white-space:nowrap;width:100%;min-height:34px;padding:0 12px}
.fleet-card__rep,.fleet-card__note{grid-column:1/-1;padding:8px 14px 9px 17px;border-top:1px solid var(--border);background:var(--surface-2)}
.fleet-card.is-locked{
  box-shadow:none;background:var(--surface)}
.fleet-card.is-locked .fleet-card__icon{filter:grayscale(.7);opacity:.7}

@media(max-width:900px){
  .fleet-card{display:flex}
  .fleet-card:hover{transform:translateY(-1px)}
  .fleet-card__gauge,.fleet-card__stats,.fleet-card__foot{border-left:0}
  .fleet-card__gauge{margin:0 14px;border:1px solid var(--border);border-radius:8px}
  .fleet-card__stats{margin:10px 14px 0;border:1px solid var(--border);border-radius:8px}
  .fleet-card__foot{grid-template-columns:minmax(0,1fr) minmax(150px,auto);border-top:1px solid var(--border)}
}
@media(max-width:560px){
  .fleet-catalog{grid-template-columns:1fr}
  .fleet-card__foot{grid-template-columns:1fr;gap:8px}
  .fleet-card__foot .ui-btn{width:100%}
}

/* Registre « Votre flotte » — même échelle typographique que les cartes. */
/* Tuiles de métriques — échelle réduite (partout : empire, météo, logistique…). */
.ui-metrics article{
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: none;
  height:46px;
  gap:8px;
  padding:8px 10px;
}
.ui-metrics small{
  text-transform: uppercase;
  color: var(--ink-mute);
  font:900 9px/1 var(--font-body);
  letter-spacing:.06em;
}
.ui-metrics strong{
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font:900 14px/1.1 var(--font-body);
}

/* Aperçu Logistique — les 6 métriques tiennent sur une seule ligne. */

/* Boutiques — un seul rail de 6 métriques, et messages non gras partout. */
.ui-panel--note{
  margin:0 0 12px;
  font-size:12px;
  color:var(--ink);
  font-weight:500;
}
.ui-panel--note strong{
  font-weight:600;
}
.place-shops .shop-overview-metrics{
  width:100%;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
}
.place-shops .shop-overview-metrics article{
  height:auto;
  min-height:46px;
  align-items:center;
}
.place-shops .shop-overview-metrics strong{
  font-size:13px;
  white-space:normal;
}
.place-shops .shop-overview-metrics p>small+strong+small{
  font-weight:600;
  color:var(--ink-mute);
}

/* Boutiques : en-tetes et rayons adaptes aux petits ecrans. */
@media(max-width:600px){
  .ui-game-content.place-shops>.ui-panel>header :is(h1,h2){
    grid-column:1;
    grid-row:1;
    min-width:0;
    margin:0;
    font-size:16px;
    overflow-wrap:anywhere;
  }
  .ui-game-content.place-shops>.ui-panel>header .ui-panel__tools{
    grid-column:1 / -1;
    grid-row:2;
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-start;
    gap:6px;
    width:100%;
    margin:0;
  }
  .ui-game-content.place-shops>.ui-panel>header .ui-badge{
    max-width:100%;
    min-width:0;
    font-size:10px;
    white-space:normal;
  }
  /* Boutons du magasin (Fermer, Réapprovisionner) côte à côte sous les badges, au lieu d'être empilés l'un sur l'autre. */
  .ui-game-content.place-shops>.ui-panel>header:has(>.ui-btn){grid-template-columns:auto auto minmax(0,1fr)}
  .ui-game-content.place-shops>.ui-panel>header:has(>.ui-btn) :is(h1,h2){grid-column:1/-1}
  .ui-game-content.place-shops>.ui-panel>header>.ui-btn{
    grid-column:2;
    grid-row:3;
    justify-self:start;
    width:auto;
    min-height:30px;
    height:30px;
    padding:0 12px;
    margin:0;
    font-size:12px;
  }
  .ui-game-content.place-shops>.ui-panel>header>.ui-btn--primary{grid-column:1}
  .ui-game-content.place-shops>.ui-panel>.ui-panel__body{padding:12px}
  .place-shops .shop-overview-metrics{
    grid-template-columns:minmax(0,1fr);
    gap:6px;
  }
  .place-shops .shop-overview-metrics article{min-width:0;min-height:42px;padding:8px 10px}
  .place-shops .shop-shelves{grid-template-columns:minmax(0,1fr);gap:7px;margin:10px 0 0}
  .place-shops .shop-shelf-card{
    grid-template-columns:36px minmax(0,1fr);
    column-gap:10px;
    row-gap:3px;
    min-width:0;
    min-height:68px;
    padding:10px;
  }
  .place-shops .shop-shelf-icon{grid-row:1 / span 2;width:36px;height:36px}
  .place-shops .shop-shelf-main{min-width:0;grid-column:2;gap:0}
  .place-shops .shop-shelf-main>small{display:none}
  .place-shops .shop-shelf-main strong{overflow-wrap:anywhere}
  .place-shops .shop-shelf-stock{
    grid-column:2;
    display:flex;
    flex-wrap:wrap;
    align-items:baseline;
    gap:4px 8px;
    min-width:0;
    padding:0;
    border:0;
    text-align:left;
  }
  .place-shops .shop-shelf-stock strong{overflow-wrap:anywhere;font-size:13px}
}

/* Champ nombre + raccourcis de quantité — version générique (modales du jeu). */
.ui-number-stepper{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 34px;
  height:42px;
  overflow:hidden;
  border:1px solid var(--border-strong);
  border-radius:8px;
  background:var(--surface);
}
.ui-number-stepper input{
  width:100%;
  height:40px;
  padding:0 10px;
  border:0;
  border-inline:1px solid var(--border);
  border-radius:0;
  background:transparent;
  font:900 13px/1 var(--font-body);
  color:var(--ink);
  appearance:textfield;
  -moz-appearance:textfield;
}
.ui-number-stepper input::-webkit-inner-spin-button,
.ui-number-stepper input::-webkit-outer-spin-button{
  margin:0;
  appearance:none;
  -webkit-appearance:none;
}
.ui-number-stepper button{
  width:34px;
  height:40px;
  padding:0;
  border:0;
  border-radius:0;
  background:var(--surface-2);
  color:var(--ink);
  font:900 16px/1 var(--font-body);
  cursor:pointer;
}
.ui-number-stepper button:hover{
  background:var(--accent-soft);
  color:var(--accent-dark);
}
.ui-number-stepper:focus-within{
  border-color:var(--accent-dark);
}

.ui-quick-amounts{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:4px;
  padding:3px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface-3);
}
.product-info-dialog .market-range-tabs button,
.ui-quick-amounts button{
  min-width:0;
  height:27px;
  padding:0 9px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--ink-mute);
  font:900 9px/1 var(--font-body);
  cursor:pointer;
}
.ui-quick-amounts button:hover{
  background:var(--surface);
  color:var(--accent-dark);
  box-shadow:var(--shadow);
}

/* Registre flotte — une ligne par type, totaux alignés sous les colonnes. */
.ui-table-grid--fleet>header,
.ui-table-grid--fleet>article,
.ui-table-grid--fleet>footer:not(.history-pagination){
  display:grid;
  grid-template-columns:var(--ui-table-columns,minmax(170px,1.6fr) 90px minmax(130px,.9fr) minmax(130px,.9fr));
  column-gap:32px;
  align-items:center;
}
.ui-table-grid--fleet>footer:not(.history-pagination)>span,
.ui-table-grid--fleet>footer:not(.history-pagination)>strong{
  font:800 11px/1.2 var(--font-body);
  color:var(--ink);
}

.fleet-mobile-label{display:none}
.ui-game-content .farm-help-button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:600px){
  .ui-game-content.place-shops>.ui-panel>header,
.ui-game-content.place-logistics .logistics-overview>header{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    align-items:center;
    padding:12px;
  }
  /* Logistique : titre, amélioration et aide sur une seule ligne ; le niveau actuel est déjà dans le bouton suivant. */
  .ui-game-content.place-logistics .logistics-overview>header{grid-template-columns:auto minmax(0,1fr) auto}
  .place-logistics .logistics-overview>header h1{grid-column:1;grid-row:1;margin:0}
  .place-logistics .logistics-overview>header .farm-help-button{grid-column:3;grid-row:1;justify-self:end}
  .place-logistics .logistics-overview>header .ui-panel__tools>.ui-badge:first-child:not(:last-child){display:none}
  .place-logistics .logistics-overview>header .ui-panel__tools{
    grid-column:2;
    grid-row:1;
    display:flex;
    flex-wrap:nowrap;
    justify-content:flex-end;
    gap:8px;
    min-width:0;
    margin:0;
  }
  .place-logistics .logistics-overview>header .ui-panel__tools form{min-width:0;max-width:100%;margin:0}
  .place-logistics .logistics-overview>header .ui-badge,
.place-logistics .logistics-overview>header .ui-btn{max-width:100%;white-space:nowrap}
}
@media(max-width:760px){
  .place-logistics .logistics-lower-grid,
  .place-logistics .logistics-lower-grid>div{min-width:0}
  .ui-table-grid--fleet{
    min-width:0;
    width:100%;
  }
  .ui-table-grid--fleet>header{display:none}
  .ui-table-grid--fleet>article,
  .ui-table-grid--fleet>footer:not(.history-pagination){
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:10px 12px;
    min-width:0;
    padding:12px;
  }
  .ui-table-grid--fleet>article>*,
  .ui-table-grid--fleet>footer:not(.history-pagination)>*{
    min-width:0;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .ui-table-grid--fleet>article>*:nth-child(2),
  .ui-table-grid--fleet>footer:not(.history-pagination)>*:nth-child(2){
    justify-self:end;
    text-align:right;
  }
  .ui-table-grid--fleet .fleet-mobile-label{
    display:block;
    margin-bottom:4px;
    color:var(--ink-mute);
    font:800 9px/1.3 var(--font-body);
    letter-spacing:.04em;
    text-transform:uppercase;
  }
  .ui-table-grid--fleet>article>*:nth-child(4),
  .ui-table-grid--fleet>footer:not(.history-pagination)>*:nth-child(4){text-align:right}
}

/* Séparateur pointillé entre deux blocs d'un même panneau. */
.ui-split{
  height:0;
  margin:18px 0;
  border-top:1px dashed var(--border-strong);
}
.ui-metrics+.ui-table-grid{
  margin-top:14px;
}

/* « À surveiller » : le bloc n'apparaît que s'il y a un risque à traiter — il se lit en rouge. */
.weather-alerts{
  display: grid;
  gap: 7px;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--ink);
  border-color:#e7bfae;
  background:var(--negative-soft);
}
.weather-alerts>strong{
  font: 900 11px/1 "Nunito","Trebuchet MS",sans-serif;
  text-transform: uppercase;
  letter-spacing: .05em;
  color:var(--negative-dark);
}
.weather-alerts li{
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background:var(--negative-soft);
}
.weather-alerts li b,
.weather-alerts li em{
  color:var(--negative-dark);
}
.weather-alerts li small{
  font: 800 9px/1 "Nunito","Trebuchet MS",sans-serif;
  color:var(--negative-dark);
}

/* Cases à cocher en ligne dans les formulaires d'administration (rangs). */
.ui-check-grid{
  display:flex;
  flex-wrap:wrap;
  gap:6px 14px;
  min-width:0;
}
.ui-check-grid label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font:700 11px/1.2 var(--font-body);
  color:var(--ink);
}
.ui-form-row .ui-check-grid input[type=checkbox]{
  width:16px;
  min-width:16px;
  height:16px;
  padding:0;
  border-radius:5px;
  accent-color:var(--accent);
}

/* Administration : les tuiles de métriques occupent toute la largeur. */
.place-admin .ui-metrics{
  margin-top:0;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
}

/* Registre des améliorations : le palier tient sur une seule ligne. */
.ui-table-grid--upgrades>header,
.ui-table-grid--upgrades>article{
  grid-template-columns:40px minmax(150px,1.2fr) minmax(150px,1fr) 88px 182px;
}
.ui-table-grid--upgrades form{
  margin:0;
}
.ui-table-grid--upgrades .coop-upgrade-steps{
  margin:0;
}

/* Textes légaux : même mise en forme en page, dans le jeu et en modale. */
.legal-copy h2{
  margin:16px 0 4px;
  font:900 14px/1.3 var(--font-body);
  color:var(--ink);
}
.legal-copy h2:first-child{
  margin-top:0;
}
.legal-copy p{
  margin:0 0 8px;
  font:500 13px/1.6 var(--font-body);
  color:var(--ink);
}
.legal-copy a{
  color:var(--accent-dark);
}
/* Pages publiques hors jeu (CGU, contact). */
.legal-page{
  display:grid;
  gap:12px;
  max-width:860px;
  margin:0 auto;
  padding:24px 16px 40px;
}
.legal-page .ui-panel__body{
  padding:16px 18px 20px;
}
.legal-page>.ui-panel>header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:68px;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  border-radius:8px 8px 0 0;
  background:var(--surface-3);
}
.legal-page>.ui-panel>header h1{
  margin:0;
  color:var(--ink);
  font:800 22px/1.2 var(--font-title);
}
.legal-page>.ui-panel>header .ui-panel__tools{
  flex:0 0 auto;
}
.legal-page>.ui-panel>header .ui-badge{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--ink-mute);
  font:800 10px/1 var(--font-body);
  text-transform:uppercase;
}
@media(max-width:620px){
  .legal-page>.ui-panel>header{align-items:flex-start;flex-direction:column}
  .legal-page>.ui-panel>header h1{font-size:19px}
}
.legal-page-links{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

/* Fiche d'empire : médailles non obtenues et familles repliables. */
.medal-family{
  margin:0 0 6px;
}
.medal-family>summary{
  cursor:pointer;
  list-style:none;
}
.medal-family>summary::-webkit-details-marker{
  display:none;
}
.medal-family>summary .medal-group{
  margin:16px 0 10px;
}
.medal-badge.is-locked{
  border-style:dashed;
  background:var(--surface-2);
}
.medal-badge.is-locked>span{
  filter:grayscale(1);
  opacity:.45;
}
.medal-badge.is-locked>strong{
  color:var(--ink-soft);
}
.medal-progress{
  display:block;
  width:100%;
  height:4px;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface-sunken);
}
.medal-progress>b{
  display:block;
  height:100%;
  border-radius:inherit;
  background:var(--accent);
}

/* Fiche d'empire : colonne d'identité à gauche, blocs à droite. */
.place-profile .profile-layout{
  display:grid;
  grid-template-columns:minmax(0,380px) minmax(0,1fr);
  gap:18px;
  align-items:start;
}
.place-profile .profile-layout>*{
  min-width:0;
}
.place-profile .profile-aside{
  position:sticky;
  /* Le bandeau de jeu fait 76px + son liseré : on se cale juste dessous. */
  top:88px;
}
.place-profile .profile-layout .ui-panel{
  margin:0 0 18px;
}
.place-profile .profile-aside .ui-panel{
  border:2px solid var(--border-strong);
}
.place-profile .profile-aside .ui-btn--block{
  width:100%;
}
.place-water .water-survey-metrics,
.farm-chat-rooms.ui-chat [data-chat-rooms],
.profile-links{
  display:grid;
  gap:6px;
}
.profile-links form{
  width:100%;
  margin:0;
}
.terravia-impersonate-icon{
  display:inline-block;
  flex:0 0 22px;
  width:22px;
  height:22px;
  background:url("../images/library/impersonate-eye-v1.png") center/contain no-repeat;
}
.profile-links .ui-btn{
  justify-content:flex-start;
  gap:8px;
}
.place-profile .profile-layout .ui-panel:last-child{
  margin-bottom:0;
}
.profile-hero{
  display:grid;
  justify-items:center;
  gap:8px;
  padding:20px 16px 16px;
  text-align:center;
}
.profile-hero .profile-emblem{
  width:104px;
  height:104px;
  border-radius:50%;
  font-size:42px;
}
.profile-hero>strong{
  font:900 18px/1.25 "Baloo 2","Nunito",sans-serif;
  color:var(--ink);
}
.profile-hero>strong em{
  font:800 12px/1 var(--font-body);
  font-style:normal;
  color:var(--ink-mute);
}
.profile-hero .profile-badges{
  justify-content:center;
}
.profile-rank{
  display:grid;
  justify-items:center;
  gap:2px;
  width:100%;
  margin-top:4px;
  padding:10px 14px;
  border:2px solid var(--border);
  border-radius:12px;
  background:var(--surface-2);
}
.profile-rank b{
  font:900 26px/1 "Baloo 2","Nunito",sans-serif;
  color:var(--ink);
}
.profile-rank small{
  font:800 10px/1 var(--font-body);
  letter-spacing:.07em;
  text-transform:uppercase;
  color:var(--ink-mute);
}
.profile-facts{
  margin:0;
  padding:0;
  list-style:none;
  border-top:1px solid var(--border);
}
.profile-facts li{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  padding:9px 16px;
  border-bottom:1px solid var(--border);
}
.profile-facts li:last-child{
  border-bottom:0;
}
.profile-facts li:nth-child(even){
  background:var(--surface-2);
}
.profile-facts span{
  font:800 10px/1.2 var(--font-body);
  letter-spacing:.07em;
  text-transform:uppercase;
  color:var(--ink-soft);
}
body .ui-game .ui-modal .ui-status>strong,
.profile-facts b{
  font:900 12px/1.2 var(--font-body);
  color:var(--ink);
  text-align:right;
}
.profile-facts b>.terravia-ui-icon{
  width:17px;
  height:17px;
  margin-right:5px;
  vertical-align:middle;
}
.first-steps-banner strong{
  display:flex;
  align-items:center;
  gap:7px;
}
.first-steps-banner strong>.terravia-ui-icon{width:24px;height:24px}
.place-profile .rank-bar{
  margin-bottom:10px;
}
@media(max-width:1100px){
  .place-profile .profile-layout{
    grid-template-columns:1fr;
  }
  .place-profile .profile-aside{
    position:static;
  }
}

/* Fiche d'empire : une seule rangée de tuiles pour l'exploitation. */
.place-profile .profile-main .ui-metrics{
  grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
}

/* Selects : Firefox dessine sa fleche collee au bord et ignore le padding.
   On la remplace par un chevron maison, place a 12px du bord. Une dizaine de
   regles de page posent deja un raccourci `background` sur les selects, avec
   une specificite plus forte : plutot que de toutes les lister (et d'oublier
   les prochaines), on force ici les seules proprietes du chevron. La couleur
   de fond reste celle de chaque contexte. */
select:not([multiple]):not([size]){
  appearance:none !important;
  -webkit-appearance:none !important;
  -moz-appearance:none !important;
  padding-right:34px !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b7069' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;
  background-position:right 12px center !important;
  background-size:11px 7px !important;
}

/* Prise en main d'un compte : un bandeau qu'on ne peut pas rater. */
.impersonation-bar{
  position:sticky;
  top:0;
  z-index:60;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:8px 18px;
  background:#8f3823;
  color:#fff;
  font:800 12px/1.35 var(--font-body);
  text-align:center;
}
.impersonation-bar b{
  font-weight:900;
}
.impersonation-bar form{
  margin:0;
}
.impersonation-bar .ui-btn{
  border-color:#fff;
  background:#fff;
  color:#8f3823;
}

/* Filtres de transactions : le libellé actif se lit en blanc sur le cuivre. */
.place-history .history-filters button.active,
.ui-game-content .ui-panel__body>.history-filters button.active{
  border-color: var(--accent-dark);
  background: var(--accent);
  box-shadow: inset 0 -3px rgba(28,32,28,.10);
  color:#fff;
}

/* Chat : bouton d'émoticônes et palette repliable. */
section.ui-chat[data-chat] .farm-chat-form{
  display:grid;
  width:auto;
  border:0;
  border-top:1px solid var(--border);
  background:var(--surface-2);
  gap:10px;
  padding:13px 15px;
  position:relative;
  grid-template-columns:auto minmax(0,1fr) auto;
}
section.ui-chat[data-chat] .farm-chat-emoji-toggle{
  width:38px;
  cursor:pointer;
}

/* DM, emoticones et envoi : meme cuivre que les actions des contrats. */
section.ui-chat[data-chat] .farm-chat-dm-open,
section.ui-chat[data-chat] .farm-chat-form>button{
  background:var(--accent);
  border-color:var(--accent-dark);
  color:#fff;
}
section.ui-chat[data-chat] .farm-chat-dm-open:hover,
section.ui-chat[data-chat] .farm-chat-form>button:hover{
  background:var(--accent-dark);
  border-color:var(--accent-dark);
  color:#fff;
}
section.ui-chat[data-chat] .farm-chat-dm-open:focus-visible,
section.ui-chat[data-chat] .farm-chat-form>button:focus-visible{
  outline:2px solid var(--accent-dark);
  outline-offset:3px;
}
section.ui-chat[data-chat] .farm-chat-emoji{
  position:absolute;
  left:10px;
  right:10px;
  bottom:calc(100% + 6px);
  z-index:5;
  grid-template-columns:repeat(auto-fit,minmax(36px,1fr));
  gap:4px;
  max-height:none;
  overflow:visible;
  padding:8px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  box-shadow:var(--shadow-lift);
}
section.ui-chat[data-chat] .farm-chat-emoji button{
  min-width:0;
  width:100%;
  min-height:36px;
  height:36px;
  box-sizing:border-box;
  padding:0;
  border:0;
  border-radius:8px;
  background:transparent;
  box-shadow:none;
  font-size:18px;
  line-height:1;
  cursor:pointer;
}
section.ui-chat[data-chat] .farm-chat-emoji button:hover{
  background:var(--surface-2);
}

/* Chat : le pseudo porte la couleur de son rang et mène à la fiche d'empire. */
section.ui-chat[data-chat] .farm-chat-line>b{
  display:inline-flex;
  align-items:center;
  gap:3px;
  min-height:20px;
  font-size:14px;
  line-height:20px;
}
section.ui-chat[data-chat] a.farm-chat-author:hover{
  text-decoration:none;
}
section.ui-chat[data-chat] a.farm-chat-author:focus-visible{text-decoration:none}

/* Rangs : le sélecteur de couleur reste à la taille des autres champs. */
.ui-form-row input[type=color]{
  width:56px;
  padding:2px;
  cursor:pointer;
}

/* Modale « Choisir une production » : le récapitulatif en tuiles lisibles. */
body .ui-game .recipe-cycle-item{
  display:grid;
  gap:3px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface);
}
body .ui-game .recipe-cycle-item small{
  font:800 9px/1.2 var(--font-body);
  letter-spacing:.07em;
  text-transform:uppercase;
  color:var(--ink-mute);
}
body .ui-game .recipe-cycle-item b{
  font:900 12px/1.25 var(--font-body);
  color:var(--ink);
}
body .ui-game .recipe-cycle-item b.is-bonus{color:var(--positive)}
body .ui-game .recipe-cycle-item b.is-malus{color:var(--negative)}

/* Modale de production : un cadre autour du bloc, un filet pointillé entre
   entrées et sorties (la flèche a disparu). */
body .ui-game .recipe-preview{
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface-2);
}
body .ui-game .recipe-preview .recipe-materials{
  align-items: stretch;
  margin:0;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:0;
}
body .ui-game .recipe-preview .recipe-materials>div{
  display: grid;
  align-content: start;
  gap: 5px;
  padding:0 14px;
  border:0;
  background:transparent;
}
body .ui-game .recipe-preview .recipe-materials>div:first-child{
  padding-left:0;
}

/* Modale de production : les tuiles sortent du cadre, trois par ligne. */
body .ui-game .recipe-preview-wrap{
  display:grid;
  gap:12px;
}
body .ui-game .recipe-preview-meta{
  display:grid;
  gap:8px;
  padding:0;
  grid-template-columns:repeat(3,minmax(0,1fr));
  margin:0;
}
@media(max-width:700px){
  body .ui-game .recipe-preview-meta{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/* Le filet entrées/sorties : un dégradé répété plutôt qu'une bordure pointillée,
   les tirets restent alors bien droits aux extrémités. */
body .ui-game .recipe-preview .recipe-materials>div+div{
  padding-right:0;
  border-left:0;
  background-image:repeating-linear-gradient(to bottom,var(--border-strong) 0 6px,transparent 6px 12px);
  background-repeat:no-repeat;
  background-position:left top;
  background-size:1px 100%;
}
@media(max-width:700px){
  /* Entrées puis sorties l'une sous l'autre : les noms des produits restent lisibles. */
  body .ui-game .recipe-preview .recipe-materials{grid-template-columns:minmax(0,1fr);gap:12px}
  body .ui-game .recipe-preview .recipe-materials>div{padding:0}
  body .ui-game .recipe-preview .recipe-materials>div+div{padding-top:12px;border-top:1px dashed var(--border-strong);background:none}
  body .ui-game .recipe-preview .recipe-materials>i{display:none}
}

/* Score d'un compte de l'équipe : illisible pour les autres joueurs. */
.is-hidden-score,.profile-facts b.is-hidden-score{
  color:transparent !important;
  text-shadow:0 0 8px rgba(38,32,26,.8);
  filter:blur(3px);
  user-select:none;
  pointer-events:none;
}

/* Ligne « aucun résultat » dans un classement. */
.leaderboard-list__empty{
  display:grid !important;
  grid-template-columns:1fr !important;
  place-items:center;
  min-height:44px;
  text-align:center;
  font:800 12px/1.4 var(--font-body);
  color:var(--ink-mute);
}

/* Concessions communes : meme registre que les ameliorations du consortium. */
.ui-table-grid--concessions>header,
.ui-table-grid--concessions>article{
  grid-template-columns:40px minmax(140px,1.1fr) minmax(120px,.9fr) minmax(150px,1fr) minmax(130px,.9fr) 200px;
}
.ui-table-grid--upgrades>header>span:last-child,
.ui-table-grid--upgrades>article>:last-child,
.ui-table-grid--concessions>header>span:last-child,
.ui-table-grid--concessions>article>:last-child{
  justify-self:end;
  text-align:right;
}
.ui-table-grid--concessions form{
  display:flex;
  gap:6px;
  margin:0;
}
.ui-table-grid--concessions .coop-concession-stepper{
  width:150px;
  flex:0 0 150px;
}
.ui-table-grid--concessions .coop-concession-stepper input[type=number]{
  width:100%;
  min-width:0;
}
.coop-concession-actions{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:5px;
  align-items:stretch;
  justify-content:stretch;
  width:100%;
}
.coop-concession-actions form{
  display:grid;
  grid-template-columns:150px minmax(0,1fr);
  gap:6px;
  width:100%;
}
.coop-concession-actions .ui-btn{
  width:100%;
  min-height:34px;
  height:auto;
  padding:7px 8px;
  white-space:normal;
}

/* Centre d'aide : sommaire a gauche, lecture a droite. Le plan reste visible
   pendant qu'on lit une reponse, et la recherche filtre les deux a la fois. */
.ui-game-content .help-layout{
  display:grid;
  grid-template-columns:262px minmax(0,1fr);
  gap:16px;
  align-items:start;
}
.ui-game-content .help-layout .help-article{
  max-width:none;
}
.ui-game-content .help-nav{
  position:sticky;
  top:12px;
  display:grid;
  gap:6px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--surface-2);
}
.ui-game-content .help-nav input{
  width:100%;
}
.ui-data-cell>small,
.place-shops .shop-shelf-main small,
.place-shops .shop-shelf-stock small,
.ui-game-content .help-nav__count{
  font:800 9px/1.2 var(--font-body);
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--ink-mute);
}
.ui-game-content .help-nav__count:empty{
  display:none;
}
.ui-game-content .help-nav__topic{
  /* Bandeau de rubrique : meme barre que les en-tetes de registre du jeu. Les
     marges negatives la font courir d'un bord a l'autre du sommaire. */
  margin:12px -12px 4px;
  padding:5px 12px;
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
  background:var(--surface);
  font:800 10px/1.2 var(--font-body);
  letter-spacing:.07em;
  text-transform:uppercase;
  color:var(--ink-soft);
}
.ui-game-content .help-nav__topic,
.ui-game-content .catalog-group>header h2{
  display:flex;
  align-items:center;
  gap:7px;
}
.ui-game-content .help-nav__topic>.terravia-ui-icon{
  flex:0 0 18px;
  width:18px;
  height:18px;
}
.ui-game-content .catalog-group>header h2>.terravia-ui-icon{
  flex:0 0 24px;
  width:24px;
  height:24px;
}
.ui-game-content .help-nav nav>section:first-child .help-nav__topic{
  margin-top:6px;
}
.ui-game-content .help-nav nav{
  display:grid;
}
.ui-game-content .help-nav ul{
  display:grid;
  gap:2px;
  margin:0;
  padding:0;
  list-style:none;
}
.ui-game-content .help-nav a{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border-radius:7px;
  color:var(--ink-soft);
  font:700 11px/1.35 var(--font-body);
}
.ui-game-content .help-nav a>.terravia-ui-icon{
  flex:0 0 22px;
  width:22px;
  height:22px;
}
.ui-game-content .help-nav a>span{
  min-width:0;
}

/* Accord juridique bloquant : le fond reste reconnaissable, mais aucune zone du
   jeu ne demeure interactive tant que la version courante n'est pas acceptee. */
.legal-agreement-lock{
  position:fixed;
  inset:0;
  z-index:10000;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(8,16,13,.78);
  backdrop-filter:blur(5px);
}
.legal-agreement-window{
  width:min(680px,100%);
  max-height:min(760px,calc(100vh - 48px));
  overflow:auto;
  border:1px solid var(--border-strong);
  border-radius:8px;
  background:var(--surface);
  box-shadow:0 24px 70px rgba(0,0,0,.55);
}
.legal-agreement-header{
  display:grid;
  grid-template-columns:52px minmax(0,1fr);
  gap:14px;
  align-items:center;
  padding:20px 22px;
  border-bottom:1px solid var(--border);
  background:var(--surface-2);
}
.legal-agreement-header>.terravia-ui-icon{
  width:52px;
  height:52px;
}
.legal-agreement-header small{
  display:block;
  margin-bottom:3px;
  color:var(--ink-mute);
  font:800 10px/1.2 var(--font-body);
  text-transform:uppercase;
}
.legal-agreement-header h1{
  margin:0;
  color:var(--ink);
  font:800 25px/1.15 var(--font-title);
}
.legal-agreement-body{
  display:grid;
  gap:18px;
  padding:22px;
}
.legal-agreement-body>p{
  margin:0;
  color:var(--ink-soft);
  font:700 13px/1.55 var(--font-body);
}
.legal-agreement-documents{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.legal-agreement-documents>a{
  display:grid;
  grid-template-columns:40px minmax(0,1fr);
  gap:10px;
  align-items:center;
  padding:13px;
  border:1px solid var(--border);
  border-radius:7px;
  background:var(--surface-2);
  color:var(--ink);
  text-decoration:none;
}
.legal-agreement-documents>a:hover{border-color:var(--accent)}
.legal-agreement-documents .terravia-ui-icon{width:38px;height:38px}
.legal-agreement-documents span{display:grid;gap:3px;min-width:0}
.legal-agreement-documents strong{font:800 12px/1.3 var(--font-title)}
.legal-agreement-documents small{color:var(--ink-mute);font:700 10px/1.35 var(--font-body)}
.legal-agreement-form{display:grid;gap:10px}
.legal-agreement-check{
  display:flex;
  gap:11px;
  align-items:flex-start;
  padding:14px;
  border:1px solid var(--border-strong);
  border-radius:7px;
  background:var(--surface-2);
  color:var(--ink);
  font:800 12px/1.45 var(--font-body);
  cursor:pointer;
}
.legal-agreement-check input{flex:0 0 auto;width:18px;height:18px;margin:1px 0 0;accent-color:var(--accent)}
.legal-agreement-form>[data-error]{color:var(--danger);font:700 11px/1.3 var(--font-body)}
.legal-agreement-form>.ui-btn{width:100%;min-height:44px}
.legal-agreement-footer{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:12px;
  padding:14px 22px;
  border-top:1px solid var(--border);
  background:var(--surface-2);
}
.legal-agreement-footer>span{color:var(--ink-mute);font:800 10px/1.2 var(--font-body);text-transform:uppercase}
@media(max-width:620px){
  .legal-agreement-lock{padding:10px}
  .legal-agreement-window{max-height:calc(100vh - 20px)}
  .legal-agreement-documents{grid-template-columns:1fr}
  .legal-agreement-header{padding:16px;grid-template-columns:44px minmax(0,1fr)}
  .legal-agreement-header>.terravia-ui-icon{width:44px;height:44px}
  .legal-agreement-header h1{font-size:20px}
  .legal-agreement-body{padding:16px}
  .legal-agreement-footer{padding:12px 16px}
}
.ui-game-content .help-nav a:hover{
  background:var(--surface);
  color:var(--ink);
}
.ui-game-content .help-nav a.is-current{
  background:var(--surface);
  color:var(--ink);
  box-shadow:inset 2px 0 0 var(--accent);
}
@media(max-width:900px){
  .ui-game-content .help-layout{
    grid-template-columns:1fr;
  }
  .ui-game-content .help-nav{
    position:static;
  }
}

/* Navigation dynamique : l'ancienne page reste intacte jusqu'au remplacement. */
.ui-game.is-page-loading{
  cursor:progress;
}
.ui-page-loader{
  position:fixed;
  top:146px;
  left:50%;
  z-index:70;
  display:flex;
  align-items:center;
  gap:10px;
  min-width:150px;
  padding:11px 16px;
  border:2px solid var(--accent);
  border-radius:8px;
  background:var(--surface);
  color:var(--ink);
  font:800 13px/1 "Nunito",sans-serif;
  box-shadow:0 8px 24px rgba(20,28,24,.28);
  transform:translateX(-50%);
  pointer-events:none;
}
.ui-page-loader[hidden]{display:none}
.ui-page-loader i{
  width:14px;
  height:14px;
  flex:0 0 14px;
  border:2px solid var(--border-strong);
  border-top-color:var(--accent);
  border-radius:50%;
  animation:terravia-waiting-spin .7s linear infinite;
}
@keyframes terravia-waiting-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.ui-page-loader i{animation:none}}
@media(max-width:760px){.ui-page-loader{top:72px}}

/* Barre de sélection groupée sur mobile : les deux menus tiennent cote a cote
   et les commandes descendent a 32 px. Trois lignes au lieu de cinq, sans
   nouvelle classe ni markup a part. */
@media(max-width:760px){
  .ui-game-content .ui-panel__body>.ui-actionbar{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:center;
    gap:6px;
    padding:8px 10px;
    margin-bottom:8px;
  }
  .ui-game-content .ui-panel__body>.ui-actionbar .bulk-all{
    height:32px;
    margin:0;
    padding:0 9px 0 7px;
    font-size:10px;
  }
  .ui-game-content .ui-panel__body>.ui-actionbar strong{
    margin:0;
    font-size:12px;
    text-align:right;
  }
  .ui-game-content .ui-panel__body>.ui-actionbar select{
    width:100%;
    min-width:0;
    height:32px;
    padding:0 8px;
    font-size:11px;
  }
  .ui-game-content .ui-panel__body>.ui-actionbar button{
    grid-column:1/-1;
    width:100%;
    min-height:34px;
  }  /* Champs : Tout + compteur, puis filtre + par page, puis culture groupée + Appliquer. */
  .ui-game-content .ui-panel__body>.crop-bulk-bar [data-plot-crop-filter]{grid-column:1;grid-row:2}
  .ui-game-content .ui-panel__body>.crop-bulk-bar [data-plot-per-page]{grid-column:2;grid-row:2}
  .ui-game-content .ui-panel__body>.crop-bulk-bar:not(:has([data-plot-per-page])) [data-plot-crop-filter]{grid-column:1/-1}
  .ui-game-content .ui-panel__body>.crop-bulk-bar select[name=crop]{grid-column:1;grid-row:3}
  .ui-game-content .ui-panel__body>.crop-bulk-bar>button{grid-column:2;grid-row:3;min-height:32px;height:32px}
  /* Usines : Tout + compteur, filtres côte à côte, production groupée + par page, puis Réparer + Appliquer. */
  .ui-game-content .ui-panel__body>.factory-bulk-bar [data-factory-efficiency-filter]{grid-column:1;grid-row:2}
  .ui-game-content .ui-panel__body>.factory-bulk-bar [data-factory-production-filter]{grid-column:2;grid-row:2}
  .ui-game-content .ui-panel__body>.factory-bulk-bar [data-factory-recipe]{grid-column:1;grid-row:3}
  .ui-game-content .ui-panel__body>.factory-bulk-bar [data-factory-per-page]{grid-column:2;grid-row:3}
  .ui-game-content .ui-panel__body>.factory-bulk-bar:not(:has([data-factory-per-page])) [data-factory-recipe]{grid-column:1/-1}
  .ui-game-content .ui-panel__body>.factory-bulk-bar>button[type=submit]{grid-column:1;grid-row:4}
  .ui-game-content .ui-panel__body>.factory-bulk-bar [data-factory-production-apply]{grid-column:2;grid-row:4}
  .ui-game-content .ui-panel__body>.factory-bulk-bar>button{min-height:32px;height:32px}
}

/* Entrepot sur mobile : la recherche et la case tiennent sur une seule ligne,
   au lieu d'un bandeau de deux rangees au-dessus des reserves. */
@media(max-width:760px){
  .place-warehouse .warehouse-toolbar{
  display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    margin-bottom:9px;
    padding-bottom:8px;
  }
  .place-warehouse .warehouse-toolbar input[type=search]{
  width:100%;
  min-width:0;
    height:32px;
    font-size:11px;
  }
  .place-warehouse .warehouse-stock-only{
    grid-column:auto;
    gap:6px;
    font-size:11px;
  }
  .ui-game-content .ui-panel__body>.ui-actionbar .bulk-all input,
.place-warehouse .warehouse-stock-only input{
    width:15px;
    height:15px;
  }
}

/* Correctif accueil desktop : les 4 previsions restent sur une seule ligne. */
@media (min-width: 900px){
  .ui-game-home :is(.weather-day,.weather-forecast)>div{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}

/* Modales du jeu — typographie et champs numériques homogènes. */
body .ui-game .ui-modal,
body .ui-game .ui-modal :is(form,label,input,select,button,p,small,strong,span){
  font-family:var(--font-body);
}
/* ================================================================
   MODALES — passe d'uniformisation globale
   Un même rythme, les mêmes champs et les mêmes cartes d'action.
   ================================================================ */
body .ui-game .ui-modal > :is(form,.ui-modal-shell) > header + *{margin-top:var(--modal-gap);}
body .ui-game .ui-modal .ui-modal-body{
  display:grid;
  align-items:start;
  /* Seule marge latérale des modales : le corps des formulaires (plus de marge sur chaque bloc). */
  padding-inline:var(--modal-pad);
}
body .ui-game .ui-modal .ui-modal-body--scroll{
  max-height:min(72vh,720px);
  padding-block:16px 20px;
  overflow:auto;
}
body .ui-game .ui-modal .ui-modal-body>:is(.ui-panel--note,.ui-metrics){margin:0;}
body .ui-game .ui-modal .ui-modal-body--split{
  grid-template-columns:minmax(0,1.3fr) minmax(200px,1fr);
  gap:20px;
}
body .ui-game .ui-modal .ui-modal-body--split>.ui-panel--note{grid-column:1 / -1;}
body .ui-game .ui-modal .ui-modal-fields{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  padding-top:16px;
  border-top:1px dashed var(--border-strong);
}

/* Rangs : separateur R&D, puis panneau distinct pour les droits. */
body .ui-game .role-modal .role-permissions{
  margin-top:12px;
  margin-bottom:0;
  border-radius:10px;
  box-shadow:none;
  overflow:hidden;
}
body .ui-game .role-modal .role-permissions .ui-status{
  margin:0;
  border:0;
  border-radius:0;
  border-bottom:1px solid var(--border);
  background:var(--surface-2);
}
body .ui-game .role-modal .role-permissions .ui-panel__body{
  padding:0;
  background:var(--surface);
}
body .ui-game .role-modal .role-permissions .ui-modal-fields{
  margin:0;
  padding:12px 14px 14px;
  border:0;
}

/* Evenements admin : composition uniquement, les composants restent generiques. */
.place-admin .admin-events__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.place-admin .admin-events__header h2{margin:0;font:900 18px/1.2 var(--font-title);}
.place-admin .admin-event-card .asset-card__visual{background:var(--surface-2);}
@media(max-width:560px){
  .place-admin .admin-events__header{align-items:flex-start;}
}

/* Les bandeaux d'etat restent dans la meme gouttiere que les cartes d'action. */
body .ui-game .ui-modal .ui-modal-shell .ui-status{
  margin-inline:var(--modal-pad);
}

body .ui-game .ui-modal .ui-modal-section--divided{
  display:grid;
  gap:8px;
  padding-left:20px;
  border-left:1px dashed var(--border-strong);
}
body .ui-game .ui-modal .ui-field{
  display:grid;
  gap:7px;
  margin-top:14px;
  color:var(--ink-soft);
  font:800 12px/1.25 var(--font-body);
}
body .ui-game .ui-modal .ui-field + .ui-field{margin-top:16px;}
body .ui-game .ui-modal .ui-field > :is(input:not([type=checkbox]):not([type=radio]),select,textarea){
  width:100%;
  min-height:var(--modal-control-h);
  border:1px solid var(--border-strong);
  border-radius:10px;
  background:var(--surface);
  color:var(--ink);
  font:800 13px/1.2 var(--font-body);
  outline:none;
}
body .ui-game .ui-modal .ui-field > :is(input:not([type=checkbox]):not([type=radio]),select){
  padding:0 13px;
}
body .ui-game .ui-modal .ui-field > :is(input,select,textarea):focus{
  border-color:var(--accent-dark);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 20%,transparent);
}
body .ui-game .ui-modal .ui-number-stepper{
  width:100%;
  height:var(--modal-control-h);
  margin:0;
  border-radius:10px;
}
body .ui-game .ui-modal .ui-number-stepper input,
body .ui-game .ui-modal .ui-number-stepper button{height:calc(var(--modal-control-h) - 2px);}
body .ui-game .ui-modal :is(.ui-hint,.ui-hint--compact,.livestock-capacity){
  margin-top:5px;
  margin-bottom:0;
  color:var(--ink-mute);
  font:700 10px/1.35 var(--font-body);
}
body .ui-game .ui-modal .ui-summary--total{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:56px;
  margin-top:14px;
  padding:11px 13px;
  border:0;
  border-radius:10px;
  background:var(--surface-2);
}
body .ui-game .ui-modal .ui-summary--total>span{
  color:var(--ink-mute);
  font:900 10px/1.1 var(--font-body);
  text-transform:uppercase;
}
body .ui-game .ui-modal .ui-summary--total>strong{
  color:var(--ink);
  font:900 20px/1.1 var(--font-title);
  text-align:right;
}
body .ui-game .ui-modal .ui-feedback:empty{display:none;}

/* Atelier usine : remplace le bloc plat par des cartes cohérentes avec le reste du jeu. */
body .ui-game .ui-modal :is(.equipment-soil,.equipment-irrigate){
  box-sizing:border-box;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-2);
}
body .ui-game .ui-modal .equipment-soil{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-height:48px;
  margin-top:12px;
  padding:10px 12px;
}
body .ui-game .ui-modal .equipment-soil span{color:var(--ink-soft);font:800 11px/1.25 var(--font-body);}
body .ui-game .ui-modal .equipment-soil strong{font:900 12px/1.25 var(--font-body);text-align:right;}
body .ui-game .ui-modal .equipment-irrigate{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:8px;
  padding:11px 12px;
}
body .ui-game .ui-modal .equipment-irrigate p{display:grid;gap:4px;min-width:0;margin:0;}
body .ui-game .ui-modal .equipment-irrigate p strong{color:var(--ink);font:900 12px/1.2 var(--font-body);}
.ui-data-list--table .contract-gain-detail,
body .ui-game .ui-modal .equipment-irrigate p small{color:var(--ink-soft);font:700 10px/1.35 var(--font-body);}
body .ui-game .ui-modal .workshop-hint{margin-top:8px;padding:9px 11px;border-radius:8px;}

@media(max-width:600px){
  body .ui-game .ui-modal{--modal-pad:14px;--modal-gap:12px;}
  body .ui-game .ui-modal .ui-modal-body--split,
  body .ui-game .ui-modal .ui-modal-fields{grid-template-columns:minmax(0,1fr);}
  body .ui-game .ui-modal .ui-modal-section--divided{padding:16px 0 0;border-left:0;border-top:1px dashed var(--border-strong);}
  body .ui-game .ui-modal .equipment-irrigate{align-items:stretch;flex-direction:column;}
  body .ui-game .ui-modal .equipment-irrigate .ui-btn{align-self:flex-end;}
  body .ui-game .ui-modal .ui-summary--total>strong{font-size:18px;}
}

/* 2026-09 — finition modale vente concession + appels d'offres consortium */
.ui-modal .sale-suggestion{
  display:flex;align-items:center;gap:10px;min-height:38px;margin:8px 0 0;padding:8px 10px;
  border:1px solid var(--border);border-radius:9px;background:var(--surface-2);
  color:var(--ink-soft);font:700 12px/1.25 var(--font-body);
}
.ui-modal .sale-suggestion strong{color:var(--ink);font:900 14px/1.2 var(--font-body);white-space:nowrap;}
.ui-modal .sale-suggestion-apply{
  margin-left:auto;min-height:28px;padding:5px 10px;border:1px solid var(--accent-dark);border-radius:7px;
  background:var(--surface);color:var(--accent-dark);font:900 10px/1 var(--font-body);cursor:pointer;
}
.ui-modal .sale-suggestion-apply:hover{background:var(--accent-soft);}
.ui-modal .sale-suggestion + .livestock-capacity{margin:10px 0 0;color:var(--ink-soft);font:700 10px/1.45 var(--font-body);}

@media(max-width:1100px){
   .ui-data-list--compact-mobile{
    display:grid;
    gap:0;
    overflow:hidden;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:var(--surface);
  }
   .ui-data-list--compact-mobile>.ui-data-card{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-rows:auto auto auto auto;
    align-items:stretch;
    gap:0;
    min-height:0;
    padding:10px;
    border:0;
    border-bottom:1px solid var(--border);
    border-radius:0;
    background:var(--surface);
    overflow:hidden;
  }
   .ui-data-list--compact-mobile>.ui-data-card:nth-child(even){background:var(--surface);}
   .ui-data-list--compact-mobile>.ui-data-card:last-child{border-bottom:0;}
   .ui-data-list--compact-mobile>.ui-data-card .resource-medal{
    grid-column:1;grid-row:1;justify-self:start;align-self:center;
    width:38px;height:38px;margin:0 0 14px;font-size:20px;
  }
   .ui-data-list--compact-mobile>.ui-data-card .ui-data-title{
    grid-column:1 / -1;grid-row:1;align-self:center;
    padding:0 0 14px 48px;font-size:14px;line-height:1.2;gap:1px;
  }
   .ui-data-list--compact-mobile>.ui-data-card .ui-data-title .ui-data-sub{
    font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
   .ui-data-list--compact-mobile>.ui-data-card :is(.ui-data-cell--quantity,.ui-data-cell--price,.ui-data-cell--deadline,.ui-data-cell--gain){
    display:grid !important;
    min-width:0;
    min-height:46px;
    padding:9px 10px;
    border-top:1px solid var(--border);
    border-left:0;
  }
   .ui-data-list--compact-mobile>.ui-data-card .ui-data-cell--quantity{grid-column:1;grid-row:2;margin-left:-10px;padding-left:20px;}
   .ui-data-list--compact-mobile>.ui-data-card .ui-data-cell--price{grid-column:2;grid-row:2;margin-right:-10px;padding-right:20px;border-left:1px solid var(--border);}
   .ui-data-list--compact-mobile>.ui-data-card .ui-data-cell--deadline{grid-column:1;grid-row:3;margin-left:-10px;padding-left:20px;}
   .ui-data-list--compact-mobile>.ui-data-card .ui-data-cell--gain{grid-column:2;grid-row:3;margin-right:-10px;padding-right:20px;border-left:1px solid var(--border);}
   .ui-data-list--compact-mobile>.ui-data-card>form,
   .ui-data-list--compact-mobile>.ui-data-card>.contract-actions,
   .ui-data-list--compact-mobile>.ui-data-card>.ui-panel__tools{
    display:block !important;
    grid-column:1 / -1;
    grid-row:4;
    width:auto;
    margin:0 -10px;
    padding:10px 10px 0;
    border-top:1px solid var(--border);
  }
   /* Livrer / Rendre : la carte coupee en deux, a parts egales. */
   .ui-data-list--compact-mobile>.ui-data-card>.contract-actions{display:grid !important;grid-template-columns:1fr 1fr;gap:8px;}
   .ui-data-list--compact-mobile>.ui-data-card>.contract-actions .ui-btn,
.ui-data-list--compact-mobile>.ui-data-card>form>.ui-btn,
.ui-data-list--compact-mobile>.ui-data-card>.ui-panel__tools>.ui-btn,
.ui-data-list--compact-mobile>.ui-data-card>.ui-panel__tools>form>.ui-btn{width:100%;min-height:38px;}
   .ui-data-list--compact-mobile>.ui-data-card>.ui-panel__tools{justify-content:stretch;}
   .ui-data-list--compact-mobile>.ui-data-card>span:empty{display:none;}
   .ui-data-list--compact-mobile>.ui-data-card :is(.ui-data-cell--quantity,.ui-data-cell--price,.ui-data-cell--deadline,.ui-data-cell--gain)>strong{
    overflow:visible;text-overflow:clip;white-space:normal;font-size:13px;
  }
}
/* Apparition / disparition des lignes de liste — consortium et contrats
   partagent list-sync.js, donc les memes classes et la meme duree. */
.ui-data-card.is-entering{animation:terravia-row-in .22s ease both;}
.ui-data-card.is-leaving{animation:terravia-row-out .22s ease both;pointer-events:none;}
[data-market-orders]{transition:opacity .16s ease;}
[data-market-orders].is-ui-syncing{opacity:.76;}
[data-market-orders].is-ui-synced{animation:terravia-list-settle .36s ease both;}
.value-increased{animation:terravia-value-up .52s ease both;}
.value-decreased{animation:terravia-value-down .52s ease both;}
@keyframes terravia-row-in{from{opacity:0;transform:translateY(-6px);}to{opacity:1;transform:none;}}
@keyframes terravia-row-out{from{opacity:1;transform:none;}to{opacity:0;transform:translateX(14px);}}
@keyframes terravia-list-settle{50%{box-shadow:inset 3px 0 var(--success);}to{box-shadow:none;}}
@keyframes terravia-value-up{45%{color:var(--success);transform:translateY(-1px) scale(1.06);}}
@keyframes terravia-value-down{45%{color:var(--danger);transform:translateY(1px) scale(1.06);}}
@media(prefers-reduced-motion:reduce){
  .ui-data-card.is-entering,.ui-data-card.is-leaving,[data-market-orders].is-ui-synced,.value-increased,.value-decreased{animation:none;}
  [data-market-orders]{transition:none;}
}

@media(max-width:520px){
   .ui-data-list--compact-mobile>.ui-data-card{padding:9px;}
   .ui-data-list--compact-mobile>.ui-data-card .resource-medal{width:34px;height:34px;margin-bottom:12px;font-size:18px;}
   .ui-data-list--compact-mobile>.ui-data-card .ui-data-title{padding:0 0 12px 42px;}
   .ui-data-list--compact-mobile>.ui-data-card :is(.ui-data-cell--quantity,.ui-data-cell--price,.ui-data-cell--deadline,.ui-data-cell--gain){padding:8px;}
   .ui-data-list--compact-mobile>.ui-data-card :is(.ui-data-cell--quantity,.ui-data-cell--deadline){margin-left:-9px;padding-left:17px;}
   .ui-data-list--compact-mobile>.ui-data-card :is(.ui-data-cell--price,.ui-data-cell--gain){margin-right:-9px;padding-right:17px;}
   .ui-data-list--compact-mobile>.ui-data-card>form,
   .ui-data-list--compact-mobile>.ui-data-card>.contract-actions,
   .ui-data-list--compact-mobile>.ui-data-card>.ui-panel__tools{margin:0 -9px;padding:9px 9px 0;}
}

/* Les actions des lots gardent la même largeur et le même alignement,
   qu'il s'agisse de prendre le lot ou de le livrer. */
.place-consortium .ui-data-list--table>.ui-data-card>.coop-tender-action{
  justify-content:flex-end;
}
.place-consortium .ui-data-list--table>.ui-data-card>.coop-tender-action>form{
  width:96px;
  margin:0 0 0 auto;
}
.place-consortium .ui-data-list--table>.ui-data-card>.coop-tender-action .ui-btn{
  width:96px;
  min-width:96px;
}

/* Contrats — information logistique centralisée dans l’en-tête */
.ui-data-cell--mystery strong{letter-spacing:.08em;}
/* Sur telephone on garde le rang, son multiplicateur, la barre et le palier
   suivant. Le debouche reste disponible dans « Voir les rangs ». */
@media(max-width:900px){
  .ui-game-content .rank-strip .rank-outlet{display:none;}
  .ui-game-content .rank-meta-row{grid-template-columns:minmax(0,1fr);}
  .ui-game-content .rank-meta-row>small{text-align:left;white-space:normal;}
}
/* Administration — la barre d'onglets devient un menu deroulant sur telephone,
   exactement comme les sections du consortium. */
.place-admin .admin-nav-select{display:none;}
@media(max-width:900px){
  .ui-game-content.place-admin .ui-panel__body>.admin-nav,
  .ui-game-content.place-admin>.ui-panel .admin-nav{display:block;}
  .ui-game-content.place-admin .admin-nav>.ui-btn{display:none;}
  /* .ui-toolbar>select impose 280px : on repasse devant avec le meme poids. */
  .place-admin .admin-nav>.admin-nav-select{display:block;width:100%;box-sizing:border-box;min-width:0;min-height:0;height:auto;padding:9px 30px 9px 12px;font:800 13px/1.2 var(--font-body);}
  /* La barre de recherche prend la meme largeur que le menu deroulant. */
  .place-admin .ui-panel__body>.ui-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;}
  .place-admin .ui-panel__body>.ui-toolbar>input[type="search"],
  .place-admin .ui-panel__body>.ui-toolbar>select,
  .place-admin .ui-panel__body>.ui-toolbar>.ui-btn{width:100%;min-width:0;max-width:none;box-sizing:border-box;margin:0;}
}

/* Administration — l'etat du monde reprend l'echelle typographique de l'accueil
   sur telephone : une carte par ligne, valeur a 14px, plus rien de tronque. */
@media(max-width:700px){
  /* Deux cartes par ligne : la valeur passe a la ligne plutot que d'etre coupee. */
  .place-admin .admin-world-panel .ui-metrics article{height:auto;min-height:46px;}
}

/* Administration — la liste des comptes passe en cartes sur telephone, sur le
   meme gabarit que les appels d'offres. */
@media(max-width:900px){
  .ui-table-grid--mobile-cards{
    overflow:visible;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    display:grid;
    gap:10px;
  }
  .ui-table-grid--mobile-cards>header{display:none;}
  .ui-table-grid--mobile-cards>article,
  .ui-table-grid--mobile-cards>article:nth-child(even){
    grid-template-columns:38px minmax(0,1fr);
    gap:0;
    min-height:0;
    padding:10px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--surface);
    overflow:hidden;
  }
  .ui-table-grid--mobile-cards>article>.ui-table-icon{
    grid-column:1;grid-row:1;align-self:center;margin:0 0 12px;
  }
  .ui-table-grid--mobile-cards>article>.ui-table-cell:first-of-type{
    grid-column:1 / -1;grid-row:1;align-self:center;padding:0 0 12px 48px;
  }
  .ui-table-grid--mobile-cards>article>.ui-table-cell:last-of-type{
    grid-column:1 / -1;grid-row:2;margin:0 -10px;padding:9px 10px;border-top:1px solid var(--border);
  }
  .ui-table-grid--mobile-cards>article>.ui-table-tag{
    grid-column:1 / -1;grid-row:3;justify-self:start;margin:10px 0 0;
  }
  .ui-table-grid--mobile-cards>article>.ui-btn{
    grid-column:1 / -1;grid-row:4;width:auto;margin:10px -10px 0;padding-top:10px;
    border-top:1px solid var(--border);border-radius:0;background:transparent;border-left:0;border-right:0;border-bottom:0;
    box-shadow:none;color:var(--accent-dark);min-height:0;
  }
  .ui-table-grid--mobile-cards>footer{
    padding:10px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);
  }
}

.place-forum .forum-crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 14px;padding:9px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface-2);color:var(--ink-mute);font:700 12px/1.4 var(--font-body);}
.place-forum .forum-crumbs a{color:var(--accent-dark);font-weight:800;text-decoration:none;}
.place-forum .forum-crumbs a:hover{color:var(--ink);text-decoration:underline;}
.place-forum .forum-crumbs>span[aria-hidden="true"]{color:var(--border-strong);font-size:16px;}
.place-forum .forum-crumbs strong{color:var(--ink);font-weight:800;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* Forum — le message est une carte « amélioration » passée en deux colonnes,
   avec la fiche d'identité du consortium comme colonne auteur. */
.place-forum .forum-post{grid-template-columns:minmax(0,250px) minmax(0,1fr);grid-template-rows:1fr auto auto;gap:0;padding:0;overflow:hidden;background:var(--surface);}
.place-forum .forum-post>.coop-identity-preview{grid-row:1 / -1;gap:9px;padding:18px 16px;}
.place-forum .coop-identity-emblem{width:60px;height:60px;border-radius:12px;font-size:30px;}
.place-forum .coop-identity-preview strong{font-size:15px;}
.place-forum .forum-author-role{padding:4px 9px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--accent-dark);font-size:11px;font-weight:900;text-transform:uppercase;}
.place-forum .forum-author-company{color:var(--ink-soft);font-size:12px;font-weight:800;overflow-wrap:anywhere;}
.place-forum .forum-author-stats{display:grid;width:100%;margin:6px 0 0;gap:0;text-align:left;}
.place-forum .forum-author-stats>div{display:grid;grid-template-columns:76px minmax(0,1fr);gap:8px;padding:7px 0;border-top:1px solid var(--border);}
.place-forum .forum-author-stats dt{color:var(--ink-mute);font-size:10px;font-weight:900;text-transform:uppercase;}
.place-forum .forum-author-stats dd{min-width:0;margin:0;color:var(--ink);font-size:11px;font-weight:800;overflow-wrap:anywhere;}
.place-forum .forum-post>.coop-upgrade-desc{padding:14px 14px 0;color:var(--ink);}
.place-forum .forum-post>.forum-post-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:auto 14px 12px;padding-top:10px;border-top:1px dashed var(--border-strong);}
.place-forum .forum-post-footer time{color:var(--ink-mute);font-size:10px;font-weight:800;}
.place-forum .forum-post-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px;margin-left:auto;}
.place-forum .forum-thread>header .ui-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;}
.place-forum .forum-post>form{grid-column:2;padding:0 14px 12px;}

.place-consortium .coop-member-contribution{display:block;margin-top:4px;color:var(--accent-dark);font-weight:900;}

.place-consortium .coop-cash-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px}
.place-consortium .coop-cash-row .coop-cash-metric{min-width:0;margin:0}
.place-consortium .coop-cash-row>.ui-btn{min-height:34px;padding:0 14px}
.place-consortium .coop-upgrade-register{margin:14px;border:1px solid var(--border);border-radius:8px;overflow:hidden}
.place-consortium .coop-upgrade-register>header,
.place-consortium .coop-upgrade-register>article{grid-template-columns:42px minmax(190px,1.3fr) minmax(130px,.75fr) minmax(150px,.8fr) 190px}
.place-consortium .coop-upgrade-register>.coop-upgrade{display:grid;grid-template-rows:none;gap:10px;padding:11px 14px;border:0;border-top:1px solid var(--border);border-radius:0;background:transparent;opacity:1}
.place-consortium .coop-upgrade-register>.coop-upgrade.is-maxed{background:var(--surface-2);opacity:.75}
.place-consortium .coop-upgrade-progress{display:grid;gap:6px}
.place-consortium .coop-upgrade-progress>b{font:900 11px/1 var(--font-body)}
.place-consortium .coop-upgrade-progress>span{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px}
.place-consortium .coop-upgrade-progress i{display:block;height:6px;border:1px solid var(--border);border-radius:999px;background:var(--surface)}
.place-consortium .coop-upgrade-progress i.is-on{border-color:var(--accent-dark);background:var(--accent)}
.place-consortium .coop-upgrade-action{display:flex;justify-content:flex-end}
.place-consortium .coop-upgrade-action form{margin:0}
.place-consortium .coop-concession-grid{grid-template-columns:repeat(auto-fill,minmax(150px,178px));justify-content:start;padding:14px}
.place-consortium .coop-concession-grid .mine-site__scene{aspect-ratio:178/520}
.place-consortium .coop-concession-grid .mine-site__head{width:calc(100% - 12px)}
.place-consortium .coop-concession-grid .mine-site__head b{overflow:hidden;max-width:100%;text-overflow:ellipsis}
.place-consortium .coop-concession-grid .mine-site__head em{font-size:9px}
.place-consortium .coop-concession-grid .ui-modal-footer form{margin:0}
@media(max-width:800px){
  .place-consortium .coop-cash-row{grid-template-columns:1fr}
  .place-consortium .coop-cash-row>.ui-btn{justify-self:end}
  .place-consortium .coop-upgrade-register>header{display:none}
  .place-consortium .coop-upgrade-register>article{grid-template-columns:38px minmax(0,1fr) auto}
  .place-consortium .coop-upgrade-register>article>.ui-table-cell:nth-of-type(2),.place-consortium .coop-upgrade-progress,.place-consortium .coop-upgrade-action{grid-column:2/-1}
}

/* Éditeur de message : la barre d'émoticônes posée sur le champ. */
.forum-editor{overflow:hidden;border:1px solid var(--border-strong);border-radius:10px;background:var(--surface);}
.forum-editor-tools{display:flex;flex-wrap:wrap;gap:1px;padding:5px 6px;border-bottom:1px solid var(--border);background:var(--surface-2);}
.forum-emoji-key{padding:3px 5px;border:0;border-radius:6px;background:transparent;font-size:16px;line-height:1.1;cursor:pointer;}
.forum-emoji-key:hover{background:var(--accent-soft);}
.forum-emoji-picker{position:relative;margin-left:auto;}
.forum-emoji-picker>summary{display:grid;place-items:center;min-width:28px;min-height:24px;border-radius:6px;cursor:pointer;list-style:none;}
.forum-emoji-picker>summary::-webkit-details-marker{display:none;}
.forum-emoji-menu{position:absolute;z-index:10;top:calc(100% + 6px);right:0;display:grid;grid-template-columns:repeat(6,28px);gap:2px;padding:6px;border:1px solid var(--border);border-radius:8px;background:var(--surface);box-shadow:var(--shadow);}
body .ui-game .forum-editor textarea,body .ui-game .ui-modal .forum-editor textarea{display:block;width:100%;box-sizing:border-box;min-height:0;padding:10px 12px;border:0;border-radius:0;background:var(--surface);color:var(--ink);font:600 13px/1.55 var(--font-body);resize:vertical;outline:none;}
.forum-topic-form>.forum-editor{margin-top:12px;}
.forum-editor-count{display:block;padding:6px 10px;border-top:1px solid var(--border);background:var(--surface-2);color:var(--ink-mute);font:700 11px/1.3 var(--font-body);text-align:right;}
.forum-editor-count strong{color:var(--ink);font:inherit;}

@media(max-width:900px){
  .place-forum .forum-post{grid-template-columns:1fr;}
  .place-forum .forum-post>.coop-identity-preview{grid-row:auto;grid-template-columns:44px minmax(0,1fr);justify-items:start;text-align:left;gap:2px 10px;padding:12px 14px;border-right:0;border-bottom:2px dashed var(--border-strong);}
  .place-forum .forum-post>.coop-identity-preview .coop-identity-emblem{grid-row:1 / 3;width:44px;height:44px;font-size:22px;}
  .place-forum .forum-post>.coop-identity-preview .forum-author-role,.place-forum .forum-post>.coop-identity-preview .forum-author-company{grid-column:2;}
  .place-forum .forum-post>.coop-identity-preview .forum-author-stats{grid-column:1 / -1;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px;margin-top:8px;}
  .place-forum .forum-post>form{grid-column:1;}
}
@media(max-width:600px){
  .ui-panel--mobile-quad-actions>header{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;gap:10px;}
  .ui-panel--mobile-quad-actions>header>h1{grid-column:1 / 3;grid-row:1;}
  .ui-panel--mobile-quad-actions>header>.ui-panel__tools{display:contents;}
  .ui-panel--mobile-quad-actions>header>.ui-panel__tools>.ui-badge{grid-column:3 / 5;grid-row:1;justify-self:end;width:max-content;white-space:nowrap;}
  .ui-panel--mobile-quad-actions>header>.ui-panel__tools>.ui-btn{grid-row:2;width:100%;min-width:0;margin-bottom:12px;padding-inline:8px;}
  .ui-panel--mobile-quad-actions>header .ui-action-label{display:none;}

  .ui-panel--mobile-split-actions>header{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:center;gap:10px;}
  .ui-panel--mobile-split-actions>header>h1{grid-column:1;grid-row:1;}
  .ui-panel--mobile-split-actions>header>.ui-panel__tools{display:contents;}
  .ui-panel--mobile-split-actions>header>.ui-panel__tools>.ui-badge{grid-column:2;grid-row:1;justify-self:end;white-space:nowrap;}
  .ui-panel--mobile-split-actions>header>.ui-panel__tools>.ui-btn{grid-row:2;width:100%;margin-bottom:8px;}
}
/* Les actions d'une ligne d'administration tiennent sur une seule ligne. */
.ui-table-grid .ui-actions{flex-wrap:nowrap;gap:6px;}

/* Le « par page » est un select de la barre comme les autres : seule
   sa largeur minimale saute, il n'a pas besoin des 240px des filtres. */
.ui-game-content .ui-panel__body > .ui-actionbar select[data-plot-per-page]{
  min-width: 0;
}

/* Fiche joueur : les deux registres d'actions tiennent cote a cote,
   en lignes serrees — une action n'a pas besoin de 62px de haut. */
.place-admin .admin-actions{
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(330px,1fr));
  align-items: start;
  gap: 10px;
}

.place-admin .admin-actions .ui-table-grid>article{
  min-height: 0;
}

/* Chat WebSocket V5 : statut temps reel, apercu et non-lus par salon */
section.ui-chat[data-chat] .farm-chat-heading{display:grid;grid-template-columns:minmax(0,1fr);gap:0;min-width:0}
section.ui-chat[data-chat] .farm-chat-connection{display:inline-flex;align-items:center;gap:5px;margin:-8px 0 0 37px;font-size:8px;font-weight:800;color:var(--ink-mute);white-space:nowrap}
section.ui-chat[data-chat] .farm-chat-connection::before{content:"";width:6px;height:6px;border-radius:50%;background:#a4a4a4;box-shadow:0 0 0 2px rgba(0,0,0,.05)}
section.ui-chat[data-chat] .farm-chat-connection[data-state="online"]::before{background:#4e9f62}
section.ui-chat[data-chat] .farm-chat-connection[data-state="connecting"]::before{background:#d8a53b}
section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms] button.has-unread{font-weight:900}
section.ui-chat[data-chat] .farm-chat-room-unread{position:absolute;top:5px;right:6px;display:grid;place-items:center;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:var(--accent,#b96b36);color:#fff;font-size:8px;line-height:1}

/* Chat V7 — moderation temps reel */
.ui-form-row :is(input,select):disabled,
.ui-btn:disabled,
.ui-btn[disabled],
section.ui-chat[data-chat] .farm-chat-form :disabled{opacity:.55;cursor:not-allowed}
section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms] button{
  position:relative;grid-template-rows:1fr}
section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms] button small{
  grid-column:2;
  color:var(--ink-mute);
  font-size:8px;
  letter-spacing:.04em;
  padding-right:20px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;display:none!important}

/* Chat V8 — etats compacts + indicateur de saisie */
section.ui-chat[data-chat] .farm-chat-thread{
  position:static;
  grid-template-rows:minmax(0,1fr) auto;
  min-width:0;
  background:var(--surface);min-height:0;display:flex;flex-direction:column}
section.ui-chat[data-chat] .farm-chat-messages{
  overflow-y:auto;
  background:var(--surface);
  padding:18px 22px;
  gap:1px;flex:1 1 auto;min-height:0}
section.ui-chat[data-chat] .farm-chat-muted{
  border-bottom:1px solid var(--border);flex:0 0 auto!important;height:auto!important;min-height:0!important;margin:6px 10px;padding:7px 10px;border:1px solid rgba(185,107,54,.28);border-radius:8px;background:rgba(185,107,54,.09);font-size:10px;font-weight:800;line-height:1.25;color:var(--ink)}
section.ui-chat[data-chat] .farm-chat-muted[hidden]{display:none!important}
section.ui-chat[data-chat] .farm-chat-typing{flex:0 0 auto;min-height:20px;padding:3px 12px 1px;color:var(--ink-soft,#6f746d);font-size:10px;font-weight:800;font-style:italic;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
section.ui-chat[data-chat] .farm-chat-typing[hidden]{display:none!important}
section.ui-chat[data-chat] .farm-chat-form input:disabled{opacity:.65;cursor:not-allowed;background:var(--surface-2,#ece9df)}
section.ui-chat[data-chat] .farm-chat-form button:disabled{opacity:.45;cursor:not-allowed}

/* Chat mobile et tablette : panneau plein écran, salon en haut et saisie en bas. */
@media(max-width:900px){
  section.ui-chat[data-chat]:has(.farm-chat-panel:not([hidden])){
    inset:0;
    z-index:80;
    width:100%;
    height:100dvh;
  }
  section.ui-chat[data-chat] .farm-chat-panel{
    position:fixed;
    inset:0;
    z-index:80;
    display:grid;
    grid-template-rows:auto minmax(0,1fr);
    width:100vw;
    max-width:none;
    height:100dvh;
    min-height:100dvh;
    max-height:none;
    box-sizing:border-box;
    border:0;
    border-radius:0;
  }
  section.ui-chat[data-chat] .farm-chat-panel>header{
    min-height:48px;
    padding:10px 12px;
    padding-top:max(10px,env(safe-area-inset-top));
  }
  section.ui-chat[data-chat] .ui-chat-body{
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto minmax(0,1fr);
    height:auto;
  }
  section.ui-chat[data-chat] .farm-chat-rooms{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    padding:10px 12px;
    border:0;
    border-bottom:1px solid var(--border);
  }
  section.ui-chat[data-chat] .farm-chat-room-select{
    display:block;
    width:100%;
    min-width:0;
    min-height:36px;
    height:36px;
    padding:0 30px 0 10px;
    font-size:13px;
    line-height:normal;
  }
  section.ui-chat[data-chat] .farm-chat-rooms [data-chat-rooms],
  section.ui-chat[data-chat] .farm-chat-bans{
    display:none!important;
  }
  /* Boutons du chat à la hauteur des champs (36 px) : DM et Envoyer compacts. */
  section.ui-chat[data-chat] :is(.farm-chat-dm-open,.farm-chat-form>button){
    width:auto;
    min-width:0;
    min-height:36px;
    height:36px;
    margin:0;
    padding:0 14px;
    font-size:12px;
  }
  section.ui-chat[data-chat] .farm-chat-thread{
    min-height:0;
    overflow:hidden;
  }
  section.ui-chat[data-chat] .farm-chat-messages{
    padding:12px;
    overscroll-behavior:contain;
  }
  section.ui-chat[data-chat] .farm-chat-form{
    grid-template-columns:36px minmax(0,1fr) auto;
    gap:8px;
    padding:10px 12px max(10px,env(safe-area-inset-bottom));
  }
  section.ui-chat[data-chat] .farm-chat-emoji:not([hidden]){display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;max-height:180px;overflow:auto}
  section.ui-chat[data-chat] .farm-chat-form>.farm-chat-emoji-toggle{width:36px;min-width:36px;height:36px;min-height:36px;padding:0;border:1px solid var(--border-strong);background:var(--surface-2);font-size:16px}
  section.ui-chat[data-chat] .farm-chat-form input{
    width:100%;
    min-height:36px;
    height:36px;
  }
}

/* Administration — Quiz & concours */

/* Quiz : banque /question, dans les composants admin existants. */
.place-admin-quiz .quiz-bank-panel{margin-top:18px}

/* Quiz v3 — concours programmés + banque éditable */

.place-admin-quiz :is(.quiz-contest-table,.quiz-bank-table){overflow-x:auto;}
.place-admin-quiz .quiz-contest-table>:is(header,article){min-width:720px;}
.place-admin-quiz .quiz-bank-table>:is(header,article){min-width:860px;padding:7px 10px;}
.place-admin-quiz .quiz-bank-table>article{min-height:48px;}
.place-admin-quiz .quiz-bank-table .ui-actions{display:flex;flex-wrap:nowrap;justify-content:flex-end;gap:6px;}
.place-admin-quiz .quiz-bank-table .ui-actions>.ui-btn{flex:1 1 0;min-width:0;padding-inline:8px;}
.place-admin-quiz .quiz-bank-table>.history-pagination{display:grid;grid-template-columns:1fr auto 1fr;min-width:860px;box-sizing:border-box;}
.place-admin-quiz [data-bank-dialog] textarea{padding:10px 13px;line-height:1.4;}
.place-admin-forum .ui-table-grid .ui-actions{display:flex;flex-wrap:nowrap;gap:6px;}
body .ui-game .role-modal .role-permissions-separator,
.place-admin-forum .forum-category-separator{margin-top:14px;border-top:2px dashed var(--border-strong);}
.place-admin-forum .forum-category-fields{padding-top:12px;border-top:0;}
.place-admin-forum .forum-category-fields>.ui-field{margin-top:0;}
.place-admin-forum .forum-category-options{grid-column:1 / -1;display:grid;gap:10px;}

/* HUD — état global temporaire, même composant que trésorerie/météo */

/* Modale R&D : tous les blocs se calent sur la gouttiere de l'en-tete, et la
   rangee de metriques se divise par le nombre de tuiles qu'elle contient. */
.place-research [data-research-inspector]{
  padding:0 var(--modal-pad) 4px;
}

body .ui-game .ui-modal [data-research-inspector] :is(.ui-status,.ui-metrics,.ui-equipment-list,.ui-toolbar,.ui-modal-section){
  margin-inline:0;
}

.place-research .ui-metrics{
  grid-template-columns:none;
  grid-auto-flow:column;
  grid-auto-columns:minmax(0,1fr);
}

/* Notifications persistantes du joueur. */
.ui-notifications{position:relative;align-self:center;z-index:35}
.ui-game .ui-game-hud{overflow:visible}
.ui-notifications__toggle b{position:absolute;right:-5px;top:-6px;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:#bf432f;color:#fff;font-size:10px;line-height:19px}
.ui-notifications__panel{position:absolute;right:0;top:calc(100% + 8px);width:min(400px,calc(100vw - 24px));max-height:min(520px,70vh);overflow:hidden;border:1px solid var(--shell-border);border-radius:var(--radius-lg);background:#1a221e;color:#f1ece3;box-shadow:0 16px 38px rgba(0,0,0,.5);opacity:1}
.ui-game .ui-notifications__panel,.ui-game .ui-notifications__panel *{opacity:1!important;text-shadow:none!important;-webkit-text-fill-color:currentColor!important}
.ui-game .ui-notifications__panel.ui-panel{background:#1a221e;backdrop-filter:none}
.ui-notifications__panel>header .ui-btn{border:1px solid var(--shell-border);background:#29332e;color:#e8ebe5!important;box-shadow:none}
.ui-notifications__panel>header .ui-btn:hover{background:#34403a}
.ui-notifications__panel>header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--shell-border);background:#222b26}
.ui-game .ui-notifications__panel h3{margin:0;color:#f1ece3!important;font-size:15px;font-weight:900;opacity:1!important}
.ui-notifications__list{max-height:430px;overflow:auto;background:transparent;color:#f1ece3;opacity:1}
.ui-notifications__item{position:relative;display:block;min-height:62px;padding:11px 14px 11px 19px;border-top:1px solid rgba(255,255,255,.06);background:transparent;color:#f1ece3!important;text-decoration:none;opacity:1!important;filter:none!important;transition:background .15s}
.ui-notifications__item:first-child{border-top:0}
.ui-notifications__item::before{content:"";position:absolute;left:7px;top:13px;bottom:13px;width:4px;border-radius:3px;background:#5d9ad1}
.ui-notifications__item.is-success::before{background:#6fbf73}
.ui-notifications__item.is-warning::before{background:#e8b64a}
.ui-notifications__item.is-error::before{background:#e27a60}
.ui-notifications__item.is-unread{background:rgba(197,138,85,.08)}
.ui-notifications__item:hover{background:rgba(255,255,255,.05)}
.ui-notifications__item>div{display:flex;gap:10px;align-items:baseline;justify-content:space-between}
.ui-game .ui-notifications__item strong{color:#f6efe3!important;font-size:13px;font-weight:800;opacity:1!important}
.ui-game .ui-notifications__item time{color:#9aa59e!important;font-size:11px;font-weight:700;white-space:nowrap;opacity:1!important}
.ui-game .ui-notifications__item p{margin:4px 0 0;color:#c3cbc5!important;font-size:12px;font-weight:600;line-height:1.4;opacity:1!important}
.ui-game .ui-notifications__empty{margin:0;padding:18px;color:#9aa59e!important;font-size:13px;font-weight:700;text-align:center;opacity:1!important}
@media(max-width:760px){
  .ui-game .ui-game-hud{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    column-gap:8px;
  }
  .ui-game .ui-game-logo{
    grid-column:1 / -1;
    grid-row:1;
    justify-self:center;
  }
  .ui-game .player-rank{
  margin-left:auto;
  border-left:0;
    display:none;
  }
  .ui-notifications{
    position:absolute;
    right:10px;
    top:8px;
  }
  .ui-notifications__toggle{
    width:46px;
    height:46px;
  }
  .ui-game-menu{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:46px;
  margin:8px 10px;
  padding:0 13px;
  box-sizing:border-box;
  border:1px solid var(--shell-border);
  border-radius:var(--radius);
  background:var(--shell-raised);
  color:var(--surface-sunken);
  font:900 12px/1 var(--font-body);
  cursor:pointer;
    width:calc(100% - 76px);
    margin-right:66px;
  }
  .ui-notifications__panel{
    position:absolute;
    top:calc(100% + 8px);
    right:0;
  }
  .ui-game .ui-game-footer{
    flex-direction:row;
    flex-wrap:nowrap;
    align-items:flex-start;
  }
  .ui-game .ui-game-footer .foot-brand{
    flex:0 0 105px;
    align-self:stretch;
    align-items:center;
    justify-content:center;
    text-align:center;
  }
  .ui-game .ui-game-footer .foot-links{
    flex:1 1 auto;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    width:auto;
    margin-left:0;
  }
  .ui-game .ui-game-footer .foot-links a{
    width:100%;
    min-width:0;
    box-sizing:border-box;
  }
}
.extraction-offer form,
.place-admin .admin-settings-actions{display:flex;justify-content:flex-end}

/* Centre de support. */
.support-form{display:grid;gap:12px;width:100%}
.support-form-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(180px,1fr);gap:12px}
.support-form-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}
.support-status--open{border-color:#d39a43;color:#8a560d}.support-status--in_progress{border-color:#4f8bc2;color:#285f91}.support-status--waiting_user{border-color:#9a7ac0;color:#68458f}.support-status--resolved{border-color:#5b9b68;color:#32713f}.support-status--closed{opacity:.65}
.place-research .coop-upgrade-cost.is-malus,
.support-priority--urgent{border-color:var(--negative);color:var(--negative)}.support-priority--high{border-color:#d17845;color:#9d4b1d}.support-priority--low{opacity:.7}
.support-management-form{display:flex;align-items:center;justify-content:flex-end;gap:10px}
.support-management-form select{flex:0 1 220px;width:220px;height:40px;min-height:40px}
.support-management-form select:first-of-type{flex-basis:280px;width:280px}
.support-section{margin-top:16px;padding-top:14px;border-top:1px dashed var(--border-strong)}
.support-section--first{margin-top:0;padding-top:0;border-top:0}
.support-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.fleet-card>header h3,
.support-section-title h2{margin:0;font-size:14px}.support-section-title span{color:var(--ink-mute);font-size:11px;font-weight:800}
.support-timeline{position:relative;display:grid;gap:12px;padding-left:42px}
.support-timeline:before{content:"";position:absolute;left:18px;top:20px;bottom:20px;width:2px;background:var(--border)}
.support-message{position:relative;min-width:0}
.support-message>i{position:absolute;z-index:1;left:-42px;top:8px;display:grid;place-items:center;width:36px;height:36px;border:2px solid var(--border-strong);border-radius:50%;background:var(--surface-2);color:var(--ink);font-style:normal;font-size:12px;font-weight:900}
.support-message>div{overflow:hidden;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}
.support-message header{display:flex;align-items:center;gap:8px;padding:8px 11px;border-bottom:1px solid var(--border);background:var(--surface-2)}
.support-message header time{margin-left:auto;color:var(--ink-mute);font-size:10px;font-weight:700}
.support-message p{margin:0;padding:11px;line-height:1.5;white-space:normal}
.support-filters{margin-top:12px}.support-filters select{min-width:280px;height:40px}
.support-table{margin-top:12px}
.support-assignment-note{margin:16px 0 0;padding-top:14px;border-top:1px dashed var(--border-strong);color:var(--ink-mute);font-size:11px;font-weight:800}
.place-support textarea,.place-support-ticket textarea{box-sizing:border-box;width:100%;padding:11px 13px;line-height:1.5}
.support-reply form{display:grid;gap:10px}
body .ui-game-content.place-factory .ui-panel__body>.factory-bulk-bar,
body .ui-game-content.place-farmyard .ui-panel__body>.crop-bulk-bar{min-height:0;margin:0;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.ui-game-content.place-factory .factory-bulk-bar select[data-factory-per-page]{min-width:0}
body .ui-game-content.place-factory>.ui-panel:first-of-type>.ui-panel__body,
body .ui-game-content.place-farmyard>.ui-panel:first-of-type>.ui-panel__body{display:grid;row-gap:10px}
.place-factory .factory-bulk-bar .factory-bulk-cost{display:none}
.place-factory .factory-bulk-bar [data-factory-recipe]{min-width:260px}

/* Le module pose filtres, cases et pagination avant le premier affichage. */
.client-ui [data-client-paginated]:not([data-client-ready]){display:none!important}
.client-ui [data-client-region]:not([data-client-ready]){position:relative;min-height:220px;overflow:hidden;pointer-events:none}
.client-ui [data-client-region]:not([data-client-ready])>*{opacity:.38;filter:blur(2px)}
.client-ui [data-client-region]:not([data-client-ready])::after{content:"Préparation de la liste…";position:absolute;inset:56px 0 0;display:grid;place-items:center;color:var(--ink-mute);font-size:12px;font-weight:800}
.client-ui [data-client-region][data-client-ready]>*{animation:client-list-ready .14s ease-out both}
@keyframes client-list-ready{from{opacity:.72}to{opacity:1}}
@media(max-width:760px){
  .support-form-grid{grid-template-columns:1fr}.support-management-form select,.support-management-form .ui-btn{width:100%}
  .ui-game-content .upkeep-notice>header,
.support-management-form,
.support-form-actions{align-items:stretch;flex-direction:column}
  .support-timeline{padding-left:34px}.support-timeline:before{left:14px}.support-message>i{left:-34px;width:28px;height:28px}
  .support-message header{flex-wrap:wrap}.support-message header time{width:100%;margin-left:0}
}

/* Contrôle du marché : défi anti-robot de l'inscription. */
.registration-honeypot{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;overflow:hidden!important}
.ui-auth-shell .registration-challenge{display:grid;gap:8px;margin:0;padding:10px;border:1px solid var(--border);border-radius:8px;background:var(--surface-2)}
.ui-auth-shell .registration-challenge legend{display:flex;align-items:baseline;gap:7px;padding:0 5px;color:var(--ink)}
.support-message header span,
.ui-auth-shell .registration-challenge legend span{font-size:9px;font-weight:900;text-transform:uppercase;color:var(--ink-mute)}
.ui-auth-shell .registration-challenge legend strong{font-size:12px;font-weight:900}
.registration-challenge-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
.ui-auth-shell .registration-challenge-grid label{position:relative;display:grid;place-items:center;gap:2px;min-width:0;height:58px;margin:0;padding:5px 2px;border:1px solid var(--border-strong);border-radius:7px;background:var(--surface);cursor:pointer}
.ui-auth-shell .registration-challenge-grid input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.ui-auth-shell .registration-challenge-grid span{font-size:23px;line-height:1}
.ui-auth-shell .registration-challenge-grid em{max-width:100%;overflow:hidden;color:var(--ink-soft);font-size:8px;font-style:normal;font-weight:800;text-overflow:ellipsis;white-space:nowrap}
.ui-auth-shell .registration-challenge-grid label:has(input:checked){border-color:var(--accent-dark);background:var(--accent-soft);box-shadow:0 0 0 1px var(--accent-dark)}
.ui-auth-shell .registration-challenge-grid label:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
.ui-auth-shell .registration-challenge-grid label:has(input:checked)::after{content:"✓";position:absolute;right:3px;top:2px;color:var(--positive-dark);font-size:10px;font-weight:900}
.ui-auth-shell .registration-challenge>small[data-error]{min-height:12px;margin:0}
@media(max-width:520px){.registration-challenge-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.ui-auth-shell .registration-challenge-grid label{height:52px}}

/* Navigation principale : rail de gestion canonique. */
.ui-game-workspace{min-width:0;background:var(--surface-2)}
.ui-game-sidebar__brand{position:relative;display:grid;place-items:center;height:92px;padding:10px 18px;border-bottom:1px solid var(--shell-border)}
.ui-game-sidebar .ui-game-logo{justify-content:center;min-width:0;width:100%}
.ui-game-sidebar .player-rank{flex:0 0 auto;gap:11px;margin:12px;padding:12px;border:1px solid var(--shell-border);border-left:3px solid var(--accent);border-radius:7px;background:var(--shell-raised);color:#fff}
.ui-game-sidebar .player-rank>span{width:38px;height:38px;border:2px solid #d8cabb;background:var(--accent)}
.ui-game-sidebar .player-rank small{overflow:hidden;color:#c9d0cb;text-overflow:ellipsis;white-space:nowrap}
.ui-game-sidebar .player-rank strong{overflow:hidden;color:#fff;text-overflow:ellipsis;white-space:nowrap}
.ui-game-sidebar .player-rank i{background:#111915}
.ui-game-sidebar .ui-game-nav-group:first-child{border-top:0}
.ui-game-sidebar .ui-game-nav-group h2{margin:0;padding:3px 10px 5px;color:#89968f;font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}
.ui-game-nav__utility{display:grid;gap:3px;margin-top:auto;padding-top:9px;border-top:1px solid rgba(255,255,255,.09)}
.ui-game-sidebar__backdrop{display:none}
.ui-game-workspace>.ui-game-hud{box-sizing:border-box;justify-content:flex-end}
.ui-game-workspace>.ui-game-hud .ui-game-menu{display:none}
.ui-game-workspace .ui-game-stage{min-height:calc(100vh - 72px)}

@media(max-width:1350px){
  .ui-game-shell{grid-template-columns:218px minmax(0,1fr)}
  .ui-game-sidebar{width:218px}
  .ui-game-workspace>.ui-game-hud{height:auto;min-height:72px;flex-wrap:nowrap;padding-block:9px}
}

@media(max-width:900px){
  body.game-nav-open{overflow:hidden}
  body.game-nav-open .ui-game-sidebar__backdrop{display:block}
  .ui-game-workspace>.ui-game-hud{gap:8px}
  .ui-game-workspace>.ui-game-hud .ui-game-menu{display:flex;flex:0 0 auto;align-items:center;gap:8px;width:auto;min-height:42px;margin:0;padding:0 12px;border:1px solid var(--shell-border);border-radius:6px;background:var(--shell-raised);color:#fff}
  .ui-game-workspace>.ui-game-hud .ui-game-menu strong{font-size:11px}
  .ui-game-workspace>.ui-game-hud .ui-notifications{position:static;flex:0 0 auto}
  .ui-game-workspace>.ui-game-hud .ui-notifications__toggle{width:42px;height:42px}
  .ui-game-workspace .ui-game-stage{min-height:calc(100vh - 66px)}
}

@media(max-width:600px){
  .ui-game-workspace>.ui-game-hud{flex-wrap:wrap}
  .ui-game-workspace>.ui-game-hud .ui-game-menu{margin-right:auto}
}

@media(prefers-reduced-motion:reduce){.ui-game-sidebar{transition:none}}

/* Carte joueur et verrouillage du rail face aux anciens styles horizontaux. */
.ui-game-sidebar #game-navigation{display:flex!important;visibility:visible!important;opacity:1!important;position:static!important;transform:none!important;min-height:0!important}
.ui-game-sidebar .ui-game-nav-group{
  gap:2px;
  margin:0;
  padding:8px 0;
  border-top:1px solid rgba(255,255,255,.07);display:grid!important;position:static!important;visibility:visible!important;opacity:1!important;width:100%!important;min-height:max-content!important}
.ui-game-sidebar .ui-game-nav-group>a{display:flex!important;visibility:visible!important;opacity:1!important}
.ui-game-sidebar .ui-player-card .player-rank em{grid-row:3;width:auto;height:auto;margin:0;background:none;color:#d5a36f;font-size:10px;font-style:normal;font-weight:900;line-height:1.2}
.ui-game-sidebar .ui-player-card .player-rank i{grid-row:4;height:5px;margin-top:4px;background:#111915}
.ui-game-sidebar .ui-player-card .player-rank i>b{display:block;height:100%;border-radius:4px;background:var(--accent)}
.ui-player-card__stats>div>span{flex:0 0 auto;font-size:13px}
.ui-player-card__stats p{display:grid;gap:3px;margin:0;min-width:0}
.ui-player-card__stats small{color:#94a098;font-size:8px;font-weight:900;text-transform:uppercase}
.ui-player-card__stats strong{overflow:hidden;color:#fff;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.ui-player-card>.ui-notifications{display:flex;align-items:center;width:100%;padding:7px 10px;box-sizing:border-box;border-top:1px solid #414b45}
.ui-player-card>.ui-notifications::after{content:"Notifications";margin-left:9px;color:#c1cac4;font-size:9px;font-weight:900;text-transform:uppercase}
.ui-player-card>.ui-notifications .ui-notifications__toggle{width:32px;height:32px;border-color:#4b574f;background:#202924;color:#fff;font-size:14px}
.ui-player-card>.ui-notifications .ui-notifications__panel{left:calc(100% + 12px);right:auto;top:auto;bottom:0}
.ui-game-workspace>.ui-game-hud{display:none;height:0;min-height:0;padding:0}
.ui-game-workspace>.ui-game-stage{min-height:100vh}
.ui-game-workspace .ui-game-inventory{height:100vh;top:0}

@media(min-width:901px){
  .ui-game-workspace>.ui-game-hud{display:none}
}

@media(max-width:900px){
  .ui-game-sidebar #game-navigation{display:flex!important}
  .ui-game-sidebar:not(.is-mobile-open){transform:translateX(-102%)!important}
  .ui-game-sidebar.is-mobile-open{transform:translateX(0)!important}
  .ui-game-workspace>.ui-game-hud{display:flex;height:58px;min-height:58px;padding:8px 10px;flex-wrap:nowrap}
  .ui-game-workspace>.ui-game-stage{min-height:calc(100vh - 58px)}
  .ui-player-card>.ui-notifications .ui-notifications__panel{position:fixed;left:12px;right:12px;top:74px;bottom:auto;width:auto}
}

/* Rail v2 : composant independant de l'ancienne navigation horizontale. */
.ui-game-shell{
  display:grid;
  min-height:100vh;
  background:var(--shell);grid-template-columns:260px minmax(0,1fr)}
.ui-side-nav{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;padding:0 14px 14px;overflow-y:auto;visibility:visible;opacity:1}
.ui-side-nav .ui-game-nav-group{display:grid;gap:3px;padding:10px 0;border-top:1px solid rgba(255,255,255,.08)}
.ui-side-nav .ui-game-nav-group h2{margin:0;padding:2px 10px 6px;color:#8d9a92;font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}
.ui-side-nav .ui-game-nav-group a,.ui-side-nav .ui-game-nav__utility>a,.ui-side-nav .ui-game-nav-logout{display:flex;align-items:center;gap:10px;width:100%;height:38px;padding:0 10px;box-sizing:border-box;border:0;border-radius:6px;background:transparent;color:#dbe1dd;font-size:12px;font-weight:800;text-align:left}
.ui-side-nav a.active,.ui-side-nav a[aria-current="page"]{background:var(--accent);color:#fff;box-shadow:inset 3px 0 var(--negative)}
.ui-side-nav .ui-game-nav__utility{display:grid;gap:3px;margin-top:auto;padding-top:10px;border-top:1px solid rgba(255,255,255,.09)}
.ui-side-nav .ui-game-nav-logout{cursor:pointer;color:#b8c1bb}
.ui-side-nav .ui-game-nav-admin{color:#f1d6ba}

.ui-player-card{
  flex:0 0 auto;
  border-left:3px solid var(--accent);margin:14px;border:1px solid var(--shell-border);border-radius:8px;background:var(--shell-raised);color:var(--shell-ink);box-shadow:none;overflow:hidden}
.ui-game-sidebar .ui-player-card .player-rank small{
  grid-row:1;
  font-weight:700;color:#8d9a92;font-size:9px}
.ui-player-card__stats{
  grid-template-columns:1fr 1fr;display:block;margin:0;border-top:1px solid var(--shell-border);border-bottom:0;background:transparent}
.ui-player-card__stats>div{
  gap:6px;
  min-width:0;display:flex;align-items:center;justify-content:space-between;min-height:34px;padding:0 12px;border-bottom:1px solid var(--shell-border)}
.ui-player-card__stats dt{display:flex;align-items:center;margin:0;color:#8d9a92;font-size:8px;font-weight:900;text-transform:uppercase}
.ui-player-card__stats dt span{margin-right:5px;font-size:11px}
.ui-player-card__stats dt p{margin:0}.ui-player-card__stats dt small{font:inherit}
.ui-player-card__stats dd{margin:0;color:#fff;font-size:11px;font-weight:900}
.ui-player-card__world p{
  min-width:0;display:grid;gap:2px;margin:0}

@media(max-width:1350px) and (min-width:901px){.ui-game-shell{grid-template-columns:240px minmax(0,1fr)}.ui-game-sidebar{width:240px}}
@media(max-width:900px){
  .ui-game-shell{display:block}
  .ui-side-nav{display:flex!important}
}

/* Acces secondaires du rail. */
.ui-player-card__stats>div+div{border-left:0}
.ui-game-sidebar{
  position:sticky;
  top:0;
  display:flex;
  flex-direction:column;
  height:100vh;
  box-sizing:border-box;
  background:#202a25;
  border-right:1px solid var(--shell-border);
  color:var(--surface-sunken);
  width:260px;z-index:120;overflow:visible}
.ui-game-sidebar .ui-player-card{position:relative}
.ui-sidebar-presence{display:flex;align-items:center;gap:7px;margin:0 14px 8px}
.ui-sidebar-presence .ui-online-count{flex:1;min-width:0;margin:0}
.ui-sidebar-notifications{
  display:flex;
  align-items:center;
  gap:8px;
  border-radius:7px;
  color:#d7ddd9;
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;position:relative;z-index:135;flex:0 0 32px;width:32px;height:32px;margin:0;padding:0;border:0;background:transparent}
.ui-sidebar-notifications>span{display:none}
.ui-sidebar-notifications .ui-notifications__toggle{
  font-size:13px;width:30px;height:30px;border-color:rgba(255,255,255,.09);background:#222d27;color:#fff;box-shadow:none}
.ui-sidebar-notifications .ui-notifications__panel{
  text-transform:none;position:fixed;z-index:200;left:272px;right:auto;top:18px;bottom:auto;width:min(400px,calc(100vw - 300px));max-height:calc(100vh - 36px)}
.ui-side-nav .ui-game-nav-group button{display:flex;align-items:center;gap:10px;width:100%;height:38px;padding:0 10px;border:0;border-radius:6px;background:transparent;color:#dbe1dd;font:800 12px/1 var(--font-body);cursor:pointer}
section.ui-chat[data-chat]>.farm-chat-bubble,.global-logistics>.global-logistics-toggle{display:none!important}
section.ui-chat[data-chat]{
  position:fixed;
  left:272px;
  bottom:18px;
  font-family:var(--font-body);
  color:var(--ink);z-index:160}
section.ui-chat[data-chat] .farm-chat-panel{left:0;bottom:0;border-left:1px solid var(--border);border-radius:8px}
/* Vue classique : le chat démarre après la barre latérale (272px), il ne doit pas déborder à droite. */
@media(min-width:1101px){.ui-game:not(.ui-game--map) section.ui-chat[data-chat] .farm-chat-panel{max-width:calc(100vw - 290px)}}
.global-logistics{
  position:fixed;
  left:-3px;
  right:auto;
  bottom:165px;z-index:60}

@media(max-width:900px){
  .ui-game-sidebar{
  position:fixed;
  left:0;
  top:0;
  height:100dvh;
  transform:translateX(-102%);
  box-shadow:10px 0 30px rgba(7,12,9,.32);
  transition:transform .2s ease;
  width:min(300px,88vw);z-index:130}
  .ui-game-sidebar__backdrop{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  padding:0;
  border:0;
  background:rgba(12,18,15,.58);z-index:120}
  .ui-game-sidebar__brand{
  height:78px;grid-template-columns:1fr;padding-inline:16px}
  .ui-sidebar-notifications{position:relative;right:auto;top:auto}
  .ui-sidebar-notifications .ui-notifications__panel{
  position:fixed;left:12px;right:12px;top:12px;width:auto;max-height:calc(100vh - 24px)}
}

.objective-card>footer form,
.ui-side-nav-cluster{margin:0;padding:0}
.ui-side-nav-cluster summary{display:flex;align-items:center;gap:10px;width:100%;height:38px;padding:0 10px;box-sizing:border-box;border-radius:6px;color:#dbe1dd;font-size:12px;font-weight:800;cursor:pointer;list-style:none}
.ui-side-nav-cluster summary::-webkit-details-marker{display:none}
.ui-side-nav a>span,
.ui-side-nav button>span,
.ui-side-nav-cluster summary>span{display:grid;place-items:center;flex:0 0 24px;font-size:16px}
.ui-side-nav :is(a,button,summary)>span>.terravia-ui-icon{display:block;width:22px;height:22px}
.ui-side-nav .ui-side-nav-cluster>div>a>span>.terravia-ui-icon{width:19px;height:19px}
.ui-side-nav a>b,
.ui-side-nav button>b,
.ui-side-nav-cluster summary>b{color:inherit;font:inherit}
.ui-side-nav-cluster summary>i{margin-left:auto;color:#8d9a92;font-style:normal;transition:transform .15s ease}
.ui-side-nav-cluster[open] summary>i{transform:rotate(90deg)}
.ui-side-nav-cluster>div{display:grid;gap:2px;margin:1px 0 3px 21px;padding-left:9px;border-left:1px solid #4a554f}
.ui-side-nav .ui-side-nav-cluster>div>a{height:32px;padding-left:7px;font-size:11px}
.ui-side-nav .ui-side-nav-cluster>div>a>span{flex-basis:20px;font-size:14px}
.ui-side-nav [data-sidebar-chat]{position:relative}
.ui-side-nav [data-sidebar-chat]>i[data-sidebar-chat-unread]{display:grid;place-items:center;min-width:19px;height:19px;margin-left:auto;padding:0 5px;box-sizing:border-box;border-radius:10px;background:var(--negative);color:#fff;font:900 9px/1 var(--font-body);font-style:normal}
.ui-side-nav [data-sidebar-chat]>i[data-sidebar-chat-unread][hidden]{display:none}
.ui-side-nav a:hover,
.ui-side-nav button:hover,
.ui-side-nav .ui-game-nav-group button:hover,
.ui-side-nav-cluster summary:hover,
.ui-side-nav [data-sidebar-chat].is-active{background:#303b35;color:#fff}

section.ui-chat[data-chat] .farm-chat-line{
  gap:5px;
  border-radius:8px;
  color:var(--ink);
  display:grid !important;
  column-gap:6px !important;
  padding:1px 11px;
  font-size:14px;
  line-height:20px;
  align-items:start !important;grid-template-columns:max-content max-content minmax(0,1fr) auto!important}
section.ui-chat[data-chat] .farm-chat-line>time{
  color:var(--ink-soft);
  line-height:20px;width:auto;text-align:left;white-space:nowrap}
.ui-online-count{display:flex;align-items:center;gap:6px;margin:0 14px 8px;padding:7px 9px;border:1px solid rgba(255,255,255,.09);border-radius:6px;background:#222d27;color:#bfc9c2;font-size:9px;font-weight:800}
.ui-online-count>i{width:7px;height:7px;border-radius:50%;background:#52a665;box-shadow:0 0 0 3px rgba(82,166,101,.14)}
.ui-online-count>strong{color:#fff;font-size:11px}
.ui-online-count>span{white-space:nowrap}

/* R&D compacte : l'ecran sert a choisir, la modale porte le detail. */
.place-research [data-research-board]{display:grid;gap:10px}
.place-research [data-research-board]>.ui-panel{margin:0}
.place-research [data-research-tree]>.ui-panel__body{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,420px);align-items:center;gap:10px;padding:10px 12px}
.place-research [data-research-tree] .coop-tabs{align-items:center;gap:5px;min-width:0}
.place-research [data-research-tree] .coop-tabs .ui-btn{height:32px;min-height:32px;padding:0 10px;font-size:10px}
.place-research [data-research-tree] .coop-summary-sep-line{display:none}
.place-research [data-research-active]{
  margin-top:12px;grid-column:2;margin:0;padding:8px 10px;gap:6px}
.place-research [data-research-active]>header{grid-template-columns:32px minmax(0,1fr) auto;gap:8px}
.place-research [data-research-active]>header strong{font-size:12px}
.place-research [data-research-active]>header small{font-size:9px}
.place-research [data-research-active] .objective-gauge{height:5px}
.place-research [data-research-branch]>header{min-height:42px;padding:8px 12px}
.place-research [data-research-branch]>header h1{font-size:13px}
.place-research [data-research-branch]>.ui-panel__body{padding:0}
.place-research .coop-upgrade-grid{grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:7px;padding:8px}
.place-research .coop-upgrade-grid>.coop-upgrade{grid-template-rows:auto minmax(17px,auto) auto;gap:6px;min-height:0;padding:8px 9px}
.place-research .coop-upgrade-grid>.coop-upgrade>header{grid-template-columns:32px minmax(0,1fr) auto;gap:7px}
.place-research [data-research-active] .coop-upgrade-icon,
.place-research .coop-upgrade-grid .coop-upgrade-icon{width:32px;height:32px;border-radius:6px;font-size:17px}
.place-research .coop-upgrade-grid .coop-upgrade>header strong{font-size:11px}
.place-research .coop-upgrade-grid .coop-upgrade>header small{font-size:9px;white-space:nowrap}
.place-research .coop-upgrade-grid .coop-upgrade-level{padding:4px 6px;border-radius:6px;font-size:8px}
.place-research .coop-upgrade-grid .coop-upgrade-desc{display:-webkit-box;overflow:hidden;font-size:10px;line-height:1.3;max-height:1.3em;-webkit-box-orient:vertical;-webkit-line-clamp:1}
.place-research .coop-upgrade-grid .coop-upgrade>footer{gap:6px;padding-top:6px}
.place-research .coop-upgrade-grid :is(.coop-upgrade-max,.coop-upgrade-cost){margin-right:auto;padding:4px 6px;border-radius:5px;font-size:8px}
.place-research .coop-upgrade-grid .ui-btn--sm{height:27px;min-height:27px;padding:0 8px;font-size:9px}

@media(min-width:1650px){.place-research .coop-upgrade-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1100px){
  .place-research [data-research-tree]>.ui-panel__body{grid-template-columns:1fr}
  .place-research [data-research-active]{grid-column:1}
  .place-research .coop-upgrade-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .place-research [data-research-tree]>.ui-panel__body{padding:8px}
  .place-research .coop-upgrade-grid{grid-template-columns:1fr}
}

/* Alignement vertical commun a toutes les vues principales. */
.ui-game .ui-game-content{padding-top:24px}
@media(max-width:760px){
  .ui-game .ui-game-content{padding:14px 12px 40px}
  /* En-têtes de panneau : le bouton d'aide reste en haut à droite au lieu de tomber seul sur une ligne. */
  /* Métriques : deux par ligne partout, comme l'accueil ; la charge de la flotte prend toute la ligne. */
  .ui-game-content .ui-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ui-game-content.place-logistics .ui-metrics>article:first-child{grid-column:1/-1}
  /* En-têtes de panneau compacts : pas de grand bandeau titre sur téléphone. */
  .ui-game-content .ui-panel>header{min-height:0;padding:10px 12px;gap:6px 8px}
  /* Le titre occupe la place libre : les outils restent à droite sur sa ligne, et repartent à gauche s'ils passent dessous. */
  .ui-game-content .ui-panel>header>.ui-panel__tools{justify-content:flex-start;margin-left:0}
  .ui-game-content.place-logistics .logistics-overview>header>.ui-panel__tools{justify-content:flex-end}
  .ui-game-content .ui-panel>header .ui-panel__tools :is(.ui-btn,.ui-badge){min-height:28px;height:auto;padding-top:4px;padding-bottom:4px;font-size:11px}
  .ui-game-content .ui-panel>header:has(>.ui-panel__tools>[class*="help-button"]){position:relative;padding-right:46px}
  /* Entrepôt : titre de catégorie à gauche, jauge compacte à droite ; chiffres plus petits pour tenir sur 3 colonnes. */
  .place-warehouse .ui-data-card :is(.ui-data-cell--quantity,.ui-data-cell--price,.ui-data-cell--value)>strong{font-size:12px}
  /* Le « i » fait la hauteur d'une ligne d'en-tête (28 px) : il reste centré sur le titre et les badges. */
  .ui-panel>header>.ui-panel__tools>[class*="help-button"]{position:absolute;top:10px;right:12px;width:28px;height:28px;min-height:28px}
  body .ui-game-content .ui-panel>header>:is(h1,h2){display:flex;flex:1 1 auto;align-items:center;min-height:28px}
  /* Tableau trop large pour l'écran : on fait défiler plutôt que de couper les colonnes. */
  .ui-table-grid{overflow-x:auto}
  /* Historique : une opération sur deux lignes (libellé + montant, puis marchandise + date). */
  [data-history-register]>header{display:none}
  [data-history-register]>article{grid-template-columns:28px minmax(0,1fr) auto;gap:2px 10px;padding:9px 10px}
  [data-history-register]>article>.history-icon{grid-row:1/3}
  [data-history-register]>article>:nth-child(3){grid-column:2;grid-row:2;font-size:11px}
  [data-history-register]>article>:nth-child(3):has(>span:only-child){visibility:hidden}
  [data-history-register]>article>time{grid-column:3;grid-row:2;justify-self:end;font-size:11px}
  [data-history-register]>article>.history-amount{grid-column:3;grid-row:1;justify-self:end}
}

/* Modale produit mobile : lecture verticale de la chaine economique. */
@media(max-width:760px){
  .product-info-dialog .market-chain-section .origin-columns{display:grid;grid-template-columns:1fr}
  .product-info-dialog .market-chain-section .origin-columns::before{display:none}
  .product-info-dialog .market-chain-section .origin-column{padding:11px 12px}
  .product-info-dialog .market-chain-section .origin-column+.origin-column{margin:0;padding:12px;border-top:2px dashed var(--border-strong)}
  .product-info-dialog .market-chain-section .origin-column h3{margin-top:0}
}

/* En-tete compact du rail joueur. */
.ui-game-sidebar .ui-game-wordmark{
  height:auto;
  max-width:100%;width:136px}
.ui-game-sidebar .ui-game-sidebar__brand{height:70px;padding-block:5px}
.ui-game-sidebar .ui-sidebar-notifications{top:auto}
.ui-game-sidebar .ui-player-card .player-rank{
  border-radius:0;
  box-shadow:none;
  display:flex;
  margin:0;
  border:0;
  background:transparent;flex-direction:row;justify-content:flex-start;gap:10px;padding:12px 14px;text-align:left}
.ui-game-sidebar .ui-player-card .player-rank>span{
  border:2px solid var(--shell-border);
  background:var(--accent);width:42px;height:42px;font-size:18px}
.ui-game-sidebar .ui-player-card .player-rank>div{
  grid-template-columns:minmax(0,1fr);
  display:grid;
  gap:2px;width:auto}
.ui-game-sidebar .ui-player-card .player-rank strong{
  grid-row:2;
  color:#fff;font-size:14px}
.ui-player-card__world{
  display:flex;
  align-items:center;
  gap:9px;
  background:#222d27;
  color:#fff;min-height:42px;box-sizing:border-box;padding:7px 12px}
.ui-player-card__world>.weather-sprite{
  flex:0 0 27px;flex-basis:24px;width:24px;height:24px}
.ui-player-card__world small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#8d9a92;
  font-weight:900;
  text-transform:uppercase;font-size:7px}
.ui-player-card__world strong{
  white-space:nowrap;
  color:#fff;font-size:9px}
@media(max-width:900px){
  .ui-game-sidebar .ui-game-sidebar__brand{height:66px;padding-block:4px}
  .ui-game-sidebar .ui-sidebar-notifications{top:auto}
}

/* Entrepot lateral : rail sombre compagnon de la navigation. */
@media(min-width:1351px){
  .ui-game-workspace .ui-game-stage{grid-template-columns:minmax(0,1fr) 260px;column-gap:28px}
}
.ui-game .ui-game-inventory{border:0;border-left:1px solid var(--shell-border);border-radius:0;background:#202a25;box-shadow:-8px 0 20px rgba(7,12,9,.12);color:#dbe1dd}
.ui-game .ui-game-inventory>header{
  color: var(--ink);min-height:70px;box-sizing:border-box;padding:12px 14px;background:#26322c;border:0;border-bottom:1px solid #3c4841;box-shadow:inset 3px 0 var(--accent)}
.ui-game .ui-game-inventory>header :is(strong,small,span,p){color:#f3f5f3}
.ui-game .ui-game-inventory>header strong{
  font: 800 14px/1.2 var(--font-title);font-size:13px}
.ui-game .ui-game-inventory>header>div>span{display:grid;place-items:center;width:30px;height:30px;border:1px solid #4a574f;border-radius:6px;background:#1b241f;font-size:16px}
.ui-game .ui-game-inventory .stock-dock-list{padding:4px 10px;scrollbar-color:#536158 transparent;scrollbar-width:thin}
.ui-game .ui-game-inventory .dock-resource{grid-template-columns:34px minmax(0,1fr) auto;gap:8px;min-height:48px;padding:6px 3px;border:0;border-bottom:1px solid rgba(255,255,255,.075);background:transparent;color:#dbe1dd}
.ui-game .ui-game-inventory .dock-resource:hover{background:#2b3731}
.ui-game .ui-game-inventory .dock-resource div{min-width:0;gap:2px}
.ui-game .ui-game-inventory .dock-resource :is(strong,b){color:#f1f4f2}
.ui-game .ui-game-inventory .dock-icon{width:30px;height:30px;box-sizing:border-box;border:1px solid color-mix(in srgb,var(--resource,var(--border)) 45%,#bdc6c0);border-radius:6px;background:#f0eee8;box-shadow:none}
.ui-game .ui-game-inventory footer{
  color: var(--ink);min-height:48px;box-sizing:border-box;padding:10px 13px;background:#18211d;border:0;border-top:1px solid #3c4841}
.ui-game .ui-game-inventory footer :is(span,strong){color:#c7d0ca}
.ui-game .ui-game-inventory footer span{font-size:8px}
.ui-game .ui-game-inventory footer strong{color:#7fc48c;font-size:11px}

/* Marché — mêmes composants que l'entrepôt et les contrats (liste en cartes,
   onglets, barre de recherche) : seules les colonnes changent. */
.place-market .ui-data-list--table>.ui-data-card{grid-template-columns:44px minmax(210px,1fr) repeat(4,minmax(120px,.62fr));}
.place-market-product .ui-data-list--table>.ui-data-card{grid-template-columns:minmax(210px,1fr) repeat(3,minmax(120px,.62fr)) 136px;}
.profile-link,
section.ui-chat[data-chat] .farm-chat-author,
.place-market a.ui-data-cell{color:inherit;text-decoration:none;}
.place-market-product .ui-metrics{margin:0 0 13px;grid-template-columns:repeat(3,minmax(0,1fr));}
@media(max-width:1100px){
  .place-market-product .ui-data-list--compact-mobile>.ui-data-card .ui-data-title{padding-left:0;}
  .place-market-product .ui-data-list--compact-mobile>.ui-data-card .ui-data-cell--gain{grid-column:1 / -1;margin-left:-10px;padding-left:20px;border-left:0;}
  .place-market-product .ui-metrics{grid-template-columns:1fr;}
}
@media(max-width:760px){
  .place-market .ui-data-list--compact-mobile,
  .place-market-product .ui-data-list--compact-mobile{display:grid;grid-template-columns:minmax(0,1fr);width:100%;}
  .place-market .ui-data-list--compact-mobile>.ui-data-card,
  .place-market-product .ui-data-list--compact-mobile>.ui-data-card{
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-rows:auto auto auto auto;
    width:100%;
    max-width:none;
  }
}
.place-market .ui-panel__body>section.ui-toolbar,
.place-market-product .ui-panel__body>.coop-tabs{margin-top:13px;border-bottom:1px solid var(--border);}
.place-market-product .coop-tabs .ui-btn{gap:8px;min-width:150px;}
.ui-notifications__toggle{
  position:relative;
  width:44px;
  height:44px;
  border:1px solid var(--shell-border);
  border-radius:8px;
  background:var(--shell-raised);
  font-size:18px;
  cursor:pointer;top:6px;}
.ui-sidebar-presence .ui-notifications__toggle{top:0}
.place-market-product .coop-tabs .ui-btn>b{
  margin-left:auto;color:inherit;font-size:inherit;}
.ui-game .ui-game-inventory .dock-resource strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;font-size:12px}
.ui-game .ui-game-inventory .dock-resource small{
  overflow:hidden;
  color:#95a29a;
  text-overflow:ellipsis;
  white-space:nowrap;font-size:10px}
.ui-game .ui-game-inventory .dock-resource>b{
  color:#fff;font-size:12px}
.ui-game .ui-game-inventory .dock-resource>b small{
  color:#849188;font-size:9px}

@media(max-width:760px){
  /* La sélection précède le nom, comme dans une liste d'opérations. */
  :is(.place-farmyard,.place-factory) .asset-card__selection{top:13px;right:auto;left:13px;width:18px;height:18px}
  :is(.place-farmyard,.place-factory) .asset-card__header{padding-left:29px}
}
.product-info-dialog .market-data-table td.price-up{color:var(--positive);}
.product-info-dialog .market-data-table td.price-down{color:var(--negative);}

/* ==========================================================================
   Vue carte (choix du joueur, écrans larges uniquement) — voir game/partials/map-scene.twig et js/map-view.js
   ========================================================================== */
.map-scene,.map-panel__head{display:none}

/* Pastille des candidatures en attente sur l'entrée Consortium. */
.ui-side-nav .ui-nav-badge{display:grid;place-items:center;min-width:18px;height:18px;margin-left:auto;padding:0 5px;border-radius:999px;background:#bf432f;color:#fff;font:900 10px/18px var(--font-body);font-style:normal;box-sizing:border-box}
.ui-side-nav .ui-nav-badge[hidden]{display:none!important}

/* Modales : toujours centrées dans le viewport, indépendamment de la hauteur de la page. */
body .ui-game dialog.ui-modal {
  position: fixed !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  margin: 0 !important;
  transform: translate(-50%, -50%);
  max-height: calc(100dvh - 28px);
}

/* Groupe de cases à cocher présenté comme un champ (ex. secteurs d’un événement). */
fieldset.ui-field{min-width:0;margin:0;padding:0;border:0}
/* Pile de notifications en couche supérieure (au-dessus des modales) : on neutralise le style par défaut des popovers. */
:where(#toast-root[popover]){inset:auto;margin:0;padding:0;border:0;background:none;color:inherit;overflow:visible}
/* Événement : une ligne par secteur, case + bonus en %. */
/* Ligne secteur : case à cocher + le stepper de la modale produit, en version compacte. */
body .ui-game .ui-modal .event-boost{--modal-control-h:32px;display:grid;grid-template-columns:minmax(0,1fr) 112px;align-items:center;gap:8px}
body .ui-game .ui-modal .event-boost .ui-number-stepper{grid-template-columns:30px minmax(0,1fr) 30px}
body .ui-game .ui-modal .event-boost .ui-number-stepper :is(input,button){width:100%;min-height:0;text-align:center}
body .ui-game .ui-modal .event-boost:not(:has(input[type=checkbox]:checked))>.ui-number-stepper{opacity:.35}
body .ui-game .ui-modal .ui-modal-fields>.ui-modal-body{
  padding:0;align-content:start}
.ui-check-grid--2col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 28px}
body .ui-game .ui-modal--event{--ui-modal-width:720px}
/* Modales sans corps structuré (champ, note posés directement dans le formulaire) : marge latérale
   et espacement vertical. Les blocs structurés (corps, statuts, sections) gèrent les leurs. */
body .ui-game .ui-modal > :is(form,.ui-modal-shell) > :not(header,footer,.ui-modal-body,.ui-status,.ui-modal-section,input[type=hidden]){margin:12px var(--modal-pad) 0}
/* Bêtes éparpillées dans l'enclos : décor réservé à la vue carte. */
.asset-card__herd{display:none}
/* Chaîne de production dessinée sur la tuile d'usine : décor réservé à la vue carte. */
.asset-card__line{display:none}
/* Admin · Images : dépôt, options, file d'attente et bibliothèque. */
.image-converter{display:grid;gap:12px;margin-top:14px}
.image-drop{display:grid;justify-items:center;gap:6px;padding:26px 16px;border:2px dashed var(--border-strong);border-radius:var(--radius-lg);background:var(--surface-2);color:var(--ink);text-align:center;cursor:pointer;transition:border-color .15s,background .15s}
.ui-game-content .published-list article.is-taken,
.ui-game-content .help-card:hover,
.ui-game .contract-ranks-list article.is-current,
.support-message.is-staff>i,
.image-drop:hover,
.image-drop.is-over{border-color:var(--accent);background:var(--accent-soft)}
.image-drop>span{font-size:32px}
.image-drop>small{color:var(--ink-mute)}
.image-options{display:grid;grid-template-columns:minmax(160px,220px) minmax(200px,1fr) auto;align-items:end;gap:14px}
.image-options input[type=range]{width:100%;accent-color:var(--accent)}
.ui-game-content .published-list,
.ui-modal .ui-action-stack,
.image-queue{display:grid;gap:8px}
.image-item{display:grid;grid-template-columns:72px minmax(0,1fr) auto;align-items:center;gap:14px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2)}
.image-item__main{display:grid;gap:4px;min-width:0}
.ui-game-content .finance-upkeep li.is-empty,
.support-form-actions small,
.image-item__main>small{color:var(--ink-mute);font-weight:700}
.image-item__main em{font-style:normal;font-weight:900}
.image-item__main em.is-gain{color:var(--positive)}
.image-item__main em.is-loss{color:var(--negative)}
.farm-chat-tools,
.farm-chat-tools.ui-chat,
.image-item__name{display:flex;align-items:center;gap:6px}
.ui-game-sidebar .player-rank>div,
.image-item__name>input{flex:1;min-width:0}
.image-item__actions{display:flex;align-items:center;gap:8px}
.image-card__thumb{display:grid;place-items:center;aspect-ratio:1;overflow:hidden;border-radius:10px;background:repeating-conic-gradient(var(--surface-3) 0 25%,var(--surface) 0 50%) 0 0/16px 16px}
.image-card__thumb>img{max-width:100%;max-height:100%;object-fit:contain}
.image-library{margin-top:18px}
.image-library>header{display:flex;align-items:baseline;gap:10px;margin-bottom:10px}
.image-library>header small{color:var(--ink-mute)}
.image-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px}
.image-card{display:grid;gap:6px;min-width:0;padding:10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2)}
.image-card>strong{overflow:hidden;color:var(--ink);font-size:12px;text-overflow:ellipsis;white-space:nowrap}
.image-card__actions .ui-btn{min-height:30px;padding:0 8px;font-size:11px}
/* Élevage : intrants/produits balisés (icône masquée en vue classique, texte inchangé). */
.herd-io>b{display:none}
.herd-io>small,.herd-sep{font:inherit}
/* Logistique : façade du dépôt en grand, puis ses trois métriques (même composant que l'accueil). */
@media(min-width:761px){.place-logistics .ui-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
.logistics-facade{display:grid;place-items:end center;margin-bottom:12px;padding:16px 16px 0;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius);background:radial-gradient(ellipse at 50% 100%,rgba(232,182,74,.2),transparent 65%),linear-gradient(var(--surface-2),var(--surface-sunken))}
/* Portes de la façade logistique : boutons posés au pied de chaque quai. */
.logistics-facade__art{position:relative;display:block;width:100%;max-width:1400px}
.logistics-facade__art>img{display:block;width:100%;height:auto;filter:drop-shadow(0 10px 14px rgba(0,0,0,.35))}
.logistics-door{position:absolute;top:79%;padding:6px 14px;border:1px solid rgba(232,182,74,.75);border-radius:999px;background:rgba(18,24,20,.85);color:#f3d58a;font:800 13px/1 var(--font-body);white-space:nowrap;cursor:pointer;transform:translate(-50%,-50%);box-shadow:0 4px 10px rgba(0,0,0,.4);transition:background .15s,color .15s,transform .15s}
.logistics-door:hover{background:var(--accent);color:#fff;transform:translate(-50%,-50%) scale(1.06)}
.logistics-door.is-soon{border-color:rgba(255,255,255,.2);color:#b4bcb5;cursor:default}
section.ui-chat[data-chat] .farm-chat-empty,
.image-card>small{color:var(--ink-mute);font-size:11px}
@media(max-width:760px){
  /* Mobile : portes plus petites (cadenas seul). */
  .logistics-facade{padding:8px 8px 0}
  .logistics-door{padding:4px 7px;font-size:10px}
  .logistics-door:has(>span[aria-hidden]){font-size:0}
  .logistics-door>span[aria-hidden]{font-size:12px}
}
/* Extraction : prospection et contrats de fourniture. */
.ui-game .ui-game-content.game-place .extraction-plus .offer-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}
.extraction-plus__list{margin-bottom:12px}
.extraction-offer.is-ready{border-color:var(--positive-border);box-shadow:0 0 0 2px var(--positive-soft)}
.image-card__actions,
.extraction-plus__actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.extraction-supply{display:grid;grid-template-columns:minmax(0,1.2fr) auto minmax(80px,2fr) auto;align-items:center;gap:12px;margin-bottom:8px;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2)}
.extraction-supply>small{color:var(--ink-mute)}
.extraction-supply__bar{height:8px;overflow:hidden;border-radius:4px;background:var(--surface-sunken)}
.place-warehouse .store-gauge>i>span,
.extraction-supply__bar>i{display:block;height:100%;background:linear-gradient(90deg,var(--progress-start),var(--progress-end))}
.ui-game .extraction-supply__form{display:flex;align-items:center;gap:8px;margin:4px 0 8px}
.ui-game .extraction-supply__form>select{flex:1 1 auto;min-width:0;width:auto}
.ui-game .extraction-supply__form>select[name=days]{flex:0 0 140px}
.ui-game .extraction-supply__form>.ui-btn{flex:0 0 auto}

/* Fiches à onglets (usine, parcelle, enclos) : un onglet masqué l'est vraiment, et le formulaire
   partagé (recette, culture) logé dans la fiche n'affiche pas son propre titre. */
dialog[data-sheet] [data-sheet-panel][hidden]{display:none !important}
dialog[data-sheet]>form>.ui-modal-header{display:none !important}
dialog[data-sheet] .ui-modal-shell>[role=tablist]{margin:12px 16px 0}
/* Contenu d'un onglet de fiche : simple pile espacée, sans cadre (pas de bloc dans le bloc). */
dialog[data-sheet] .ui-sheet-content{
  display:grid;
  gap:12px;
  margin:12px var(--modal-pad) 16px;
  box-sizing:border-box;
}
body .ui-game dialog[data-sheet] .ui-sheet-content>:is(.ui-status,.ui-modal-section,.herd-hint,.ui-equipment-list,.equipment-soil,.equipment-irrigate){margin:0;width:100%;box-sizing:border-box}
/* Le pied de fiche reprend toute la largeur et colle au bas de la modale, comme les autres modales. */
body .ui-game dialog[data-sheet] .ui-sheet-content:has(>.ui-modal-footer){margin-bottom:0}
body .ui-game dialog[data-sheet] .ui-sheet-content>.ui-modal-footer{margin:2px calc(var(--modal-pad) * -1) 0}
/* Boutiques : le bouton « Retirer » prend sa propre colonne en bout de rayon. */
.place-shops .shop-shelf-card:has(>form){grid-template-columns:48px minmax(0,1fr) minmax(150px,auto) auto}
@media (max-width:700px){.place-shops .shop-shelf-card:has(>form){grid-template-columns:42px minmax(0,1fr) auto}}
/* Logistique : la revente d'un véhicule passe sous l'achat, sur toute la largeur du pied de carte. */
.fleet-card__foot>form:not([data-fleet-buy]){grid-column:1/-1}
/* Fiche véhicule (fenêtre d'une porte du hangar) : présentée comme une carte d'identité,
   photo à gauche, identité et caractéristiques à droite, achat en pied. */
.fleet-card__photo{display:none}
dialog.ui-modal.logistics-door-dialog{width:min(820px,calc(100vw - 32px));max-width:min(820px,calc(100vw - 32px))}
.logistics-door-dialog .fleet-card:hover{transform:none}
.logistics-door-dialog .fleet-card__photo{grid-area:photo;display:grid;place-items:center;min-height:240px;overflow:hidden;border:1px solid var(--border);border-radius:12px;background:radial-gradient(ellipse at 50% 40%,var(--surface-2),var(--surface) 80%)}
.logistics-door-dialog .fleet-card__photo>img{display:block;object-fit:contain;object-position:center}
.logistics-door-dialog .fleet-card__photo>span{font-size:110px;line-height:1}
.logistics-door-dialog .fleet-card.is-locked .fleet-card__photo{filter:grayscale(.7);opacity:.75}
.logistics-door-dialog .fleet-card__head{grid-area:head;grid-column:auto;padding:0}
.logistics-door-dialog .fleet-card__icon{display:none}
.logistics-door-dialog .fleet-card__title{font-size:20px}
.logistics-door-dialog .fleet-card__gauge{grid-area:gauge;grid-column:auto;padding:12px 14px;border:1px solid var(--border);border-radius:10px}
.logistics-door-dialog .fleet-card__rep,.logistics-door-dialog .fleet-card__note{grid-area:rep;grid-column:auto;border:0;border-radius:10px}
@media(max-width:700px){.logistics-door-dialog .fleet-card__photo{min-height:180px}}
/* Fiche véhicule : prix en tête, puis achat (quantité + bouton) et revente côte à côte, même hauteur. */
.logistics-door-dialog .fleet-card__price span{display:none}
.logistics-door-dialog .fleet-card__foot>form:not([data-fleet-buy]){grid-column:2;display:block}
.logistics-door-dialog .fleet-card__flag{margin-left:auto}
.logistics-door-dialog .fleet-card__foot :is(.ui-btn,.fleet-card__quantity){height:42px;min-height:42px;box-sizing:border-box}
.logistics-door-dialog .fleet-card__foot>form:not([data-fleet-buy]) .ui-btn{width:100%}
/* Fiche véhicule — version finale : chaque bloc dans sa boîte, tout aligné sur la même grille.
   Caractéristiques en trois tuiles, achat dans un bloc, revente dans un bloc séparé. */
.logistics-door-dialog .fleet-card{
  margin:0;
  display:grid;
  grid-template-columns:260px minmax(0,1fr);
  gap:12px 20px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--surface);
  box-shadow:none;grid-template-areas:"photo head" "photo gauge" "photo stats" "photo foot" "photo resale" "rep rep";align-content:start}
.logistics-door-dialog .fleet-card__stats{
  grid-area:stats;
  grid-column:auto;
  border-radius:10px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:0;border:0;background:none;overflow:visible}
.logistics-door-dialog .fleet-card__stats li,.logistics-door-dialog .fleet-card__stats li:last-child{display:grid;gap:4px;min-height:0;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);text-align:left}
.logistics-door-dialog .fleet-card__stats small{color:var(--ink-mute);font-size:9px}
.logistics-door-dialog .fleet-card__stats strong{font-size:15px}
.logistics-door-dialog .fleet-card__foot{
  grid-area:foot;
  grid-column:auto;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}
.logistics-door-dialog .fleet-card__price{grid-column:auto}
.logistics-door-dialog .fleet-card__foot>form[data-fleet-buy],.logistics-door-dialog .fleet-card__foot>form[data-fleet-buy]:only-of-type{display:flex;align-items:center;gap:8px;grid-column:auto}
.logistics-door-dialog .fleet-card__foot .fleet-card__quantity{flex:0 0 120px;height:40px;min-height:40px}
.logistics-door-dialog .fleet-card__foot .ui-btn{flex:0 0 auto;width:auto;min-width:130px;height:40px;min-height:40px}
.equipment-irrigate p,
.logistics-door-dialog .fleet-card__resale p{display:grid;gap:2px;margin:0}
.logistics-door-dialog .fleet-card__resale small{color:var(--ink-mute);font:800 9px/1 var(--font-body);letter-spacing:.06em;text-transform:uppercase}
.logistics-door-dialog .fleet-card__resale strong{font-size:14px}
.logistics-door-dialog .fleet-card__resale span{color:var(--ink-mute);font:700 10px/1.3 var(--font-body)}
.logistics-door-dialog .fleet-card__resale .ui-btn{min-width:130px;height:40px;min-height:40px}
.fleet-card__resale{display:none}
.logistics-door-dialog .fleet-card__resale{
  grid-area:resale;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px dashed var(--border);
  border-radius:10px;display:grid}
@media(max-width:700px){.logistics-door-dialog .fleet-card{
  grid-template-columns:1fr;grid-template-areas:"photo" "head" "gauge" "stats" "foot" "resale" "rep"}}
/* Encyclopédie : tuiles (produit, culture, ressource) et fiches larges (recette, élevage). */
.place-library [data-enc-tabs] b{margin-left:4px;opacity:.7;font-weight:800}
.place-library [data-enc]>.ui-toolbar input[type=search]{flex:1 1 220px;min-width:0}
.enc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px}
.enc-grid--wide{grid-template-columns:repeat(auto-fill,minmax(340px,1fr))}
.enc-tile{display:grid;grid-template-columns:auto minmax(0,1fr);align-content:start;gap:8px 10px;min-width:0;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2)}
.enc-tile .resource-medal{width:40px;height:40px}
.enc-tile__main{display:grid;gap:3px;min-width:0}
.enc-tile__main strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:800 13px/1.2 var(--font-body)}
.enc-tile__main small{overflow:hidden;color:var(--ink-mute);font:700 10px/1.3 var(--font-body);text-overflow:ellipsis}
.enc-tile__foot{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:8px;border-top:1px solid var(--border)}
.enc-tile__foot b{flex:none;font:800 11px/1.2 var(--font-body);text-align:right;white-space:nowrap}
.enc-tile--recipe{grid-template-columns:minmax(0,1fr)}
.enc-rank{display:inline-flex;align-items:center;gap:4px;min-width:0;overflow:hidden;padding:2px 8px;border-radius:999px;background:var(--surface);font:800 10px/1.4 var(--font-body);white-space:nowrap;text-overflow:ellipsis}
.enc-rank.is-locked{color:var(--ink-mute)}
.enc-tile.is-locked .resource-medal{filter:grayscale(.8);opacity:.6}
.enc-flow{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px}
.enc-flow>div{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.enc-chip{display:inline-flex;align-items:center;gap:3px;max-width:100%;padding:3px 7px;border-radius:7px;background:var(--surface);font:700 10px/1.3 var(--font-body);white-space:nowrap}
.enc-flow>i,
.enc-chip em{color:var(--ink-mute);font-style:normal}
.place-library [data-enc]>.ui-toolbar{
  margin:12px 0;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.place-library [data-enc]>.ui-toolbar>:is(select,input){flex:0 1 220px;width:auto;min-width:0;height:38px;min-height:38px;margin:0;font-size:12px}
.place-library [data-enc]>.ui-toolbar>input[type=search]{flex:1 1 240px}
.place-library [data-enc]>.ui-toolbar>.ui-badge{gap:4px;margin-left:auto}
.place-library [data-enc]>.ui-toolbar>select{padding:0 32px 0 12px;line-height:36px}

/* Boutique : cadre d'avatar acheté (une seule règle, la couleur vient de config/store.php). */
body .ui-game .has-frame.has-frame,body .has-frame.has-frame{box-shadow:0 0 0 3px var(--frame-color),0 0 12px var(--frame-glow)}

/* ===== Boutique (Soutien et cosmétiques) ===== */
.place-store .store .ui-panel__body{display:grid;grid-template-columns:minmax(0,1fr);gap:28px}
.place-store .store-notice{margin:0;padding:12px 16px;border:1px solid var(--positive-border);border-radius:var(--radius);background:var(--positive-soft);color:var(--ink);font:800 13px/1.4 var(--font-body)}
.place-store .store-hero{display:flex;align-items:center;gap:22px;padding:26px 28px;border:1px solid var(--border);border-radius:var(--radius-lg);background:radial-gradient(circle at 12% 30%,color-mix(in srgb,var(--accent) 22%,transparent),transparent 55%),var(--surface-2)}
.place-store .store-hero h2{margin:0 0 6px;font:900 22px/1.2 var(--font-body);color:var(--ink)}
.place-store .store-hero p{margin:0;max-width:680px;color:var(--ink-soft);font:600 13px/1.5 var(--font-body)}
.place-store .store-hero__avatar,.place-store .store-card__avatar{display:grid;flex:none;place-items:center;width:72px;height:72px;border-radius:50%;background:var(--accent);color:#fff;font:900 28px/1 var(--font-body)}
.place-store .store-hero__closed{display:inline-block;margin-top:10px;padding:4px 10px;border:1px solid var(--border-strong);border-radius:999px;color:var(--ink-mute);font:800 11px/1.4 var(--font-body)}
.ui-modal--recap .recap-body,
.place-admin .admin-events,
.place-store .store-section{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
.place-store .store-section>header{display:grid;gap:4px;padding-bottom:10px;border-bottom:1px solid var(--border)}
.place-store .store-section>header h2{margin:0;font:900 17px/1.2 var(--font-body);color:var(--ink)}
.place-store .store-section>header p{margin:0;color:var(--ink-mute);font:600 12px/1.4 var(--font-body)}
.place-store .store-premium{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));gap:18px;max-width:760px}
.place-store .store-offer{position:relative;display:grid;gap:10px;align-content:start;padding:24px 22px 20px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface-2)}
.place-store .store-offer.is-best{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent),0 10px 30px color-mix(in srgb,var(--accent) 18%,transparent)}
.place-store .store-offer__ribbon{position:absolute;top:-11px;right:18px;padding:4px 12px;border-radius:999px;background:var(--accent);color:#fff;font:900 10px/1.4 var(--font-body);letter-spacing:.06em;text-transform:uppercase}
.place-store .store-offer__icon{font-size:30px;line-height:1}
.place-store .store-offer h3{margin:0;font:900 16px/1.2 var(--font-body);color:var(--ink)}
.place-store .store-offer__price{font:900 28px/1 var(--font-body);color:var(--ink)}
.place-store .store-offer ul{display:grid;gap:6px;margin:4px 0 8px;padding:0;list-style:none}
.place-store .store-offer li{position:relative;padding-left:20px;color:var(--ink-soft);font:600 12px/1.4 var(--font-body)}
.place-store .store-offer li::before{content:"✓";position:absolute;left:0;color:var(--positive);font-weight:900}
.place-store .store-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(150px,100%),1fr));gap:16px}
.place-store .store,.place-store .store .ui-panel__body{min-width:0;max-width:100%}
.place-store .store-section,.place-store .store-hero>div{min-width:0}
.place-store .store-card{display:grid;justify-items:center;align-content:start;gap:8px;padding:22px 16px 16px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface-2);text-align:center;transition:transform .15s,border-color .15s}
.place-store .store-card:hover{transform:translateY(-2px);border-color:var(--border-strong)}
.place-store .store-card.is-equipped{border-color:var(--positive-border);background:color-mix(in srgb,var(--positive) 7%,var(--surface-2))}
.place-store .store-card__avatar{width:64px;height:64px;margin-bottom:6px;font-size:24px}
.place-store .store-card__chat{width:100%;margin:0 0 6px;padding:12px;border-radius:10px;background:var(--surface-sunken,var(--surface));color:var(--ink-soft);font:600 13px/1.3 var(--font-body)}
.place-store .store-card h3{margin:0;font:900 14px/1.2 var(--font-body);color:var(--ink)}
.profile-hero>small,
.place-store .store-card small{color:var(--ink-mute);font:700 11px/1.3 var(--font-body)}
.place-store :is(.store-card,.store-offer) form,.place-store :is(.store-card,.store-offer)>.ui-btn{width:100%;margin-top:6px}
.place-store :is(.store-card,.store-offer) form .ui-btn,.place-store :is(.store-card,.store-offer)>.ui-btn{width:100%;justify-content:center}
.place-store .store-card__lock{width:100%;margin-top:6px;padding:9px 10px;border:1px dashed var(--border-strong);border-radius:10px;color:var(--ink-mute);font:800 11px/1.3 var(--font-body)}
@media(max-width:700px){.place-store .store-hero{flex-direction:column;align-items:flex-start;padding:20px}}

/* Avatar image : fond blanc (PNG transparents) */
body .map-player>span:has(>img),body .profile-emblem:has(>img){background:#fff}

/* Mon profil : l'avatar se change d'un clic (même héros que la fiche d'empire). */
.place-account .account-avatar{position:relative;cursor:pointer}
.place-account .account-avatar:has(>img){background:#fff}
.place-account .account-avatar::after{content:"📷";position:absolute;right:2px;bottom:2px;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--surface);box-shadow:0 0 0 2px var(--border);font-size:14px}
.place-account .profile-hero small[data-error]{color:var(--negative);font-weight:900}
.place-account .ui-table-grid form>.ui-btn{width:100%}
.place-account .profile-hero small[data-error]:empty{display:none}
.ui-game-content .profile-hero .profile-emblem:has(>img),.profile-hero .profile-emblem:has(>img){background:#fff}

/* Mon empire : bandeau pleine largeur, puis deux colonnes indépendantes et sans trou vertical. */
.terravia-ui-icon{
  display:inline-block;
  width:1em;
  height:1em;
  flex:0 0 auto;
  background-color:transparent;
  background-image:url("../images/library/terravia-ui-icons-v2.png");
  background-repeat:no-repeat;
  background-size:500% 500%;
  font-size:inherit;
  font-style:normal;
}
.terravia-ui-icon--fields{background-position:0 0}.terravia-ui-icon--livestock{background-position:25% 0}.terravia-ui-icon--factory{background-position:50% 0}.terravia-ui-icon--extraction{background-position:75% 0}.terravia-ui-icon--warehouse{background-position:100% 0}
.terravia-ui-icon--logistics{background-position:0 25%}.terravia-ui-icon--market{background-position:25% 25%}.terravia-ui-icon--shops{background-position:50% 25%}.terravia-ui-icon--support{background-position:75% 25%}.terravia-ui-icon--research{background-position:100% 25%}
.terravia-ui-icon--water{background-position:0 50%}.terravia-ui-icon--flows{background-position:25% 50%}.terravia-ui-icon--empire{background-position:50% 50%}.terravia-ui-icon--objectives{background-position:75% 50%}.terravia-ui-icon--finances{background-position:100% 50%}
.terravia-ui-icon--contracts{background-position:0 75%}.terravia-ui-icon--map{background-position:25% 75%}.terravia-ui-icon--consortium{background-position:50% 75%}.terravia-ui-icon--forum{background-position:75% 75%}.terravia-ui-icon--help{background-position:100% 75%}
.terravia-ui-icon--ranking{background-position:0 100%}.terravia-ui-icon--profile{background-position:25% 100%}.terravia-ui-icon--admin{background-position:50% 100%}.terravia-ui-icon--encyclopedia{background-position:75% 100%}.terravia-ui-icon--logout{background-position:100% 100%}
.ui-notifications__toggle>.terravia-notification-icon{
  display:block;
  width:24px;
  height:24px;
  margin:auto;
  background:url("../images/library/notification-bell-v1.webp") center/contain no-repeat;
}
.ui-game:not(.ui-game--map) .ui-metrics article>span.terravia-ui-icon{width:27px;height:27px}

.ui-game-content.ui-game-home .home-span{grid-column:1/-1}
.ui-game-content.ui-game-home .domain-card .ui-metrics{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:900px){
  .ui-game-content.ui-game-home .domain-card .ui-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Vue classique : le rail d'entrepôt conserve toujours sa largeur complète. */
@media(min-width:1101px){
  .ui-game:not(.ui-game--map) .ui-game-stage{grid-template-columns:minmax(0,1fr) 292px;column-gap:0}
  .ui-game:not(.ui-game--map) .ui-game-column>.ui-game-content{width:100%;box-sizing:border-box}
  .ui-game:not(.ui-game--map) .ui-game-column>.ui-game-footer{width:100%;box-sizing:border-box}
}

/* Les décors riches sont propres à la carte. En classique, une vignette reste
   compacte et ne peut pas imposer la hauteur de toute sa rangée. */
/* Cartes illustrées (champs, enclos, usines) : bureau seulement ; le mobile garde la carte compacte. */
@media(min-width:901px){
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-grid{grid-template-columns:repeat(auto-fill,310px);justify-content:start;gap:14px}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card{position:relative;display:flex;flex-direction:column;height:auto;min-height:0;padding:0;overflow:hidden;border:1px solid rgba(255,255,255,.1);border-radius:16px;background:#1b231f;box-shadow:0 8px 18px rgba(0,0,0,.28)}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card{cursor:pointer}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card__visual{position:relative;inset:auto;display:grid;place-items:center;flex:0 0 260px;height:auto;border:0;border-bottom:1px solid rgba(255,255,255,.08)}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__visual{box-sizing:border-box;padding:0;background:var(--field-art,url("../images/library/champ_vide.webp")) center/cover no-repeat}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__visual:not(.planted){background:var(--field-art,url("../images/library/champ_vide.webp")) center/cover no-repeat}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__visual.planted>span{display:none}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__visual>span{display:grid;place-items:center;width:68px;height:68px;border-radius:50%;background:rgba(18,24,20,.55);box-shadow:0 0 0 3px rgba(255,255,255,.2),0 8px 18px rgba(0,0,0,.4)}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__visual>span .crop-sprite{width:48px;height:48px}
.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card__visual{display:block;background:var(--pen-art) center/cover no-repeat,radial-gradient(ellipse at 50% 60%,#607b40,#1b231f 78%)}
.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card:not(.has-art) .asset-card__visual{background:radial-gradient(ellipse at 50% 35%,transparent 40%,rgba(10,14,11,.5) 100%),#617d42}
.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card.has-art .asset-card__herd,.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card__visual>span:first-child{display:none}
.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card__herd>i{position:absolute;font-size:20px;font-style:normal;filter:drop-shadow(0 3px 2px rgba(0,0,0,.35))}
.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card__herd>i:nth-child(1){left:18%;top:30%}.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card__herd>i:nth-child(2){left:70%;top:26%}.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card__herd>i:nth-child(3){left:40%;top:58%}.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card__herd>i:nth-child(4){left:80%;top:60%}.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card__herd>i:nth-child(5){left:26%;top:78%}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card__body{position:static;display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:start;gap:9px 8px;flex:1 0 auto;padding:13px 14px 14px;background:#243129;color:#fff}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card__header{grid-column:1/-1;margin:0;padding:0;border:0}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card__header>h2{color:#fff;font-size:14px}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card__body>p{grid-column:1/-1;display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:0;padding:0;border:0;background:none}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card__body>p>span{color:#dfe5e0;font-size:11px;letter-spacing:0;text-transform:none}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card__body>p>strong{color:#f3d58a;font-size:11px;text-align:right}
.ui-game:not(.ui-game--map) .ui-game-content.place-ranch .asset-card__body .product-link:hover{color:#fff0ae;text-decoration-color:#fff0ae}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__calendar{position:static;grid-column:1/-1;margin-top:2px;overflow:hidden;border-radius:2px}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__body>p[data-plot-yield-row]>span::before{content:"📦 ";}.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__body>p:has([data-plot-fertility])>span::before{content:"🌱 ";}.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__body>p.soil-reading>span::before{content:"💧 ";}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__equipment{position:absolute;top:10px;right:10px;z-index:3;display:flex;flex-direction:row;gap:5px;padding:0;border:0;background:none}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__selection{position:absolute;top:10px;left:10px;right:auto;z-index:4;width:22px;height:22px;margin:0;padding:3px;border-radius:6px;background:rgba(18,24,20,.72)}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__equipment-item{display:none}
.ui-game:not(.ui-game--map) .ui-game-content.place-farmyard .asset-card__equipment-item.is-installed{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:rgba(18,24,20,.72);font-size:14px;filter:none;opacity:1}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card__actions{display:none}
.ui-game:not(.ui-game--map) .ui-game-content:is(.place-farmyard,.place-ranch) .asset-card__actions .ui-btn{min-height:34px}
.ui-game:not(.ui-game--map) .asset-grid--wide{--asset-grid-track:minmax(260px,1fr)}
.ui-game:not(.ui-game--map) .ui-game-content.place-factory .asset-card.has-scene{display:flex;flex-direction:column}
.ui-game:not(.ui-game--map) .ui-game-content.place-factory .asset-card.has-scene .asset-card__visual{display:block;flex:0 0 170px;border:0;border-bottom:1px solid var(--border);background:var(--factory-art) center/cover no-repeat}
.ui-game:not(.ui-game--map) .ui-game-content.place-factory .asset-card.has-scene .asset-card__visual>*{display:none}
.ui-game:not(.ui-game--map) .ui-game-content.place-factory .asset-grid:has(>.asset-card.has-scene){grid-template-columns:repeat(auto-fill,minmax(min(300px,100%),340px));justify-content:start}
.ui-game:not(.ui-game--map) .ui-game-content.place-factory .asset-card.has-scene .asset-card__actions{display:grid;grid-template-columns:1fr 1fr}
}

/* Essai des fonds de carte joueur dans le classement. */
.place-leaderboard .leaderboard-list>li.player-ranking-card{
  position:relative;
  isolation:isolate;
  min-height:82px;
  padding:12px 18px;
  overflow:hidden;
  border-color:rgba(255,255,255,.18);
  background-image:linear-gradient(90deg,rgba(16,27,21,.72) 0%,rgba(16,27,21,.28) 30%,rgba(16,27,21,0) 60%,rgba(16,27,21,.35) 100%),var(--player-card-bg);
  background-position:center;
  background-size:cover;
  background-repeat:no-repeat;
  box-shadow:inset 0 1px rgba(255,255,255,.08),0 5px 14px rgba(12,18,15,.16);
  color:#fff;
}
.place-leaderboard .leaderboard-list>li.player-ranking-card::after{content:"";position:absolute;z-index:-1;inset:0;background:linear-gradient(0deg,rgba(10,16,13,.18),transparent 65%);pointer-events:none}
.place-leaderboard .player-ranking-card :is(strong,b,.profile-link,small){color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.7)}
.place-leaderboard .player-ranking-card.is-me{border-color:var(--accent);box-shadow:inset 4px 0 var(--accent),0 5px 16px rgba(12,18,15,.22)}
.ui-game-content.place-profile>.profile-card-collection{margin-top:20px}
.profile-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media(max-width:700px){.profile-card-grid{grid-template-columns:1fr}}
.profile-card-collection .ui-panel__body>form{display:flex;justify-content:flex-end;margin-top:16px}
.profile-card-choice{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2)}
.profile-card-choice__preview{position:relative;grid-column:1/-1;display:flex;align-items:flex-end;justify-content:space-between;aspect-ratio:4/1;padding:10px 12px;overflow:hidden;border-radius:6px;background-image:linear-gradient(0deg,rgba(15,25,20,.35),transparent 55%),var(--card-preview);background-position:center;background-size:cover;background-repeat:no-repeat;color:#fff}
.profile-card-choice__preview b{margin-left:auto;padding:4px 7px;border-radius:5px;background:rgba(18,28,23,.8);font-size:9px;text-transform:uppercase}
.profile-card-choice>div:not(.profile-card-choice__preview){display:grid;gap:3px;min-width:0}
.profile-card-choice>div>small{color:var(--ink-mute);font-size:10px}
.profile-card-choice.is-locked .profile-card-choice__preview{filter:grayscale(.8);opacity:.62}
.profile-card-choice.is-equipped{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.profile-card-choice form{align-self:center}

.ui-game:not(.ui-game--map) .ui-game-inventory>header .terravia-ui-icon{display:block;width:30px;height:30px}
.ui-game:not(.ui-game--map) .global-logistics-toggle .terravia-ui-icon{display:block;width:26px;height:26px}

@media(min-width:1700px){
  .ui-game:not(.ui-game--map) .ui-game-content.ui-game-home .home-dashboard{grid-template-columns:minmax(420px,.9fr) minmax(560px,1.1fr)}
}

/* L'eau : coupe du sous-sol. Surface (pompe), tubage à l'échelle de la profondeur, poche de nappe remplie selon son niveau. */
.water-section{--h:560px;--sky:calc(var(--h) * .39);--shaft:250px;position:relative;display:flex;justify-content:space-around;gap:12px;height:var(--h);margin:0 0 12px;padding:0 20px 0 70px;overflow-x:auto;overflow-y:hidden;border:1px solid var(--border);border-radius:var(--radius);background:url("../images/library/nouveu_sous_sol.webp") center 39%/cover no-repeat #6fb6ee}
.water-section__ruler{position:absolute;z-index:2;left:0;top:var(--sky);width:58px;height:var(--shaft);border-right:1px solid rgba(255,255,255,.35);pointer-events:none}
.water-section__ruler span{position:absolute;right:8px;top:calc(var(--at) / var(--depth) * 100%);padding:2px 5px;border-radius:5px;background:rgba(0,0,0,.45);transform:translateY(-50%);color:#fff;font:800 10px/1 var(--font-body)}
.water-well{position:relative;flex:0 0 160px;display:flex;flex-direction:column;align-items:center;height:100%;padding:0;border:0;background:none;color:#fff;cursor:pointer}
.water-well__head{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3px;height:var(--sky)}
.water-well__head b{display:flex;align-items:center;gap:7px;padding:6px 12px;border:1px solid var(--shell-border);border-radius:10px;background:rgba(17,22,19,.88);font:900 12px/1.2 var(--font-body);transition:background .15s}
.water-well__head b::before{content:"";width:9px;height:9px;border-radius:50%;background:#5fd068;box-shadow:0 0 8px rgba(95,208,104,.8)}
.water-well.is-resting .water-well__head b::before{background:#8b9398;box-shadow:none}
.water-well.is-free .water-well__head b::before{display:none}
.water-well__head small{padding:2px 8px;border-radius:999px;background:rgba(10,20,30,.65);color:#9fdcff;font:800 10px/1.2 var(--font-body)}
.water-well__head img{order:3;width:128px;height:auto;margin:2px 0 -4px;filter:drop-shadow(0 6px 6px rgba(0,0,0,.45));transition:transform .2s}
.water-well:is(:hover,:focus-visible) .water-well__head img{transform:translateY(-3px)}
.water-well:is(:hover,:focus-visible) .water-well__head b{background:var(--accent)}
.water-well__shaft{position:relative;z-index:1;width:22px;height:max(8px,calc(var(--d) / var(--depth) * var(--shaft) - 44px));border-radius:0 0 3px 3px;background:linear-gradient(90deg,rgba(255,255,255,.55) 0 2px,rgba(150,215,255,.22) 2px 5px,transparent 5px calc(100% - 5px),rgba(150,215,255,.22) calc(100% - 5px) calc(100% - 2px),rgba(255,255,255,.4) calc(100% - 2px)),linear-gradient(90deg,transparent 4px,#1d7fd0 4px,#6fd0ff 45%,#1d7fd0 calc(100% - 4px),transparent calc(100% - 4px));box-shadow:0 0 14px rgba(80,180,255,.55)}
.water-well__shaft::after{content:"";position:absolute;inset:0 5px;background:radial-gradient(circle at 50% 50%,rgba(220,248,255,.9) 0 1.5px,transparent 2.5px) 0 0/8px 26px;mix-blend-mode:screen;animation:tube-flow 1.3s linear infinite}
@keyframes tube-flow{to{background-position:0 -26px}}
.water-well__pocket{position:relative;z-index:1;width:200px;height:112px;background:url("../images/library/puits_nappe.webp") center/100% 100% no-repeat;transition:filter .2s}
.water-well__pocket em{position:absolute;z-index:1;left:50%;top:62%;min-width:64px;padding:5px 10px;border:1px solid rgba(140,210,255,.75);border-radius:10px;background:#0c2033;font:900 12px/1 var(--font-body);font-style:normal;text-align:center;transform:translate(-50%,-50%)}
.water-well:is(:hover,:focus-visible) .water-well__pocket{filter:brightness(1.15) drop-shadow(0 0 12px rgba(99,195,255,.6))}
.water-well.is-resting :is(.water-well__pocket,.water-well__shaft){filter:grayscale(.75) brightness(.8);animation:none}
.water-well.is-resting .water-well__shaft::after{display:none}
.water-well.is-resting .water-well__head small{color:#c9cfd3}
.water-well.is-free{cursor:default;opacity:.85}
.water-well.is-free .water-well__head{padding-bottom:46px}
.water-well.is-free .water-well__head::after{content:"";order:3;width:78px;height:46px;margin-bottom:2px;border:2px dashed rgba(255,255,255,.3);border-radius:12px}
body .ui-game .ui-modal.water-well-dialog .ui-metrics,.ui-modal.water-well-dialog .ui-metrics{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px 16px}
@media(max-width:760px){.water-section{justify-content:flex-start;padding-left:62px}}

/* Extraction : chaque site est une scène illustrée (installation + coupe du sol). Le gisement occupe le bas de la scène ;
   un voile de roche le recouvre à mesure que la réserve s'épuise, le % reste lisible dessus. */
.mine-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}
.mine-site{position:relative;min-width:0}
.mine-site__scene{--dz-top:55%;--dz-h:35%;position:relative;display:block;width:100%;aspect-ratio:178/743;padding:0;overflow:hidden;border:0;border-radius:var(--radius);background:var(--scene) center/100% 100% no-repeat,var(--surface-sunken);color:#fff;text-align:left;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .2s}
.mine-site--petrole .mine-site__scene{--dz-top:58%;--dz-h:18%}
.mine-site--diamant .mine-site__scene{--dz-top:58%;--dz-h:34%}
.mine-site--gaz .mine-site__scene{--dz-top:61%;--dz-h:22%}
.mine-site--argile .mine-site__scene,.mine-site--marbre .mine-site__scene{--dz-top:52%;--dz-h:38%}
.mine-site__scene:is(:hover,:focus-visible){border-color:var(--accent);box-shadow:0 10px 24px rgba(0,0,0,.4);transform:translateY(-2px)}
.mine-site__head{position:absolute;z-index:2;top:6px;left:50%;display:grid;justify-items:center;gap:2px;max-width:calc(100% - 12px);padding:5px 10px;border:1px solid var(--shell-border);border-radius:10px;background:rgba(17,22,19,.82);text-align:center;transform:translateX(-50%)}
.mine-site__head b{color:#fff;font:900 11px/1.2 var(--font-body);white-space:nowrap}
.mine-site__head em{color:#9fe0a6;font:800 10px/1.2 var(--font-body);font-style:normal;white-space:nowrap}
.mine-site__stock{position:absolute;z-index:2;left:50%;bottom:10px;display:grid;justify-items:center;gap:4px;transform:translateX(-50%)}
.mine-site__stock>*{padding:4px 11px;border:1px solid color-mix(in srgb,var(--ore) 50%,#fff);border-radius:10px;background:rgba(8,14,22,.85);white-space:nowrap}
.mine-site__stock b{font:900 13px/1 var(--font-body)}
.mine-site__stock small{color:var(--ink-soft);font:800 10px/1 var(--font-body)}
.mine-site.is-depleted .mine-site__scene{filter:grayscale(.85) brightness(.8)}
.mine-site:is(.is-depleted,.is-listed) .mine-site__head em{color:#e7b2a4}
.mine-site.can-deepen .mine-site__stock b{animation:mine-deepen 1.6s ease-in-out infinite}
@keyframes mine-deepen{50%{box-shadow:0 0 18px rgba(224,165,116,.8)}}
body .ui-game .ui-modal.mine-dialog .ui-metrics,.ui-modal.mine-dialog .ui-metrics{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px 16px}

/* Prospection : mêmes cartes que les sites. La tête de forage descend le long du tubage avec l'avancement réel. */
.survey-card{aspect-ratio:178/743;background:var(--scene) center/100% 100% no-repeat,var(--surface-sunken)}
.survey-card.is-drilling{cursor:default}
.survey-card.is-drilling:hover{transform:none;box-shadow:none}
.survey-card__bit{position:absolute;left:68.4%;top:37%;width:18px;height:18px;border-radius:50%;background:radial-gradient(circle,#fff6c8,#ffb347 45%,rgba(255,140,40,0) 72%);box-shadow:0 0 16px 6px rgba(255,160,60,.65);transform:translate(-50%,-50%);animation:survey-bit calc(var(--total) * 1s) linear forwards,survey-spark .5s ease-in-out infinite alternate;animation-delay:calc(var(--elapsed) * -1s),0s}
@keyframes survey-bit{to{top:83%}}
@keyframes survey-spark{to{opacity:.55;scale:.8}}
.survey-card.is-found .mine-site__head em{color:#ffd76a}
.survey-card.is-found{animation:survey-found 1.8s ease-in-out infinite}
@keyframes survey-found{50%{box-shadow:0 0 0 2px #ffd76a,0 0 22px rgba(255,215,106,.55)}}
.survey-card.is-free{opacity:.9}
.survey-card.is-free:is(:hover,:focus-visible){opacity:1}
.survey-families{margin:16px 18px}
.survey-families>article{min-height:78px;padding-block:12px}
.survey-families .ui-table-cell strong{font-size:15px}
.survey-families .ui-table-cell small{margin-top:3px;font-size:12px;line-height:1.4}
.survey-families__icon{display:grid;place-items:center;width:46px;height:46px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2);font-size:24px}
.survey-families__cost{text-align:right}
.survey-families__cost strong{font-size:16px}
.survey-families .ui-btn{min-height:40px}

/* Sprites produits dans la chaîne d'usine et la fenêtre de recette : taille relative à l'icône. */
:is(.asset-card__inputs>i,.asset-card__output,.recipe-flow-line i)>[class*="-sprite"]{width:1.5em;height:1.5em}
/* Thème sombre : vue carte et mobile (classe posée par layouts/game.twig), une seule définition des couleurs. */
:is(.ui-game--map,.ui-game--dark) :is(.ui-game-column,.ui-game>dialog,dialog.product-info-dialog,section.ui-chat){
  --surface:#232c27;--surface-2:#29332e;--surface-3:#2f3a34;--surface-sunken:#1b221f;
  --border:#36413b;--border-strong:#48544d;
  --ink:#e8ebe5;--ink-soft:#b4bcb5;--ink-mute:#8f9890;
  --accent-soft:#3d2e21;
  --positive:#5fb86b;--positive-dark:#8fd49a;--positive-soft:#1f3324;--positive-border:#3b5e3f;
  --negative:#e27a60;--negative-dark:#f2a08b;--negative-soft:#3b2521;
  --warning:#e2ab4c;--warning-soft:#3a3121;--water-soft:#1d2b33;--water-border:#2f4652;
  --shadow:0 1px 2px rgba(0,0,0,.35);--shadow-lift:0 4px 12px rgba(0,0,0,.4);
  color-scheme:dark}
:is(.ui-game--map,.ui-game--dark) :is(.ui-game-column,.ui-game>dialog,dialog.product-info-dialog,section.ui-chat) :is(input,select,textarea){background-color:var(--surface-sunken);color:var(--ink);border-color:var(--border-strong)}
/* Modales : une seule version resserrée (marge intérieure de 16 px), carte, classique et mobile. */
body .ui-game .ui-modal .ui-modal-header{padding:10px 16px}
body .ui-game .ui-modal .ui-modal-title{font-size:17px}
body .ui-game .ui-modal .ui-status{min-height:0;padding:7px 10px}
body .ui-game .ui-modal .ui-modal-action-card{padding:7px 10px}
body .ui-game .ui-modal .ui-action-stack{gap:6px}
body .ui-game .ui-modal .ui-equipment-list{gap:6px}
body .ui-game .ui-modal .ui-equipment-item{grid-template-columns:28px minmax(0,1fr) auto;gap:8px;min-height:0;padding:7px 10px}
body .ui-game .ui-modal .ui-equipment-item>span:first-child{width:28px;min-width:28px;font-size:18px}
body .ui-game .ui-modal .ui-equipment-item small{line-height:1.25}
body .ui-game .ui-modal .ui-modal-body{gap:10px;padding:12px 16px}
body .ui-game .ui-modal .ui-metrics{gap:6px}
body .ui-game .ui-modal .ui-modal-footer{margin-top:10px;padding:8px 16px}
body .ui-game .ui-modal :is(.ui-modal-action-card,.ui-equipment-item) .ui-btn{height:30px;min-height:30px;padding:0 12px;font-size:12px}
body .ui-game .ui-modal .ui-modal-shell>:is(.ui-status,.ui-modal-section),body .ui-game .ui-modal .ui-modal-shell>form>:is(.ui-status,.ui-modal-section){margin:8px 16px 0}
/* La croix reçoit le focus à l'ouverture de chaque fenêtre : pas de cadre orange pour ça. */
body .ui-game .ui-modal .ui-modal-close:focus{outline:none}
