/* Portrait téléphone (var(--raise-3)) : la partie tient dans l'écran, cinq cibles au pouce, correction en panneau du bas. */
@media(max-width:599px){
  .topbar{height:48px;gap:8px}
  .topbar button,.topbar a,.mode-card,#retry,.game-screen #finish-run,.game-screen #back-results,.end-screen button,.end-screen a{min-width:44px;min-height:44px}
  .topbar a{display:flex;align-items:center}
  .home-button{font-size:17px;white-space:nowrap}
  .topbar>button,.site-nav a{flex-shrink:0}
  .topbar .sound-button{padding:0 10px;font-size:10px}
  /* Sous 400 px : le bouton son garde son icône seule (nom accessible porté par aria-label). */
  @media(max-width:479px){
    .topbar{gap:4px}
    .topbar .sound-button{padding-inline:8px}
    .topbar #profile{padding-inline:6px;font-size:9px;letter-spacing:0}
    .home-button{font-size:12px;letter-spacing:-1.1px}
    .site-nav{gap:4px}
    #sound-label{display:none}
  }
  @media(max-width:359px){
    .home-button{font-size:11px}
    .topbar .sound-button{padding-inline:6px}
  }
  .lobby-screen{padding:14px 0}
  .mode-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .mode-card{min-height:0;padding:14px 12px}
  .mode-card kbd{display:none}
  .mode-card h2{font-size:18px;margin:0 0 4px;max-width:none}
  .mode-card p{font-size:12px;margin:0 0 8px}
  .mode-card strong{font-size:14px}
  .mode-card small{font-size:11px;margin-top:4px}
  #nash-settings{gap:12px;padding:12px;margin-top:14px;font-size:14px}

  .shell:has(#game-screen:not([hidden])){height:100dvh;min-height:0;overflow:clip;padding:0 12px}
  #game-screen:not([hidden]){flex:1;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:6px;padding:6px 0}
  .game-screen .hud{height:44px;margin:0}
  .game-screen .hud .eyebrow{display:none}
  .game-screen .score-block strong{font-size:30px;letter-spacing:-2px;text-shadow:2px 2px 0 var(--gain)}
  .game-screen .clock-block strong{font-size:24px;line-height:1.2}
  .game-screen .time-track{width:80px}
  .game-screen .lives-block>div{font-size:20px;gap:4px;line-height:1.2}
  .game-screen .play-layout{min-height:0;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;gap:6px}
  .game-screen .arena{min-height:0;display:grid;grid-template-rows:24px minmax(0,1fr) auto}
  .game-screen .arena-top{height:24px}
  .game-screen .street-pill{font-size:16px}
  .game-screen .table-stage{height:auto;min-height:0}
  .game-screen .poker-table{inset:8% 0 6%}
  .game-screen .board{top:32%}
  .game-screen .card{width:44px;height:62px}
  .game-screen .hero-cards{top:64%}
  .game-screen .hero-cards .card{width:52px;height:73px}
  .game-screen .card-corner{left:4px;top:3px;font-size:13px}
  .game-screen .card-corner small{font-size:10px}
  .game-screen .card-bottom{display:none}
  .game-screen .card-suit{font-size:22px;transform:translateY(8px)}
  .game-screen .hero-cards .card-corner{font-size:15px}
  .game-screen .hero-cards .card-suit{font-size:28px}
  .game-screen .result-board .card{width:30px;height:42px}
  .game-screen .decision-area{padding-top:4px}
  .game-screen .situation{height:auto;gap:2px 10px;margin-bottom:6px}
  .game-screen .matchup{font-size:16px}
  .game-screen .effective>span{font-size:8px}
  .game-screen .effective>strong{font-size:18px}
  .game-screen .facing{font-size:16px}
  .game-screen .story-line{font-size:14px}
  .game-screen .actions{display:grid;grid-template-columns:repeat(var(--action-count,5),minmax(0,1fr));gap:5px;min-height:0}
  .game-screen .action{min-height:56px;padding:6px 4px;flex-direction:column;align-items:center;justify-content:center;text-align:center}
  .game-screen .action-label{font-size:12px;line-height:1.15;overflow-wrap:anywhere}
  .game-screen .action kbd{display:none}
  .game-screen .source-line{margin-top:4px;font-size:8px}
  .game-screen .coach{display:flex;flex-direction:row;align-items:center;gap:8px}
  .game-screen .combo-card{position:static;flex:1;padding:6px 10px;flex-wrap:nowrap}
  .game-screen .combo-card .eyebrow,.game-screen .combo-meter{display:none}
  .game-screen .combo-card>strong{font-size:22px}
  .game-screen .streak-footer{display:flex;flex:1}
  .game-screen #accuracy{white-space:nowrap}
  .game-screen #finish-run,.game-screen #back-results{margin:0 0 0 auto;padding:8px 16px}
  .game-screen .solver-panel{display:none}
  .correcting .game-screen .solver-panel:not([hidden]){display:block;position:fixed;left:0;right:0;bottom:64px;max-height:calc(50dvh - 64px);overflow:auto;overscroll-behavior:contain;z-index:30;border-radius:14px 14px 0 0;background:var(--raise-2);box-shadow:0 -10px 30px color-mix(in srgb,var(--shadow-ink) 60%,transparent)}
  /* Main suivante : la correction reste en bandeau compact au-dessus du pied de page, boutons d'action dégagés. */
  .game-screen .coach{flex-wrap:wrap}
  body:not(.correcting) .game-screen .solver-panel.has-result:not([hidden]){display:flex;flex:0 0 100%;order:-1;min-height:0;align-items:center;gap:10px;padding:4px 10px}
  body:not(.correcting) .game-screen .solver-panel.has-result #solver-result>:not(.result-top){display:none}
  body:not(.correcting) .game-screen .solver-panel.has-result .result-top{margin:0}
  body:not(.correcting) .game-screen .solver-panel.has-result .result-top>strong{font-size:18px}
  .correcting .game-screen #back-results:not([hidden]){position:fixed;right:12px;bottom:calc(50dvh + 8px);z-index:31}
  .rematch-key{display:none}
  .game-screen .result-top{margin-top:6px}
  .game-screen .result-top>strong{font-size:26px}
  .game-screen .loss{font-size:18px}
  .game-screen #mode-reveal{font-size:16px;margin:6px 0}
  .game-screen .mode-delta{font-size:18px}
  .game-screen .icm-verdict{font-size:18px}
  .game-screen .equity-value{font-size:26px;margin:8px 0}

  .opening{font-size:18px;gap:10px}
  .opening span{font-size:28px}
  .mode-pot{font-size:16px}
  .mode-pot b{font-size:30px}
  .mode-cards .card,.icm-cards .card{width:52px;height:73px}
  .icm-prizes{font-size:15px}
  .icm-seat{min-width:64px;padding:3px 6px}
  .icm-seat span{font-size:12px}
  .icm-seat b{font-size:20px}
  .icm-seat small,.icm-seat em{font-size:11px}
  .equity-duel{gap:10px;padding-top:10px}
  .equity-duel>div>b{font-size:20px;margin-bottom:4px}
  .equity-duel>strong{font-size:18px}
  .equity-duel .card{width:48px;height:67px}
  .equity-board{margin-top:10px}
  .equity-board .card{width:44px;height:62px}
}

@media(max-width:599px){
  #dismiss-correction{display:block;min-height:44px;padding:6px;border:1px solid var(--line);border-radius:6px;background:var(--raise);font-size:12px}
  .game-screen>#next-hand{position:fixed;left:12px;bottom:10px;width:auto;min-height:44px;z-index:31}
}

body[data-mode=fullhand] #dismiss-correction,body.reviewing #dismiss-correction{display:none}

@media(max-width:480px){
  #game-screen .clock-block{position:static;margin-left:auto;gap:0;flex-shrink:0}
  #game-screen .clock-block strong{font:500 12px/20px var(--mono);letter-spacing:0}
  #game-screen .clock-block .time-track{display:none}
  #game-screen .arena-top{height:auto;min-height:24px;gap:8px}
}

@media(max-width:700px){
  #mode-grid{scroll-snap-type:x mandatory;scroll-padding-inline:0}
  #mode-grid .mode-tile{scroll-snap-align:start;scroll-snap-stop:always}
}
@media(max-width:700px){
  #mode-grid::after{content:'';flex:0 0 100%}
  #mode-grid{mask-image:linear-gradient(to right,#000 calc(100% - 20px),transparent)}
}
@media(max-width:480px) and (max-height:600px){
  #game-screen .arena-top{height:16px;min-height:16px;margin-bottom:2px}
  #game-screen .clock-block strong{font:500 12px/16px var(--mono)}
}
