/* Simple main menu: "Spielen" and "Tutorial" up front, settings small below.
   "Spielen" opens a choice of quick match, campaign and online multiplayer;
   quick match and online then ask for singles or doubles with two big cards. */

/* Home */
#app #welcome .home-links{grid-template-columns:repeat(6,minmax(0,1fr))}
#app #welcome .home-links #start,#app #welcome .home-links #show-howto{grid-column:span 3}
#app #welcome .home-links #show-howto{--comic-face:var(--comic-back)}
#app #welcome .home-links #first-play-hint:not([hidden])+.howto-home-note{display:none}
#app #welcome .home-links .howto-home-note{color:#39515A}
#app #welcome .home-links #open-settings{grid-column:3 / span 2;justify-self:center;width:100%;height:64px;min-height:64px;max-height:64px;padding:10px 16%;font-size:15px;gap:8px;justify-content:center}
#app #welcome .home-links #open-settings svg{width:20px;height:20px}

/* Same comic court behind the new choice screens as behind the other menus. */
#app:has(:is(#play-screen,#team-screen):not([hidden]))::after{
  content:"";position:absolute;inset:0;z-index:4;pointer-events:none;
  background:radial-gradient(ellipse at 50% 45%,#0B1A1838 0,#0B1A18b8 80%),
    url('../opponents/selection-court-comic-v2.webp') center 62%/cover no-repeat,#10251F}
#app :is(#play-screen,#team-screen).screen{backdrop-filter:none}

/* Cards: figures on top, comic sign below (same parts as the tutorial choice). */
#app .play-art,#app .multiplayer-button>.play-art{position:relative;display:flex;flex-direction:row;align-items:flex-end;justify-content:center;gap:2%;padding:0 6%;box-sizing:border-box}
#app .play-art img{display:block;width:auto;height:88%;max-width:46%;object-fit:contain;filter:drop-shadow(0 6px 0 #0006)}
#app .play-art .play-flip{transform:scaleX(-1)}
#app .play-vs{align-self:center;flex-shrink:0;padding:6px 10px 4px;border:3px solid #0B1A18;border-radius:12px;background:#ffc744;color:#0B1A18;font-family:var(--font-display);font-size:22px;line-height:1;transform:rotate(-6deg);box-shadow:0 4px 0 #0B1A18}
#app .play-art-tour img{height:100%;max-width:none}
#app .play-art-tour .play-tour-node{position:absolute;left:50%;bottom:6%;height:58%;transform:translateX(-50%)}
#app .play-art-online img{max-width:40%}
#app .play-code{align-self:center;flex-shrink:0;padding:6px 10px;border:3px solid #0B1A18;border-radius:10px;background:#fff1d6;color:#0B1A18;font-family:var(--font-ui);font-size:16px;font-weight:900;letter-spacing:2px;box-shadow:0 4px 0 #0B1A18;transform:rotate(4deg)}
#app .play-kicker,#app .team-badge{align-self:flex-start;padding:3px 9px;border:2px solid #0B1A18;border-radius:999px;background:#ffc744;color:#0B1A18;font-family:var(--font-ui);font-size:12px;font-weight:900;letter-spacing:.4px;line-height:1.3;text-transform:uppercase}
#app #start-tour .learning-choice-copy{background-image:url('./training/sign-advanced-v1.png');padding-bottom:70px}
#app #play-online .learning-choice-copy{background-image:url('./training/sign-machine-v1.png')}
#app #play-screen .learning-choice-card strong,#app #team-screen .learning-choice-card strong{font-size:24px}

/* Singles or doubles: two big cards, the current choice is marked. */
#app #team-screen .team-eyebrow{color:#ffc744;font-family:var(--font-ui);font-size:14px;font-weight:900;letter-spacing:1.5px;text-transform:uppercase;text-align:center}
#app #team-screen .team-options{grid-template-columns:repeat(2,minmax(0,1fr));width:min(900px,100%);gap:28px}
#app #team-screen .learning-choice-card{grid-template-rows:210px 1fr}
#app #team-screen .play-art{height:210px}
#app #team-screen .team-side{display:flex;align-items:flex-end;justify-content:center;height:100%;min-width:0;flex:1}
#app #team-screen .team-side img{max-width:100%;height:84%}
#app #team-screen .team-art-doubles .team-side img{max-width:60%;height:80%}
#app #team-screen .team-art-doubles .team-side img+img{margin-left:-14%}
#app #team-screen .play-vs{font-size:26px}
#app #team-screen .learning-choice-copy strong{font-size:30px}
#app #team-screen [data-team-size="doubles"] .learning-choice-copy{background-image:url('./training/sign-machine-v1.png')}
#app #team-screen .team-card[data-current="true"] .learning-choice-copy::after{content:"✓";position:absolute;top:22%;right:16%;display:grid;place-items:center;width:30px;height:30px;border:3px solid #0B1A18;border-radius:50%;background:#c8f06c;color:#0B1A18;font:900 16px/1 var(--font-ui)}
#app #team-screen .learning-choice-copy{position:relative}
#app #team-screen .howto-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px 24px}
#app #team-screen #team-have-code{height:56px;min-height:56px;padding:14px 32px;color:#0B1A18;font-family:var(--font-ui);font-size:14px;font-weight:800;line-height:1.2;text-decoration:none}
#app #team-screen #team-have-code[hidden]{display:none}
#app :is(#play-screen,#team-screen) button:focus-visible{outline:3px solid #ffd991;outline-offset:3px}

/* Match setup: singles/doubles was chosen one screen earlier. */
#app #length-screen .team-size-buttons{display:none}
#app #length-screen .event-card[hidden]{display:none}
#app #length-screen .length-options .event-options:has(.event-card[hidden]){grid-template-columns:minmax(0,560px);justify-content:center}

/* Online lobby: the court buttons are not .arena-option, so they had no comic frame. */
#app .online-choice [data-arena="clay"]{background:transparent url('./comic-controls-neutral/phone-cards-1.webp') center/contain no-repeat}
#app .online-choice [data-arena="hard"]{background:transparent url('./comic-controls-neutral/phone-cards-2.webp') center/contain no-repeat}
#app .online-choice [data-arena="grass"]{background:transparent url('./comic-controls-neutral/phone-cards-3.webp') center/contain no-repeat}
/* Small 1v1/2v2 switch in the lobby: label above its note, like the other lobby buttons. */
#app #online-panel .online-team-size button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;min-width:0;line-height:1.25;text-align:center}
#app #online-panel .online-team-size small{display:block;margin:0;font-size:11px;font-weight:700;line-height:1.35}

/* Phones and short landscape screens. */
@media(max-width:760px){
  #app #welcome .home-links{grid-template-columns:1fr;grid-template-rows:minmax(0,1.25fr) minmax(0,1fr) auto;max-height:400px}
  #app #welcome .home-links #start,#app #welcome .home-links #show-howto{grid-column:1}
  #app #welcome .home-links #open-settings{grid-column:1;width:min(260px,100%);height:56px;min-height:56px;max-height:56px;padding:8px 14%;font-size:14px}
  #app #team-screen .team-options{grid-template-columns:1fr}
}
@media(max-width:760px),(orientation:landscape) and (max-height:540px){
  #app :is(#play-screen,#team-screen){display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;gap:8px;padding:calc(60px + env(safe-area-inset-top)) 16px calc(10px + env(safe-area-inset-bottom));overflow:hidden}
  #app #team-screen{grid-template-rows:auto auto auto minmax(0,1fr) auto}
  #app :is(#play-screen,#team-screen) h2{font-size:23px;line-height:1.2;margin:0;text-wrap:balance;text-align:center}
  #app :is(#play-screen,#team-screen) .learning-choice-intro{font-size:12px;line-height:1.3}
  #app #team-screen .team-eyebrow{font-size:11px}
  #app :is(#play-screen,#team-screen) .learning-choice-options{width:min(460px,100%);height:100%;min-height:0;align-self:stretch;grid-template-columns:1fr;grid-auto-rows:minmax(0,1fr);gap:10px;margin:0 auto}
  #app :is(#play-screen,#team-screen) .learning-choice-card{position:relative;isolation:isolate;min-height:0;height:100%;grid-template-columns:96px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:10px;padding:16px 20px 14px;background:transparent url('./comic-controls-neutral/phone-cards-1.webp') center/100% 100% no-repeat;align-items:center}
  #app :is(#play-screen,#team-screen) .play-art{width:96px;height:72px;padding:0;gap:0}
  #app :is(#play-screen,#team-screen) .play-vs{padding:3px 4px 2px;font-size:12px;border-width:2px;border-radius:7px;box-shadow:0 2px 0 #0B1A18}
  #app :is(#play-screen,#team-screen) .play-code{padding:2px 3px;font-size:9px;letter-spacing:0;border-width:2px;box-shadow:none}
  #app :is(#play-screen,#team-screen) .learning-choice-copy,#app #team-screen [data-team-size] .learning-choice-copy{min-height:0;padding:0;background:none;gap:4px}
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:19px;line-height:1.2}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{font-size:12px;line-height:1.3}
  #app :is(#play-screen,#team-screen) .learning-choice-copy b{display:none}
  #app :is(#play-screen,#team-screen) :is(.play-kicker,.team-badge){font-size:10px;padding:1px 7px}
  #app #team-screen .learning-choice-card{grid-template-rows:minmax(0,1fr);grid-template-columns:120px minmax(0,1fr)}
  #app #team-screen .play-art{width:120px;height:90px}
  #app #team-screen .learning-choice-copy strong{font-size:24px}
  #app #team-screen .team-card[data-current="true"] .learning-choice-copy::after{top:0;right:0;width:24px;height:24px;font-size:13px}
  #app :is(#play-screen,#team-screen) .howto-actions{padding:0;margin:0 auto;width:min(340px,100%)}
  #app :is(#play-screen,#team-screen) .howto-actions .menu-button{height:52px;min-height:52px;padding:12px 28px;font-size:14px}
  #app #team-screen .howto-actions:has(#team-have-code:not([hidden])){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);gap:8px;width:min(460px,100%)}
  #app #team-screen .howto-actions:has(#team-have-code:not([hidden])) :is(.menu-button,#team-have-code){width:100%;min-width:0;height:52px;min-height:52px;padding:10px 12px;font-size:13px;white-space:normal}
}
@media(orientation:landscape) and (max-height:540px){
  #app :is(#play-screen,#team-screen){padding-top:calc(52px + env(safe-area-inset-top));gap:4px}
  #app :is(#play-screen,#team-screen) .learning-choice-intro{display:none}
  #app #team-screen{grid-template-rows:auto auto minmax(0,1fr) auto}
  #app :is(#play-screen,#team-screen) .learning-choice-options{width:min(900px,100%);grid-template-columns:repeat(auto-fit,minmax(0,1fr));grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
  #app :is(#play-screen,#team-screen) .learning-choice-card{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;padding:18px 16px 34px;justify-items:center;text-align:center}
  #app :is(#play-screen,#team-screen) .play-art{width:100%;height:100%;min-height:0;max-height:110px}
  #app :is(#play-screen,#team-screen) .learning-choice-copy{align-items:center}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{display:none}
  #app :is(#play-screen,#team-screen) :is(.play-kicker,.team-badge){align-self:center}
  #app #welcome .home-links{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:minmax(0,120px) auto;align-content:center}
  #app #welcome .home-links #start,#app #welcome .home-links #show-howto{grid-column:span 3}
  #app #welcome .home-links #open-settings{grid-column:2 / span 4;height:48px;min-height:48px;max-height:48px}
}

