/* =============================================================================
   OPTIONS, COMMANDES et COMPTE, habillage de la home (home-arena.css et voisins) : la plage floutée,
   des autocollants crème et marine, la menthe pour la ligne choisie. Seul l'habillage change :
   structure et comportement restent ceux de index-arcade.pug et arcade-home.js. Le préfixe
   .arcade-cabinet #arcade-panel-… passe devant l'habillage commun des contrôles (game-controls.css).
   ============================================================================= */

.arcade-home-body .arcade-cabinet:has(:is(#arcade-panel-options, #arcade-panel-controls, #arcade-panel-account):not([hidden])) :is(
  .arcade-menu-nav, .home-player-stage, .home-title-header, .arcade-hud-account, .arcade-challenges,
  .arcade-attract .home-bottom-bar > .language-switcher, .arcade-selection-hint
) { visibility: hidden; }

body.arcade-home-body .arcade-cabinet :is(#arcade-panel-options, #arcade-panel-controls, #arcade-panel-account) {
  background: var(--panel-veil);
  color: var(--home-white);

  /* En-tête : titre et logo comme la home, Retour en pastille marine. */
  .arcade-page-header { border-bottom: 0; padding-bottom: 0; }
  .arcade-page-header .arcade-page-title {
    color: var(--home-white); font: clamp(22px, 4.4cqh, 38px)/1 var(--game-display-font); letter-spacing: .02em;
    -webkit-text-stroke: .16em var(--home-outline); paint-order: stroke fill; text-shadow: 0 .09em 0 var(--home-outline);
  }
  .arcade-page-header .game-brand {
    filter: drop-shadow(2px 0 0 var(--home-outline)) drop-shadow(-2px 0 0 var(--home-outline))
      drop-shadow(0 2px 0 var(--home-outline)) drop-shadow(0 -2px 0 var(--home-outline)) drop-shadow(0 .5cqh 0 var(--home-outline));
  }
  .arcade-page-header .arcade-page-back {
    display: inline-flex; align-items: center; gap: .8cqw;
    min-height: clamp(36px, 5.6cqh, 44px); padding: 0 1.6cqw; box-sizing: border-box;
    border: var(--btn-edge) solid var(--slab-edge); border-radius: 999px;
    background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom)) padding-box;
    box-shadow: inset 0 .35cqh 0 rgb(255 255 255 / .3), inset 0 -.7cqh 0 var(--slab-base); --drop-soft: var(--btn-soft);
    color: var(--home-white); font: clamp(14px, 2.4cqh, 20px)/1 var(--game-display-font); letter-spacing: .03em; text-transform: uppercase;
    filter: var(--drop-soft) var(--fx, );
    &::after { content: none; }
    kbd { color: var(--home-steel); font-size: 12px; }
    &:is(:hover, :focus-visible, .is-selected) { --fx: brightness(1.12); --drop-soft: var(--btn-soft-hover); background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom)) padding-box; color: var(--home-white); outline: 0; transform: none; translate: 0 -2px; }
    &:active { translate: 0 2px; --drop-soft: var(--btn-soft-press); }
  }
}

/* ================================================================== OPTIONS */
body.arcade-home-body .arcade-cabinet #arcade-panel-options {
  .arcade-system-list { gap: 8px; }
  /* Chaque réglage est un bouton crème : icône dans une pastille, valeur à droite. */
  .arcade-system-row {
    --row-top: var(--block-top); --row-bottom: var(--block-bottom); --row-base: var(--block-base); --row-edge: var(--block-edge);
    min-height: 40px; padding: 8px 16px; box-sizing: border-box;
    border: var(--btn-edge) solid var(--row-edge); border-radius: 1cqh;
    background: linear-gradient(180deg, var(--row-top), var(--row-bottom)) padding-box;
    box-shadow: inset 0 .35cqh 0 rgb(255 255 255 / var(--block-gloss)), inset 0 -.8cqh 0 var(--row-base);
    color: var(--block-ink); filter: var(--btn-soft);
    transition: translate 160ms cubic-bezier(0.22, 1, 0.36, 1);
    &::after { content: none; }
    &:is(:hover, .is-selected, :focus-visible) {
      --row-top: var(--mint-top); --row-bottom: var(--mint-bottom); --row-base: var(--mint-base); --row-edge: var(--mint-ink);
      filter: var(--btn-soft-hover);
      background: linear-gradient(180deg, var(--row-top), var(--row-bottom)) padding-box;
      color: var(--block-ink); outline: 0; translate: 0 -2px;
    }
    @media (prefers-reduced-motion: reduce) { transition: none; }
  }
  /* The 32px pixel icon (arcade-ui.css .pixel-icon-32) in a neutral 40px chip, so its colours read. */
  .arcade-system-icon {
    flex: none; width: 40px; height: 40px; box-sizing: border-box;
    border: 1px solid var(--block-edge); border-radius: 8px;
    background-color: var(--block-well);
  }
  .arcade-system-label { color: var(--block-ink); font-family: var(--game-display-font); letter-spacing: .01em; }
  /* Values in ink; only the chosen row's value takes the accent, the one gold thing on the list. */
  .arcade-system-value { color: var(--block-ink); font-family: var(--game-display-font); letter-spacing: .01em; }
  .arcade-system-arrows { color: var(--block-muted); }
  .arcade-system-row:is(.is-selected, :focus-visible) .arcade-system-value { color: var(--block-accent); }
  .arcade-system-row:is(:hover, .is-selected, :focus-visible) .arcade-system-arrows { color: var(--block-ink); }
  /* The toggles' dot: mint when the setting is on, muted when off (the sound row's aria-pressed means muted). */
  :is(#btn-arcade-sound[aria-pressed='false'], #btn-arcade-mouse[aria-pressed='true'], #btn-arcade-rumble[aria-pressed='true']) .arcade-system-arrows { color: var(--screen-mint); }

  /* Liens légaux : petites pastilles ; Supprimer le compte en simple lien, corail seulement au survol ou à la sélection. */
  .arcade-legal { gap: 10px; justify-content: center; }
  .arcade-legal :is(a, button) {
    padding: 4px 12px; border: var(--btn-edge) solid var(--slab-edge); border-radius: 8px;
    background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom)) padding-box; box-shadow: none;
    color: var(--home-white); font: clamp(12px, 1.9cqh, 16px)/1 var(--game-display-font); letter-spacing: .02em; text-decoration: none;
    filter: var(--btn-soft);
    &::after { content: none; }
    --control-ink: var(--home-white);
    &:is(:hover, .is-selected, :focus-visible) { background: linear-gradient(180deg, var(--slab-top), var(--slab-bottom)) padding-box; color: var(--home-white); outline: 0; translate: 0 -2px; filter: var(--btn-soft-hover) brightness(1.12); }
    /* arcade-clean.css greys #account-delete by its id at rest: the id is matched here too. */
    &:is(.is-danger, #account-delete) {
      --control-ink: var(--screen-muted); border-color: transparent; background: none; filter: none;
      color: var(--screen-muted); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
    }
    &:is(.is-danger, #account-delete):is(:hover, .is-selected, :focus-visible) {
      --control-ink: var(--screen-danger); background: none; color: var(--screen-danger); filter: none;
    }
  }
}