/* ===== Menu refresh (Oct 2026): calm home, equal main buttons, matching mode cards. =====
   Loaded last; the selectors deliberately out-rank the older layered home/play rules. */

/* Home: three equally sized buttons stacked; level and account as quiet chips below. */
#app #welcome{--menu-btn-h:clamp(80px,12dvh,108px);--menu-btn-w:min(100%,calc(var(--menu-btn-h) * 3.4));gap:clamp(10px,2.2dvh,20px);justify-content:safe center}
#app #welcome .screen-head .logo .game-logo{width:min(300px,30dvh,74vw)}
#app #welcome .home-links{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(4,var(--menu-btn-h));gap:clamp(8px,1.6dvh,14px);width:var(--menu-btn-w);height:auto;max-height:none;flex:none;order:1}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment){grid-column:1;grid-row:auto;justify-self:stretch;width:100%;height:var(--menu-btn-h);min-height:0;max-height:none;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:12px;padding:0 15%;font-size:clamp(18px,2.6dvh,23px);line-height:1.2;text-align:left}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment) .home-button-copy{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;height:auto;line-height:1.2}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment) .home-button-copy small{font-size:12px;line-height:1.3}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment)>svg{flex:none;width:26px;height:26px}
/* Same box for all three, but each keeps its hand-drawn comic face (that is the game's look).
   Padding keeps the copy inside the slanted ends and above the thick bottom rim.
   (Paths are written out here: a url() inside a custom property resolves against the file using it.) */
#app #welcome .home-links #show-howto{--home-face:url('./comic-controls-neutral/help.webp')}
#app #welcome .home-links #open-settings{--home-face:url('./comic-controls-neutral/settings.webp')}
#app #welcome .home-links #open-equipment{--home-face:url('./comic-controls-neutral/multiplayer.webp')}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment){position:relative;isolation:isolate;padding:0 13% 7px 12%;border:0;border-radius:0;background:transparent var(--home-face,none) center/100% 100% no-repeat;color:var(--brand-ink);box-shadow:none;filter:drop-shadow(0 5px 0 #0007)}
#app #welcome .home-links #start{background:none}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment):hover:not(:disabled){filter:drop-shadow(0 5px 0 #0007) brightness(1.05)}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment):active:not(:disabled){filter:drop-shadow(0 2px 0 #0007);transform:translateY(3px)}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment) .home-button-copy small{color:#4a3b2a}
#app #welcome .home-links #start .home-button-copy small{color:#5a2c08}
#app #welcome .home-links #show-howto .howto-home-note{display:block}
#app #welcome .home-links #show-howto #first-play-hint:not([hidden]){display:block;color:#85500A}
#app #welcome .home-links #show-howto #first-play-hint:not([hidden])+.howto-home-note{display:none}
#app #welcome .home-progress-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;width:var(--menu-btn-w);order:2}
#app #welcome .home-progress-row :is(#player-progress,#game-account-open){display:inline-flex;align-items:center;gap:8px;width:auto;min-width:0;max-width:100%;height:40px;min-height:40px;padding:0 14px 0 6px;border:1.5px solid #ffffff2e;border-radius:999px;background:#0B1A18b8;color:#fff1d8;box-shadow:none;font:800 13px/1.2 var(--font-ui);text-align:left}
#app #welcome .home-progress-row #game-account-open{padding-left:12px}
#app #welcome .home-progress-row :is(#player-progress,#game-account-open):hover{background:#173a33d9;filter:none}
#app #welcome .home-progress-row .xp-badge{width:30px;height:30px;flex:none;border:0;box-shadow:none;background:none}
#app #welcome .home-progress-row .xp-badge img{width:100%;height:100%;display:block}
#app #welcome .home-progress-row .xp-home-copy{display:flex;flex-direction:column;gap:3px;min-width:0}
#app #welcome .home-progress-row .xp-home-copy strong,#app #welcome .home-progress-row .account-entry strong{font:800 13px/1.2 var(--font-ui);color:#fff1d8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#app #welcome .home-progress-row .xp-home-track{display:block;width:100%;height:3px;background:#ffffff26}
#app #welcome .home-progress-row :is(.xp-home-copy small,.xp-home-discover,.account-entry small,.account-entry-arrow),#app #welcome .home-progress-row #player-progress>span[aria-hidden="true"]:last-child{display:none}
#app #welcome .home-progress-row .account-entry>span:not(.account-entry-arrow){display:block}
#app #welcome .home-progress-row .account-entry>svg{width:18px;height:18px;flex:none;color:#f3cb69}
#app #welcome .install-game{order:3}
#app #welcome .presented{order:4}

/* No zoom feedback anywhere in the menus: selection state is enough. */
#app .picked,#app .diff-card.picked{animation:none}
#app .comic-arrow:active{transform:translateY(1px)}
#app #online-panel .lobby-bot:active{transform:translateY(1px)}
/* Only a very short fade when a menu screen appears. */
@keyframes menu-screen-fade{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:no-preference){
  #app :is(#welcome,#play-screen,#team-screen,#learning-choice,#length-screen,#character-screen,#opponent-screen,#difficulty-screen,#arena-screen):not([hidden]){animation:menu-screen-fade .12s ease-out}
}

/* Mode choice: equal cards. The figures stand on the top edge of a hand-drawn comic sign
   (same parts as the tutorial choice), so picture and card read as one object. */
#app :is(#play-screen,#team-screen) .learning-choice-card{--card-sign:url('./training/sign-first-v1.webp');position:relative;display:flex;flex-direction:column;align-items:stretch;width:100%;height:100%;min-width:0;padding:0;overflow:visible;border:0;border-radius:0;background:none;color:var(--brand-ink);box-shadow:none;text-align:left;white-space:normal;transform:none}
#app :is(#play-screen,#team-screen) .learning-choice-card:hover{filter:brightness(1.05)}
#app #play-screen #start-tour,#app #team-screen [data-team-size="doubles"]{--card-sign:url('./training/sign-advanced-v1.webp')}
#app #play-screen #play-online{--card-sign:url('./training/sign-machine-v1.webp')}
#app :is(#play-screen,#team-screen) .play-art{position:relative;z-index:1;flex:none;width:100%;height:clamp(140px,22dvh,190px);max-height:none;margin:0 0 -30px;padding:0 6%;overflow:visible;border:0;background:radial-gradient(ellipse 48% 13% at 50% 90%,#0008,transparent 70%)}
#app #play-screen .play-art img{height:92%;max-width:44%}
#app #play-screen .play-art-online{gap:4%}
#app #play-screen .play-art-online img{max-width:34%;height:86%}
#app #play-screen .play-art-tour{padding:8px}
/* The match scoreboard has no business on menu screens. */
#app:has(:is(#play-screen,#team-screen,#learning-choice,#length-screen,#character-screen,#difficulty-screen,#arena-screen):not([hidden])) .scoreboard{display:none}
#app #play-screen .play-art-tour img{height:100%;max-width:none}
#app #play-screen .play-art-tour .play-tour-node{height:58%;bottom:6%}
#app :is(#play-screen,#team-screen) .learning-choice-copy,#app #team-screen [data-team-size] .learning-choice-copy{position:relative;display:flex;flex:1;flex-direction:column;justify-content:center;align-items:flex-start;gap:6px;min-height:0;padding:42px 12% 38px 12%;background:transparent var(--card-sign) center/100% 100% no-repeat;filter:drop-shadow(0 6px 0 #0007)}
#app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:clamp(19px,2.7dvh,24px);line-height:1.15}
#app :is(#play-screen,#team-screen) .learning-choice-copy small{display:block;font-size:14px;line-height:1.4;color:#39443f}
#app #play-screen .learning-choice-copy b{display:inline-flex;align-items:center;margin-top:4px;padding:5px 11px;border:3px solid var(--brand-ink);border-radius:14px 9px 15px 10px;background:#ffc744;color:var(--brand-ink);box-shadow:0 3px 0 var(--brand-ink);font:900 12.5px/1.2 var(--font-ui);white-space:nowrap;text-decoration:none;transform:rotate(-1.5deg)}
#app :is(#play-screen,#team-screen) :is(.play-kicker,.team-badge){position:static;align-self:flex-start;box-shadow:0 2px 0 var(--brand-ink);transform:rotate(-2deg)}
/* Current choice: the same ball-yellow outline the other menu picks use. */
#app #team-screen .team-card[data-current="true"] .learning-choice-copy{filter:drop-shadow(3px 0 0 var(--brand-ball)) drop-shadow(-3px 0 0 var(--brand-ball)) drop-shadow(0 3px 0 var(--brand-ball)) drop-shadow(0 -3px 0 var(--brand-ball)) drop-shadow(0 6px 0 #0007)}
#app #team-screen .team-card[data-current="true"] .learning-choice-copy::after{top:30px;right:12%;left:auto}
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app :is(#play-screen,#team-screen){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(10px,2dvh,18px);padding:72px 32px 28px;overflow:auto}
  #app :is(#play-screen,#team-screen) h2{margin:0}
  #app :is(#play-screen,#team-screen) .learning-choice-intro{margin:-6px 0 4px}
  #app #play-screen .play-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:auto;align-items:stretch;gap:24px;width:min(1080px,100%);height:auto}
  #app #team-screen .team-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;align-items:stretch;gap:24px;width:min(820px,100%);height:auto}
  #app :is(#play-screen,#team-screen) .learning-choice-card{min-height:clamp(290px,44dvh,380px)}
  #app #team-screen .play-art{height:clamp(150px,26dvh,220px)}
}
/* Doubles setup: the line-up below already shows all four players, so the duel
   picture (only two of them) goes and the partner/opponent pickers fit on screen. */