/* ================================================================ COMMANDES */
body.arcade-home-body .arcade-cabinet #arcade-panel-controls {
  /* La démo sur un panneau crème, les coups en boutons crème, les touches en touches de clavier. */
  /* The demo canvas keeps headroom for jumps: its top fifth is cropped under the panel's edge. */
  /* Stacked (narrow screens) it keeps its own height: its top fifth is cropped. Side by side it
     fills the panel's height and sits on its floor (arcade-clean.css), so no crop. */
  @media (max-width: 760px) { .controls-demo-canvas { margin-top: -12%; } }
  .controls-demo { overflow: hidden;
    border: .45cqh solid var(--home-outline); border-radius: 2cqh;
    background: linear-gradient(180deg, var(--block-top), var(--block-bottom)) padding-box;
    box-shadow: inset 0 .4cqh 0 rgb(255 255 255 / var(--block-gloss)), inset 0 -.9cqh 0 var(--block-base);
    filter: drop-shadow(0 .7cqh 0 var(--home-outline));
  }
  .arcade-keys { gap: 8px; }
  .arcade-key-row {
    --row-top: var(--block-top); --row-bottom: var(--block-bottom); --row-base: var(--block-base); --row-edge: var(--block-edge);
    padding: 8px 16px; box-sizing: border-box;
    border: var(--btn-edge) solid var(--row-edge); border-radius: 1cqh;
    background: linear-gradient(180deg, var(--row-top), var(--row-bottom)) padding-box;
    box-shadow: inset 0 .35cqh 0 rgb(255 255 255 / var(--block-gloss)), inset 0 -.8cqh 0 var(--row-base);
    color: var(--block-ink); filter: var(--btn-soft);
    transition: translate 160ms cubic-bezier(0.22, 1, 0.36, 1);
    &::after { content: none; }
    &:is(:hover, .is-selected, :focus-visible, .is-demo) {
      --row-top: var(--mint-top); --row-bottom: var(--mint-bottom); --row-base: var(--mint-base); --row-edge: var(--mint-ink);
      filter: var(--btn-soft-hover);
      background: linear-gradient(180deg, var(--row-top), var(--row-bottom)) padding-box;
      color: var(--block-ink); outline: 0;
    }
    /* Only a chosen row lifts: the demo's row stays in line, so the gaps of the list stay even. */
    &:is(:hover, .is-selected, :focus-visible) { translate: 0 -2px; }
    @media (prefers-reduced-motion: reduce) { transition: none; }
  }
  .arcade-key-name { color: var(--block-ink); font-family: var(--game-display-font); }
  .arcade-key-row:is(:hover, .is-selected, :focus-visible, .is-demo) .arcade-key-name { color: var(--block-ink); }
  .training-key-or { color: var(--block-muted); font-family: var(--game-display-font); }
  .arcade-key-caps kbd {
    display: inline-grid; place-items: center; min-width: 40px; padding: 4px 8px; box-sizing: border-box;
    border: var(--btn-edge) solid var(--home-outline); border-radius: .9cqh;
    background: linear-gradient(180deg, #ffffff, #e9e4d6); box-shadow: inset 0 -.4cqh 0 #c9c2b2;
    color: var(--home-outline); font-family: var(--game-display-font);
  }
}

/* ================================================================== COMPTE */
body.arcade-home-body .arcade-cabinet #arcade-panel-account {
  :is(.account-mode, .account-field-label, .auth-screen-label) { font-family: var(--game-display-font); }
}