@media(max-width:760px) and (orientation:portrait){
  /* The small "1 gegen 1 / 2 gegen 2" stamp sat on top of the title; the title says it already. */
  #app #length-screen .event-card .event-stamp{display:none}
}
@media(min-width:761px) and (min-height:541px){
  #app #length-screen:has(#doubles-lineup:not([hidden])) .event-card[data-event="match"] .event-art{display:none}
  /* Doubles is the only event here and was chosen one screen earlier: no extra
     event card; line-up, length and both footer buttons fit without scrolling. */
  #app #length-screen:has(#doubles-lineup:not([hidden])) .length-options>.event-options{display:none}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .length-options{justify-content:safe center}
  #app #length-screen:has(#doubles-lineup:not([hidden])) #team-size-note{width:auto;max-width:900px;margin:0 auto;font-size:12px;line-height:1.4}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .doubles-lineup{margin:6px 0 0}
  #app #length-screen:has(#doubles-lineup:not([hidden])) #duration-note{display:none}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .duration-head{margin-top:14px}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .format-options .choice-pick{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto;align-content:center;align-items:center;gap:10px;height:76px;min-height:76px;padding:18px 62px 16px 40px;text-align:left}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .format-options .choice-pick :is(.format-kicker,.format-scope){display:none}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .format-options .choice-pick strong{grid-column:1;grid-row:1;justify-self:start;font-size:18px;line-height:1.2;white-space:nowrap}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .format-options .choice-pick small{grid-column:2;grid-row:1;font-size:13px;line-height:1.2;text-align:right}
}
/* Short landscape phones: the two-column singles grid has no slot for the line-up,
   so doubles becomes one scrolling column without overlaps. */
@media(orientation:landscape) and (max-height:540px){
  #app #length-screen:has(#doubles-lineup:not([hidden])) .length-options{display:flex;flex-direction:column;align-items:stretch;gap:8px;overflow-x:hidden;overflow-y:auto}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .length-options>*{flex:none;grid-column:auto;grid-row:auto}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .length-options>.event-options{display:none}
  #app #length-screen:has(#doubles-lineup:not([hidden])) #team-size-note{display:none}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .doubles-lineup{margin:0;gap:8px}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .lineup-face{width:44px;height:44px}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .lineup-card{padding:6px 4px;gap:2px}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .lineup-vs{width:40px;height:40px;font-size:15px;margin-top:20px}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .duration-head{text-align:center}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .format-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:none;gap:6px}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .format-options button{height:48px;min-height:48px;padding:8px 30px 8px 20px}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .format-options button strong{font-size:14px}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .format-options button small{font-size:10px}
}
@media(min-width:761px) and (min-height:541px) and (max-height:780px){
  #app #length-screen:has(#doubles-lineup:not([hidden])) .lineup-face{width:60px;height:60px}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .lineup-card{padding:8px 8px 8px;gap:3px}
  #app #length-screen:has(#doubles-lineup:not([hidden])) .lineup-vs{width:48px;height:48px;font-size:18px}
}
#app #team-screen .learning-choice-card{min-height:0}
/* One back button size for both choice screens. */
#app :is(#play-screen,#team-screen) .howto-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px 20px;margin:4px 0 0;padding:0;width:auto}
#app :is(#play-screen,#team-screen) .howto-actions .menu-button{width:240px;height:60px;min-height:60px;max-height:60px;padding:0 24px 6px;font-size:16px;justify-content:center}
#app #team-screen .howto-actions #team-have-code{width:auto;height:60px;min-height:60px}
@media(max-width:760px),(orientation:landscape) and (max-height:540px){
  /* One horizontal comic card per mode: picture left, copy right, all inside the drawn frame.
     Rows stay close to the frame's own proportions so its rim is not stretched thick. */
  #app :is(#play-screen,#team-screen) .learning-choice-options{grid-auto-rows:minmax(0,min(172px,46vw));align-content:center}
  #app :is(#play-screen,#team-screen) .learning-choice-card,#app #team-screen .learning-choice-card{--card-sign:url('./comic-controls-neutral/phone-cards-1.webp');display:grid;grid-template-columns:minmax(0,44%) minmax(0,1fr);grid-template-rows:minmax(0,1fr);align-items:center;gap:6px;height:100%;min-height:0;padding:12px 8% 18px 6%;background:transparent var(--card-sign) center/100% 100% no-repeat;filter:drop-shadow(0 4px 0 #0007)}
  #app #play-screen #start-tour,#app #team-screen [data-team-size="doubles"]{--card-sign:url('./comic-controls-neutral/phone-cards-2.webp')}
  #app #play-screen #play-online{--card-sign:url('./comic-controls-neutral/phone-cards-3.webp')}
  #app :is(#play-screen,#team-screen) .learning-choice-card:hover{filter:drop-shadow(0 4px 0 #0007) brightness(1.05)}
  #app :is(#play-screen,#team-screen) .play-art,#app #team-screen .play-art{width:100%;height:100%;min-height:0;max-height:150px;margin:0;padding:0;background:none}
  #app :is(#play-screen,#team-screen) .play-art img{height:100%;max-width:48%}
  #app #play-screen .play-art-online img{height:78%;max-width:36%}
  #app #team-screen .learning-choice-card{grid-template-columns:minmax(0,50%) minmax(0,1fr)}
  #app #team-screen .team-side img{max-width:100%;height:92%}
  #app #team-screen .team-art-doubles .team-side img{max-width:72%;height:86%}
  #app #play-screen .play-art-online .play-code{font-size:8px;padding:2px 3px}
  #app #play-screen .play-art-tour{padding:0}
  #app #play-screen .play-art-tour img:not(.play-tour-node){transform:scale(1.3)}
  #app :is(#play-screen,#team-screen) .learning-choice-copy,#app #team-screen [data-team-size] .learning-choice-copy{flex:none;justify-content:center;padding:0;gap:3px;background:none;filter:none}
  #app #team-screen .team-card[data-current="true"]{filter:drop-shadow(3px 0 0 var(--brand-ball)) drop-shadow(-3px 0 0 var(--brand-ball)) drop-shadow(0 3px 0 var(--brand-ball)) drop-shadow(0 -3px 0 var(--brand-ball)) drop-shadow(0 4px 0 #0007)}
  #app #team-screen .team-card[data-current="true"] .learning-choice-copy{filter:none}
  #app #team-screen .team-card[data-current="true"] .learning-choice-copy::after{top:-4px;right:0}
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:19px}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{font-size:12px;line-height:1.3}
  #app #play-screen .learning-choice-copy b{display:none}
  #app :is(#play-screen,#team-screen) :is(.play-kicker,.team-badge){font-size:9px;padding:1px 6px}
  #app :is(#play-screen,#team-screen) .howto-actions .menu-button{width:min(260px,100%);height:52px;min-height:52px;max-height:52px;font-size:14px}
  #app #team-screen .howto-actions:has(#team-have-code:not([hidden])) :is(.menu-button,#team-have-code){width:100%;height:52px;min-height:52px}
}
@media(orientation:landscape) and (max-height:540px){
  #app :is(#play-screen,#team-screen) .learning-choice-card,#app #team-screen .learning-choice-card{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:2px;padding:12px 9% 26px}
  #app #play-screen .play-art-tour img:not(.play-tour-node){transform:none}
  #app :is(#play-screen,#team-screen) .learning-choice-copy,#app #team-screen [data-team-size] .learning-choice-copy{align-items:center;text-align:center;padding:0}
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:16px}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{display:none}
  #app #play-screen{grid-template-rows:auto minmax(0,1fr) auto}
  #app :is(#play-screen,#team-screen) .learning-choice-options{height:100%;align-self:stretch}
}

/* Home on phones (portrait) and short landscape screens. */
@media(max-width:760px){
  #app #welcome{--menu-btn-h:clamp(70px,10dvh,96px);--menu-btn-w:min(100%,calc(var(--menu-btn-h) * 3.1));gap:clamp(8px,1.6dvh,14px)}
  #app #welcome .screen-head .logo .game-logo{width:min(220px,20dvh,60vw)}
  #app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment){padding:0 13% 6px 12%;font-size:clamp(16px,2.3dvh,20px)}
  #app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment) .home-button-copy small{font-size:11px}
  #app #welcome .home-progress-row :is(#player-progress,#game-account-open){height:38px;min-height:38px}
}
@media(orientation:landscape) and (max-height:540px){
  #app #welcome{--menu-btn-h:clamp(46px,15dvh,66px);--menu-btn-w:min(100%,calc(var(--menu-btn-h) * 3.8));gap:6px}
  #app #welcome .home-links{grid-row:1 / 3;align-self:center;justify-self:center}
  #app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment){font-size:16px;padding:0 13% 5px 12%}
  #app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment) .home-button-copy small{display:none}
  #app #welcome .home-progress-row{width:100%;flex-direction:column;align-items:center;gap:6px}
  #app #welcome .home-progress-row :is(#player-progress,#game-account-open){height:34px;min-height:34px}
}

/* Illustrations: one drawn scene per card (assets/ui/play-modes, same style and clay patch as the
   tutorial pictures), so all cards share scale and ground. Sources: art-source/play-modes. */
#app :is(#play-screen,#team-screen) .play-art-scene{display:flex;align-items:flex-end;justify-content:center;padding:0 3%;background:none}
#app :is(#play-screen,#team-screen) .play-art-scene img{display:block;width:100%;height:100%;max-width:none;object-fit:contain;object-position:50% 100%;filter:drop-shadow(0 5px 0 #0005);transform:none}
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app :is(#play-screen,#team-screen) .play-art-scene{margin-bottom:-22px}
}
/* Phone portrait: the wide scenes need the full card width, so picture on top, copy below. */
@media(max-width:760px) and (orientation:portrait){
  #app :is(#play-screen,#team-screen) .learning-choice-options{grid-auto-rows:minmax(0,236px);align-content:center}
  #app :is(#play-screen,#team-screen) .learning-choice-card,#app #team-screen .learning-choice-card{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:2px;padding:14px 10% 36px}
  #app :is(#play-screen,#team-screen) .learning-choice-copy,#app #team-screen [data-team-size] .learning-choice-copy{align-items:center;text-align:center}
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:18px}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{font-size:11.5px}
  #app :is(#play-screen,#team-screen) :is(.play-kicker,.team-badge){align-self:center}
  #app :is(#play-screen,#team-screen) .play-art-scene{max-height:none;min-height:0;z-index:0;overflow:hidden}
}
/* Scenes always fit their box completely: the picture is laid over the box instead of sizing it,
   so an indefinite card height can no longer let it grow and get clipped. */
#app :is(#play-screen,#team-screen) .play-art-scene{position:relative;min-height:0;overflow:visible}
#app :is(#play-screen,#team-screen) .play-art-scene img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:50% 100%}
@media(max-width:760px) and (orientation:portrait){
  #app :is(#play-screen,#team-screen) .play-art-scene{overflow:visible}
}
/* Copy keeps clear of the drawn rims. */
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment){padding:0 16% 8px 15%}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment) .home-button-copy{max-width:100%}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment) .home-button-copy :is(strong,small){max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#app :is(#play-screen,#team-screen) .learning-choice-copy,#app #team-screen [data-team-size] .learning-choice-copy{padding:44px 15% 42px 15%}
@media(max-width:1279px){
  #app #play-screen .learning-choice-copy b{display:none}
}
@media(max-width:760px),(orientation:landscape) and (max-height:540px){
  #app :is(#play-screen,#team-screen) .learning-choice-copy,#app #team-screen [data-team-size] .learning-choice-copy{padding:0}
  #app :is(#play-screen,#team-screen) .learning-choice-card,#app #team-screen .learning-choice-card{padding-left:11%;padding-right:11%}
}
@media(orientation:landscape) and (max-height:540px){
  #app :is(#play-screen,#team-screen) .learning-choice-card,#app #team-screen .learning-choice-card{padding-top:14px;padding-bottom:34px}
}
@media(max-width:760px) and (orientation:portrait){
  #app :is(#play-screen,#team-screen) .learning-choice-card,#app #team-screen .learning-choice-card{padding:16px 12% 38px}
}
/* Small home buttons: the title alone instead of a cut-off subtitle. */
@media(max-height:620px),(max-width:380px){
  #app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment) .home-button-copy small{display:none}
}
/* Pictures keep a little air to the frame rim and to the copy below. */
@media(max-width:760px),(orientation:landscape) and (max-height:540px){
  #app :is(#play-screen,#team-screen) .learning-choice-card,#app #team-screen .learning-choice-card{row-gap:8px;column-gap:10px}
  #app :is(#play-screen,#team-screen) .play-art-scene img{inset:6px 0 0}
}
@media(min-width:561px) and (max-width:760px) and (orientation:landscape),(min-width:561px) and (max-width:760px) and (max-aspect-ratio:1/1){
  #app :is(#play-screen,#team-screen) .learning-choice-card{padding-top:18px}
}
@media(max-height:620px),(max-width:380px){
  #app #welcome .home-links #show-howto :is(#first-play-hint,.howto-home-note){display:none !important}
}
@media(max-width:760px) and (orientation:portrait){
  #app #play-screen .play-kicker{display:none}
}
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app #team-screen [data-team-size] .learning-choice-copy{min-height:clamp(170px,24dvh,200px);padding-bottom:50px}
}
#app #welcome .home-links :is(#start,#show-howto,#open-settings,#open-equipment) .home-button-copy small{font-size:11.5px}
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app #team-screen [data-team-size] .learning-choice-copy{padding:40px 12% 44px 13%;justify-content:center}
  #app #team-screen [data-team-size] .learning-choice-copy small{font-size:13px}
}
/* Desktop: the picture sits inside the drawn sign and fills it (one object per card),
   title and short line below; the sign keeps close to its own 3:2 proportions. */
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app :is(#play-screen,#team-screen) .learning-choice-card{display:grid;grid-template-rows:minmax(0,1fr) auto;row-gap:6px;min-height:0;aspect-ratio:1.12;height:auto;padding:13% 12% 18%;background:transparent var(--card-sign) center/100% 100% no-repeat;filter:drop-shadow(0 6px 0 #0007)}
  #app :is(#play-screen,#team-screen) .learning-choice-card:hover{filter:drop-shadow(0 6px 0 #0007) brightness(1.05)}
  #app :is(#play-screen,#team-screen) .play-art-scene{height:auto;margin:0;padding:0}
  #app :is(#play-screen,#team-screen) .learning-choice-copy,#app #team-screen [data-team-size] .learning-choice-copy{position:static;min-height:0;padding:0;background:none;filter:none;align-items:center;text-align:center;gap:3px}
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:clamp(19px,2.6dvh,23px)}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{font-size:13px;line-height:1.35}
  #app #play-screen .learning-choice-copy b{display:none}
  #app :is(#play-screen,#team-screen) :is(.play-kicker,.team-badge){position:absolute;top:17%;left:13%;z-index:2;align-self:auto}
  #app #play-screen .play-options{width:min(1080px,100%)}
  #app #team-screen .team-options{width:min(780px,100%)}
  #app #team-screen .team-card[data-current="true"]{filter:drop-shadow(3px 0 0 var(--brand-ball)) drop-shadow(-3px 0 0 var(--brand-ball)) drop-shadow(0 3px 0 var(--brand-ball)) drop-shadow(0 -3px 0 var(--brand-ball)) drop-shadow(0 6px 0 #0007)}
  #app #team-screen .team-card[data-current="true"] .learning-choice-copy{filter:none}
  #app #team-screen .team-card[data-current="true"] .learning-choice-copy::after{position:absolute;top:16%;right:13%;left:auto}
}
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  /* The slanted sign's cream area ends higher above its thick bottom rim. */
  #app #play-screen #start-tour,#app #team-screen [data-team-size="doubles"]{padding-bottom:23%}
}
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app #play-screen #play-online{padding-bottom:20%}
  #app #play-screen .learning-choice-copy small{font-size:12.5px;line-height:1.3;text-wrap:balance}
}

/* ===== Proportion pass: every button/card keeps its own drawn shape (variety is part of the look),
   but all share one size; inner padding follows each frame so pictures and copy line up. */
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app #play-screen :is(#play-quick,#start-tour,#play-online),#app #team-screen .team-card{padding:13% 12% 19%}
  #app #play-screen #start-tour,#app #team-screen [data-team-size="doubles"]{padding-bottom:23%}
  #app #play-screen #play-online{padding-bottom:20%}
  /* The campaign scene is upright: give its figure the same height as the duel scenes. */
  #app #play-screen #start-tour .play-art-scene img{inset:4% -8% 0}
}
@media(max-width:760px),(orientation:landscape) and (max-height:540px){
}

/* ===== Pop-out pass (v2 pictures): the figures may rise over the top rim of their sign, the copy
   keeps clear air to the drawn rim on every side. */
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app :is(#play-screen,#team-screen) .play-art-scene{z-index:2}
  /* Width-driven and standing on the copy: the picture grows upward out of the sign. */
  #app :is(#play-screen,#team-screen) .play-art-scene img{inset:auto auto 4% 50%;width:122%;height:auto;max-height:none;transform:translateX(-50%);filter:drop-shadow(0 5px 0 #0004)}
  #app #play-screen #start-tour .play-art-scene img{inset:auto auto 4% 50%;width:92%}
  #app #team-screen .team-card[data-current="true"] .learning-choice-copy::after{z-index:4}
  #app :is(#play-screen,#team-screen) .learning-choice-copy,#app #team-screen [data-team-size] .learning-choice-copy{padding:0 7%;gap:4px}
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:clamp(20px,2.8dvh,25px);letter-spacing:.01em}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{font-size:12.5px;line-height:1.35;text-wrap:balance}
  #app :is(#play-screen,#team-screen) :is(.play-kicker,.team-badge){z-index:3}
}
@media(max-width:760px),(orientation:landscape) and (max-height:540px){
  #app :is(#play-screen,#team-screen) .play-art-scene{z-index:2}
  #app :is(#play-screen,#team-screen) .play-art-scene img,#app #play-screen .play-art-tour img:not(.play-tour-node){inset:-14px -3% 0;width:106%;height:calc(100% + 14px);transform:none}
  #app :is(#play-screen,#team-screen) .learning-choice-copy,#app #team-screen [data-team-size] .learning-choice-copy{padding:0 6%}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{text-wrap:balance}
}
@media(max-width:760px) and (orientation:portrait){
  #app #team-screen [data-team-size] .learning-choice-copy small{max-width:86%;white-space:normal;text-wrap:balance}
}
/* Card titles as comic stickers (display font, cream fill, ink outline, orange drop) instead of
   plain text; the line below in heavier ink. Each card tilts its title a little differently. */
#app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-family:var(--font-display);font-weight:400;font-style:normal;color:#fff6e4;letter-spacing:.045em;line-height:1.05;-webkit-text-stroke:4.5px #0B1A18;paint-order:stroke fill;text-shadow:0 3px 0 #e2661c,0 5px 0 #0B1A18;transform:rotate(-2deg)}
#app :is(#play-screen,#team-screen) .learning-choice-card:nth-child(even) .learning-choice-copy strong{transform:rotate(1.5deg)}
#app :is(#play-screen,#team-screen) .learning-choice-copy small{margin-top:6px;font-weight:800;color:#5a3418}
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:clamp(25px,3.8dvh,30px);white-space:nowrap}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{font-size:13.5px}
}
@media(max-width:760px),(orientation:landscape) and (max-height:540px){
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:21px;-webkit-text-stroke:4px #0B1A18;text-shadow:0 3px 0 #e2661c,0 5px 0 #0B1A18}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{font-size:12px;margin-top:3px}
}
/* Titles: dark ink, larger, only a light comic touch (small orange offset, slight tilt). */
#app :is(#play-screen,#team-screen) .learning-choice-copy strong{color:#0B1A18;-webkit-text-stroke:0;letter-spacing:.02em;text-shadow:2px 2px 0 #f4a24a}
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:clamp(28px,4.3dvh,34px)}
}
@media(max-width:760px),(orientation:landscape) and (max-height:540px){
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:24px;-webkit-text-stroke:0;text-shadow:2px 2px 0 #f4a24a}
}
/* Phones use the same drawn signs as the desktop (their 3:2 shape fits the phone cards). */
@media(max-width:760px) and (orientation:portrait){
  #app :is(#play-screen,#team-screen) .learning-choice-card,#app #team-screen .learning-choice-card{--card-sign:url('./training/sign-first-v1.webp');padding:9% 12% 13%}
  #app #play-screen #start-tour,#app #team-screen [data-team-size="doubles"]{--card-sign:url('./training/sign-advanced-v1.webp');padding-bottom:16%}
  #app #play-screen #play-online{--card-sign:url('./training/sign-machine-v1.webp');padding-bottom:14%}
}
@media(max-width:760px) and (orientation:portrait){
  #app :is(#play-screen,#team-screen) .play-art-scene img,#app #play-screen .play-art-tour img:not(.play-tour-node){inset:auto auto 0 50%;width:auto;height:calc(100% + 44px);max-width:112%;transform:translateX(-50%)}
}
/* No coloured shadow on the card titles: plain dark ink. */
#app :is(#play-screen,#team-screen) .learning-choice-copy strong{text-shadow:none}
@media(max-width:760px),(orientation:landscape) and (max-height:540px){
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{text-shadow:none}
}

/* ===== Pixel pass (Oct 2026): pixel-art scenes in the style of the in-game sprites, shown 1:1
   (240/290 x 135 CSS px, pixelated) so every pixel stays square; the sign's shadow sits on the
   sign only (not on the figures); plain dark Nunito copy straight on the sign, clear of the drawn
   rims (insets measured on the sign images); no badges above the titles. ===== */
#app :is(#play-screen,#team-screen) .learning-choice-card{isolation:isolate;background:none;filter:none}
#app :is(#play-screen,#team-screen) .learning-choice-card::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:var(--card-sign) center/100% 100% no-repeat;filter:drop-shadow(0 5px 0 #0007)}
#app :is(#play-screen,#team-screen) .learning-choice-card:hover{filter:none}
#app :is(#play-screen,#team-screen) .learning-choice-card:hover::before{filter:drop-shadow(0 5px 0 #0007) brightness(1.05)}
#app #team-screen .team-card[data-current="true"]{filter:none}
#app #team-screen .team-card[data-current="true"]::before{filter:drop-shadow(3px 0 0 var(--brand-ball)) drop-shadow(-3px 0 0 var(--brand-ball)) drop-shadow(0 3px 0 var(--brand-ball)) drop-shadow(0 -3px 0 var(--brand-ball)) drop-shadow(0 5px 0 #0007)}
#app :is(#play-screen,#team-screen) .play-art-scene img,#app #play-screen .play-art-tour img:not(.play-tour-node){inset:auto auto 0 50%;width:auto;height:auto;max-width:none;max-height:none;object-fit:contain;transform:translateX(-50%) scale(var(--pixel-art-scale,1));transform-origin:50% 100%;filter:none;image-rendering:pixelated}
#app :is(#play-screen,#team-screen) :is(.play-kicker,.team-badge){display:none}
#app :is(#play-screen,#team-screen) .learning-choice-copy strong,#app :is(#play-screen,#team-screen) .learning-choice-card:nth-child(even) .learning-choice-copy strong{font-family:var(--font-ui);font-weight:900;font-style:normal;letter-spacing:0;line-height:1.05;color:#0B1A18;-webkit-text-stroke:0;text-shadow:none;transform:none;white-space:nowrap}
#app :is(#play-screen,#team-screen) .learning-choice-copy small{margin-top:3px;color:#a0461a;font-weight:800;line-height:1.25;text-wrap:balance}
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:27px}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{font-size:13px}
  #app #play-screen #play-quick,#app #team-screen .team-card[data-team-size="singles"]{padding:13% 18.5% 26.6% 14.5%}
  #app #play-screen #start-tour,#app #team-screen .team-card[data-team-size="doubles"]{padding:13% 18% 32.1% 20%}
  #app #play-screen #play-online{padding:13% 18.2% 28.5% 13.8%}
}
@media(max-width:760px) and (orientation:portrait){
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:26px}
  #app :is(#play-screen,#team-screen) .learning-choice-copy small{font-size:13px}
  #app #play-screen #play-quick,#app #team-screen .team-card[data-team-size="singles"]{padding:9% 18.5% 19.7% 14.5%}
  #app #play-screen #start-tour,#app #team-screen .team-card[data-team-size="doubles"]{padding:9% 18% 23.8% 20%}
  #app #play-screen #play-online{padding:9% 18.2% 21% 13.8%}
}
@media(orientation:landscape) and (max-height:540px){
  /* Short landscape phones: the cards are too low for 1:1 pictures, so they scale down to fit. */
  #app :is(#play-screen,#team-screen) .play-art-scene img,#app #play-screen .play-art-tour img:not(.play-tour-node){height:calc(100% + 14px);width:auto;max-width:100%;transform:translateX(-50%)}
  #app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:17px}
}
@media(max-width:760px) and (orientation:portrait){
  /* The first picture rises into the line under the title; the title says enough on its own. */
  #app #play-screen .learning-choice-intro{display:none}
}

/* ===== Length step, plain pass: no kicker badges, same as the play and team cards. The round
   count stays visible only in the cup, where it tells something. */
#app #length-screen .event-kicker,#app #length-screen .event-stamp,#app #length-screen .format-kicker{display:none}
#app #length-screen .format-scope{display:none}
/* Name above, time below: both readable at a glance, the tick sits right of the time. */
@media (min-width:701px){
  #app#app #length-screen .length-options .format-options button{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:2px;padding-inline:58px 64px}
  #app#app #length-screen .length-options .format-options button strong{grid-column:1;grid-row:1;font-size:clamp(19px,1.75vw,24px);white-space:nowrap}
  #app#app #length-screen .length-options .format-options button small{grid-column:1;grid-row:2;justify-self:start;text-align:left;font-size:clamp(14px,1.2vw,17px)}
}

/* ===== Phones (Marcel 30.10.): "Schnelles Match / Kampagne / Online" and "Einzel / Doppel" as small
   rows readable at a glance: pixel scene at half size on the left (2 device px per art pixel on 2x
   screens), title and one line on the right, on the same cream signs as the start page buttons. ===== */
@media(max-width:760px) and (orientation:portrait){
  #app#app :is(#play-screen,#team-screen) .learning-choice-options{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;
    width:min(100%,360px);height:auto;min-height:0;max-height:none;flex:0 0 auto;margin:auto;padding:0;grid-template-columns:none;grid-template-rows:none}
  #app#app :is(#play-screen,#team-screen) .learning-choice-card{--pixel-art-scale:.5;--card-sign:url('./comic-controls-neutral/back.webp');
    display:grid;grid-template-columns:var(--row-art,120px) minmax(0,1fr);grid-template-rows:auto;align-items:center;column-gap:12px;
    width:100%;height:auto;min-height:108px;max-height:none;aspect-ratio:auto;margin:0;padding:18px 8% 24px 6%;flex:none;text-align:left}
  #app#app :is(#play-screen,#team-screen) .learning-choice-card::before{filter:none}
  #app#app :is(#play-screen,#team-screen) .learning-choice-card:hover::before{filter:brightness(1.05)}
  #app#app #play-screen #start-tour{--card-sign:url('./comic-controls-neutral/settings.webp')}
  #app#app #team-screen .team-card{--row-art:145px}
  #app#app #team-screen .team-card[data-current="true"]::before{filter:drop-shadow(2px 0 0 var(--brand-ball)) drop-shadow(-2px 0 0 var(--brand-ball)) drop-shadow(0 2px 0 var(--brand-ball)) drop-shadow(0 -2px 0 var(--brand-ball))}
  #app#app :is(#play-screen,#team-screen) .learning-choice-art{position:relative;grid-column:1;grid-row:1;width:100%;height:68px;min-height:0;max-height:none;margin:0;padding:0;overflow:visible;flex:none;aspect-ratio:auto}
  #app#app :is(#play-screen,#team-screen) .play-art-scene img,#app#app #play-screen .play-art-tour img:not(.play-tour-node){position:absolute;inset:auto auto 0 50%;width:auto;height:auto;max-width:none;max-height:none;
    transform:translateX(-50%) scale(var(--pixel-art-scale));transform-origin:50% 100%}
  #app#app :is(#play-screen,#team-screen) .learning-choice-copy{grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;width:auto;min-width:0;margin:0;padding:0;text-align:left}
  #app#app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:19px;white-space:nowrap}
  #app#app :is(#play-screen,#team-screen) .learning-choice-copy small{margin:0;max-width:none;font-size:12.5px;line-height:1.25;text-align:left;text-wrap:pretty}
  #app#app :is(#play-screen,#team-screen) .learning-choice-copy b{display:none}
  #app#app #play-screen{justify-content:center}
}

/* Start page with four buttons (Ausrüstung added, Marcel 30.10.): a little flatter on large screens,
   so level and account still fit below the THENN·OS card. */
@media(min-width:761px) and (not ((orientation:landscape) and (max-height:540px))){
  #app #welcome{--menu-btn-h:clamp(68px,9.6dvh,100px);--menu-btn-w:min(100%,calc(clamp(80px,12dvh,108px) * 3.4))}
}

/* Marcel 02.11.2026: Einzelmatch ohne VS-Schild, Figuren größer; Doppel als experimentell markiert. */
#app #length-screen .event-duel{overflow:visible}
#app #length-screen .event-duel .duel-fighter{width:50%;padding-bottom:0}
#app #length-screen .event-duel .duel-fighter img{transform-origin:50% 100%;scale:1.28}
#app #length-screen .event-flag{position:absolute;top:12px;right:12px;z-index:3;padding:3px 8px;border:2px solid #102f2b;border-radius:8px 4px 9px 5px;background:#ffbd58;color:#18382d;font:900 10px/1.3 var(--font-ui);letter-spacing:.6px;text-transform:uppercase;transform:rotate(3deg);box-shadow:1px 2px 0 #102f2b;pointer-events:none}
@media (max-width:700px){#app #length-screen .event-flag{top:6px;right:6px;font-size:8px;padding:2px 5px}#app #length-screen .event-duel .duel-fighter img{scale:1.1}}

/* Marcel 03.11.2026 (Handy-Test): Texte liefen aus den Spielmodus-Karten, der Haken lag auf dem Text.
   Titel und Untertitel brechen um bzw. verkleinern sich begrenzt, unten bleibt Platz für den Haken.
   Das Experimentell-Schild steht im Fluss über dem Bild (nicht darüber gelegt, nicht über die Kante). */
#app #length-screen .event-flag{position:static;align-self:center;margin:0 0 -2px;transform:rotate(-2deg)}
@media (max-width:760px) and (orientation:portrait){
  #app #length-screen .length-options .event-options .event-card{min-width:0;padding-bottom:30px}
  #app #length-screen .length-options .event-options .event-card strong{max-width:100%;font-size:clamp(12px,3.7vw,18px);line-height:1.08;overflow-wrap:normal;word-break:normal;hyphens:manual}
  #app #length-screen .length-options .event-options .event-card small{max-width:100%;font-size:clamp(9px,2.6vw,10px);overflow-wrap:break-word;hyphens:auto;-webkit-hyphens:auto}
}
@media (max-width:760px) and (orientation:portrait){
  /* Wie schon unter 720 px Höhe: hochkant keine Unterzeile, sie passte auf Englisch nicht in die Karte. */
  #app #length-screen .length-options .event-options .event-card small{display:none}
}
@media (orientation:landscape) and (max-height:540px){
  #app #length-screen .event-flag{max-width:100%;font-size:8px;padding:2px 4px;letter-spacing:.2px}
}
/* Marcel 03.11.2026 20:10 (Handy-Screenshot „Einzelmatc|h“): Die Titelgröße hing nur an der Bildschirmbreite (min. 12 px)
   und konnte so breiter als die Karte werden. Jetzt richtet sie sich nach der Karte selbst: das längste Wort
   („Einzelmatch“ ≈ 5,9 em) passt immer, getrennt wird nur zwischen Wörtern, nie im Wort. */
@media (max-width:760px) and (orientation:portrait){
  #app #length-screen .length-options .event-options .event-card{container-type:inline-size}
  #app #length-screen .length-options .event-options .event-card strong{font-size:min(clamp(12px,3.7vw,18px),calc(100cqi / 6.3));overflow-wrap:normal;word-break:keep-all;hyphens:manual;-webkit-hyphens:manual}
}

/* Marcel 03.11.2026 („alles nochmal kleinschrittig kontrollieren“): Spielmodus-Karten auf schmalen Handys.
   Der Titel bricht hier nie um (nowrap) und war fest 19 px: „Schnelles Match“ ragte bei 320–360 px in die
   schräge obere rechte Kante der Tafel. Jetzt richtet er sich nach der Textspalte (endet bei höchstens ~84 %
   der Tafel), das Bild wird auf schmalen Handys etwas schmaler. Die Kampagnen-Tafel (Welle unten in der
   Mitte) wird etwas höher, ihr Text sitzt über der Welle; die Online-Tafel hat Platz für drei Zeilen. */
@media(max-width:760px) and (orientation:portrait){
  #app#app :is(#play-screen,#team-screen) .learning-choice-card{grid-template-columns:var(--row-art,clamp(92px,30vw,120px)) minmax(0,1fr)}
  #app#app #team-screen .team-card{--row-art:clamp(110px,36vw,145px)}
  #app#app :is(#play-screen,#team-screen) .learning-choice-copy{container-type:inline-size}
  #app#app :is(#play-screen,#team-screen) .learning-choice-copy strong{font-size:min(19px,calc(100cqi / 10.2))}
  #app#app #play-screen :is(#play-quick,#play-online){padding-top:21px;padding-bottom:21px}
  #app#app :is(#play-screen,#team-screen) .learning-choice-copy small{font-size:clamp(11.5px,3.5vw,12.5px)}
  #app#app #play-screen #start-tour{min-height:124px;padding-top:16px;padding-bottom:42px}
}
@media(max-width:340px) and (orientation:portrait){
  #app#app #play-screen #play-online{min-height:120px}
}
/* Querformat-Handys (568–915 × 320–412): Spielmodus-Karten sind dort nur ~70–120 px breit. Titel und
   Experimentell-Schild richten sich nach der Karte, damit nichts abgeschnitten wird. */
@media(orientation:landscape) and (max-height:540px){
  #app #length-screen .length-options .event-options .event-card{container-type:inline-size}
  #app #length-screen .length-options .event-options .event-card strong{font-size:min(16px,calc(100cqi / 6.3));overflow-wrap:normal;word-break:keep-all;hyphens:manual;-webkit-hyphens:manual}
  #app #length-screen .event-flag{box-sizing:border-box;max-width:100%;font-size:min(8px,calc((100cqi - 10px) / 9.6));letter-spacing:0;padding:2px 3px;white-space:nowrap}
}
@media(orientation:landscape) and (max-height:540px) and (max-width:700px){
  /* iPhone SE / kleine Android quer: Karten bekommen die halbe Breite statt ~40 %, weniger Innenrand. */
  #app#app #length-screen .length-options{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  #app#app #length-screen .length-options .event-options .event-card{padding-inline:4px}
}
@media(orientation:landscape) and (max-height:540px){
  /* Der Auswahl-Haken rechts in den Dauer-Zeilen lag auf „Min.“. */
  #app#app #length-screen .length-options .format-options button{padding-right:max(34px,var(--format-pad-right,0px))}
}
@media(max-width:760px) and (orientation:portrait){
  /* Safari 320 px: „EXPERIMENTELL“ war 2 px breiter als die Karte. Schild richtet sich nach der Karte. */
  #app #length-screen .event-flag{box-sizing:border-box;max-width:100%;white-space:nowrap;font-size:min(8px,calc((100cqi - 10px) / 9.6));letter-spacing:0;padding:2px 4px}
}
