/* Painted desktop cards with an accessible information back. */
#app #difficulty-screen .setup-content{
  container-type:normal;justify-content:safe center;padding:18px 32px 32px;
}
#app #difficulty-screen .difficulty.setup-choices{
  width:min(952px,100%);height:auto;grid-template-columns:repeat(3,minmax(0,1fr));
  grid-template-rows:auto;gap:26px;flex:none;
}
#app #difficulty-screen .diff-tile{
  position:relative;min-width:0;aspect-ratio:1 / 1.22;perspective:1100px;
  --level-color:#286b43;--level-tint:#e5f1d8;--frame-hue:80deg;
  --card-frame:url('./comic-controls-neutral/difficulty-cards-1.webp');
}
#app #difficulty-screen .diff-tile[data-level="club"]{
  --level-color:#96500c;--level-tint:#ffebbd;--frame-hue:0deg;
  --card-frame:url('./comic-controls-neutral/difficulty-cards-2.webp');
}
#app #difficulty-screen .diff-tile[data-level="pro"]{
  --level-color:#b53024;--level-tint:#ffe0d7;--frame-hue:-16deg;
  --card-frame:url('./comic-controls-neutral/difficulty-cards-3.webp');
}
#app #difficulty-screen .diff-turn{
  display:grid;height:100%;
}
#app #difficulty-screen :is(.diff-front,.diff-back){
  position:relative;grid-area:1 / 1;min-width:0;min-height:0;backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}
/* Inert alone does not remove the hidden face from 3D hit testing. */
#app #difficulty-screen :is(.diff-front,.diff-back)[aria-hidden="true"]{
  visibility:hidden;pointer-events:none;
}
#app #difficulty-screen .difficulty .diff-card[data-level]{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  width:100%;height:100%;min-height:0;padding:32px 24px 84px;gap:12px;
  border:0;border-radius:0;background:none;box-shadow:none;transform:none;outline:none;
}
#app #difficulty-screen .difficulty .diff-card::before{content:"";background-size:contain}
#app #difficulty-screen .difficulty .diff-card .diff-face{width:96px;height:96px}
#app #difficulty-screen .difficulty .diff-card .diff-copy{
  position:relative;display:flex;align-items:center;text-align:center;width:100%;gap:8px;
}
#app #difficulty-screen .difficulty .diff-card strong{font-size:28px;line-height:1.1}
#app #difficulty-screen .difficulty .diff-card .diff-kicker{display:inline-block;font-size:10px;padding:4px 8px}
#app #difficulty-screen .difficulty .diff-card .diff-text{max-width:190px;font-size:13px;line-height:1.4;margin:0;color:#29434d;white-space:normal;text-wrap:balance}
#app #difficulty-screen .difficulty .diff-card .pips{position:static;display:flex;height:22px;gap:5px}
#app #difficulty-screen .difficulty .diff-card .pips b{width:12px;border-width:2px}
#app #difficulty-screen .difficulty .diff-card .pips b:nth-child(2){height:16px}
#app #difficulty-screen .difficulty .diff-card .pips b:nth-child(3){height:22px}
#app #difficulty-screen .selection-mark{top:18px;right:18px;width:36px;height:36px;font-size:25px}
#app #difficulty-screen .diff-info{
  position:absolute;z-index:3;bottom:32px;left:50%;translate:-50% 0;
  display:flex;flex-direction:row;align-items:center;justify-content:center;gap:7px;min-height:44px;
  width:max-content;max-width:calc(100% - 48px);padding:8px 14px;
  background:var(--level-tint);border:2px solid var(--level-color);border-radius:9px;
  color:var(--level-color);font:800 13px/1.2 var(--font-body,"Nunito",sans-serif);
  box-shadow:0 3px 0 var(--level-color);text-shadow:none;letter-spacing:0;white-space:normal;
}
#app #difficulty-screen .diff-info::before,#app #difficulty-screen .diff-info::after{content:none}
#app #difficulty-screen .diff-info:hover{filter:brightness(1.04);transform:translateY(-1px)}
#app #difficulty-screen :is(.diff-info,.diff-details,.diff-card):focus-visible{outline:3px solid var(--brand-ball);outline-offset:3px}
#app #difficulty-screen .difficulty-note{display:none;bottom:-14px;right:-8px;width:124px;grid-template-columns:28px 1fr;font-size:10px;padding:4px 6px}
#app #difficulty-screen .difficulty-note b{font-size:13px}
#app #difficulty-screen .note-skull{width:28px;height:30px}
#app #difficulty-screen .difficulty-note::before{left:45px;width:30px;height:10px;top:-5px}
#app #difficulty-screen .diff-back{display:flex;isolation:isolate;padding:48px 32px 84px;color:var(--brand-ink)}
#app #difficulty-screen .diff-back::before{
  content:"";position:absolute;inset:0;z-index:0;background:var(--card-frame) center/contain no-repeat;
  filter:hue-rotate(var(--frame-hue));
}
#app #difficulty-screen .diff-tile:has(.diff-card[aria-pressed="true"]) .diff-back{
  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 #difficulty-screen .diff-details{position:relative;z-index:1;width:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 5px 4px;scrollbar-width:thin;scrollbar-color:var(--level-color) transparent;text-align:left}
#app #difficulty-screen .diff-back-head{
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
  min-height:58px;padding:0 8px 10px;gap:5px;text-align:center;box-sizing:border-box;
}
#app #difficulty-screen .diff-back-head .diff-kicker{
  display:block;max-width:100%;margin:0;color:var(--level-color);
  font:900 9px/1.3 var(--font-ui,"Nunito",sans-serif);text-transform:uppercase;
  letter-spacing:.5px;white-space:normal;text-wrap:balance;
}
#app #difficulty-screen .diff-back-head h3{
  margin:0;font:900 26px/1.15 var(--font-ui,"Nunito",sans-serif);color:var(--brand-ink);
}
#app #difficulty-screen .diff-facts{display:grid;gap:8px;margin:0;padding-left:17px;font:700 13px/1.4 var(--font-body,"Nunito",sans-serif)}
#app #difficulty-screen .diff-facts li::marker{color:var(--level-color)}
#app #difficulty-screen .diff-facts strong{font-size:inherit;font-weight:900;color:var(--level-color)}
@media(prefers-reduced-motion:reduce){
  #app #difficulty-screen .diff-info:hover{transform:none}
}

/* Name and difficulty meter form one heading in every card layout. */
#app #difficulty-screen .diff-heading{display:flex;align-items:center;justify-content:center;gap:12px;min-width:0}
#app #difficulty-screen .diff-info-icon{font:900 19px/1 Georgia,serif}
#app #difficulty-screen .diff-front .diff-info{
  left:50%;right:auto;translate:-50% 0;width:44px;height:44px;max-width:none;
  padding:0;gap:0;border-radius:50%;background:#fff6df;
}
#app #difficulty-screen .diff-front .diff-info-label{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
}

/* Keep intermediate windows in the roomy horizontal layout too. */
@media(max-width:1100px),(max-height:700px){
  #app #difficulty-screen.setup-screen{display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
  #app #difficulty-screen .setup-content{display:flex;min-height:0;align-self:stretch;justify-content:center;overflow:hidden;padding:16px 14px 20px}
  #app #difficulty-screen .difficulty.setup-choices{
    width:min(620px,100%);height:100%;max-height:492px;min-height:0;margin:auto;padding:0;gap:16px;flex:none;
    grid-template-columns:1fr;grid-template-rows:repeat(3,minmax(0,1fr));
  }
  #app #difficulty-screen .diff-tile{height:100%;min-height:0;aspect-ratio:auto}
  #app #difficulty-screen .difficulty .diff-card[data-level]{
    display:grid;grid-template-columns:clamp(72px,22vw,112px) minmax(0,1fr);align-content:center;align-items:center;
    width:100%;height:100%;padding:16px 70px 16px 20px;gap:12px;filter:none;
  }
  #app #difficulty-screen .diff-tile .diff-card[data-level]::before{
    inset:0;background:transparent url('./comic-controls-neutral/phone-cards-1.webp') center/100% 100% no-repeat;
    border:0;border-radius:0;box-shadow:none;filter:hue-rotate(var(--frame-hue));
  }
  #app #difficulty-screen .diff-tile .diff-card[data-level="pro"]::before{filter:hue-rotate(-32deg) saturate(1.4)}
  #app #difficulty-screen .difficulty .diff-card[data-level][aria-pressed="true"]{
    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)) drop-shadow(0 0 12px #e7f550d9);
  }
  #app #difficulty-screen .difficulty .diff-card .diff-face{width:100%;height:auto;max-height:112px;aspect-ratio:1;transform:none}
  #app #difficulty-screen .difficulty .diff-card .diff-copy{align-items:flex-start;text-align:left;gap:7px}
  #app #difficulty-screen .diff-heading{justify-content:flex-start;gap:10px}
  #app #difficulty-screen .difficulty .diff-card strong{font-size:26px;letter-spacing:-.5px}
  #app #difficulty-screen .difficulty .diff-card .diff-kicker{display:none}
  #app #difficulty-screen .difficulty .diff-card .diff-text{width:100%;max-width:none;font-size:13px;line-height:1.35;text-wrap:pretty}
  #app #difficulty-screen .difficulty .diff-card .pips{height:18px;gap:3px;flex-shrink:0}
  #app #difficulty-screen .difficulty .diff-card .pips b{width:9px;height:7px;border-width:1.5px}
  #app #difficulty-screen .difficulty .diff-card .pips b:nth-child(2){height:12px}
  #app #difficulty-screen .difficulty .diff-card .pips b:nth-child(3){height:18px}
  #app #difficulty-screen .difficulty-note{display:none}
  #app #difficulty-screen .selection-mark{top:8px;right:14px;width:34px;height:34px;font-size:24px;border-width:2px}
  #app #difficulty-screen .diff-front .diff-info{
    top:auto;bottom:24px;left:auto;right:24px;translate:none;width:44px;height:44px;min-height:44px;max-width:none;
    padding:0;gap:0;border-radius:50%;background:#fff6df;
  }
  #app #difficulty-screen .difficulty:has(.is-flipped){grid-template-columns:1fr;grid-template-rows:minmax(0,1fr);gap:0;max-height:none}
  #app #difficulty-screen .difficulty:has(.is-flipped) .diff-tile:not(.is-flipped){display:none}
  #app #difficulty-screen .diff-back{padding:30px 30px 84px}
  #app #difficulty-screen .diff-tile .diff-back::before{
    background:var(--level-tint);border:3px solid var(--brand-ink);border-radius:20px 14px 20px 14px;
    box-shadow:inset 0 0 0 4px var(--level-color);filter:none;
  }
  #app #difficulty-screen .diff-details{overflow:hidden;padding:0 2px;scrollbar-width:none}
  #app #difficulty-screen .diff-facts{font-size:15px;line-height:1.45;gap:16px}
  #app #difficulty-screen .diff-return{bottom:24px}
}
@media(max-width:760px){
  #app #difficulty-screen .setup-content{padding:14px 6px 16px}
  #app #difficulty-screen .difficulty.setup-choices{gap:16px;max-height:492px}
  #app #difficulty-screen .difficulty .diff-card[data-level]{grid-template-columns:clamp(72px,22vw,96px) minmax(0,1fr);padding:12px 72px 12px 16px;gap:8px}
  #app #difficulty-screen .difficulty .diff-card strong{font-size:clamp(18px,5.6vw,24px)}
  #app #difficulty-screen .diff-heading{gap:7px}
  #app #difficulty-screen .difficulty .diff-card .diff-text{font-size:12px;line-height:1.35}
  #app #difficulty-screen .difficulty .diff-card .pips{height:16px;gap:3px}
  #app #difficulty-screen .difficulty .diff-card .pips b{width:7px;height:6px}
  #app #difficulty-screen .difficulty .diff-card .pips b:nth-child(2){height:11px}
  #app #difficulty-screen .difficulty .diff-card .pips b:nth-child(3){height:16px}
  #app #difficulty-screen .selection-mark{right:10px;top:8px}
  #app #difficulty-screen .diff-front .diff-info{right:18px;bottom:18px}
  #app #difficulty-screen .diff-back{padding:24px 22px 80px}
  #app #difficulty-screen .diff-facts{font-size:14px;gap:14px}
}
@media(max-height:620px) and (orientation:portrait){
  #app #difficulty-screen .setup-content{padding-block:10px}
  #app #difficulty-screen .difficulty.setup-choices{gap:12px}
  #app #difficulty-screen .diff-facts{font-size:13px;gap:10px;line-height:1.4}
  #app #difficulty-screen .diff-back{padding:20px 20px 74px}
}
@media(orientation:landscape) and (max-height:700px){
  #app #difficulty-screen .setup-content{padding:10px 6px 12px}
  #app #difficulty-screen .difficulty.setup-choices{width:100%;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:16px}
  #app #difficulty-screen .difficulty .diff-card[data-level]{display:flex;flex-direction:column;justify-content:center;padding:14px 16px 56px;gap:6px}
  #app #difficulty-screen .difficulty .diff-card .diff-face{width:clamp(54px,18dvh,88px);height:clamp(54px,18dvh,88px)}
  #app #difficulty-screen .difficulty .diff-card .diff-copy{align-items:center;text-align:center;gap:5px}
  #app #difficulty-screen .difficulty .diff-card strong{font-size:20px}
  #app #difficulty-screen .diff-heading{gap:7px}
  #app #difficulty-screen .difficulty .diff-card .diff-text{font-size:11px}
  #app #difficulty-screen .selection-mark{top:8px;right:8px;width:30px;height:30px;font-size:22px}
  #app #difficulty-screen .diff-front .diff-info{bottom:10px;right:50%;translate:50% 0}
  #app #difficulty-screen .difficulty:has(.is-flipped){grid-template-columns:1fr}
  #app #difficulty-screen .diff-back{padding:12px 24px 62px}
  #app #difficulty-screen .diff-back-head{min-height:34px;flex-direction:row;justify-content:center;gap:12px;padding-bottom:8px}
  #app #difficulty-screen .diff-back-head h3{font-size:23px}
  #app #difficulty-screen .diff-facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 28px;font-size:13px;line-height:1.35}
  #app #difficulty-screen .diff-return{bottom:12px}
}
@media(max-height:350px) and (orientation:landscape){
  #app #difficulty-screen .difficulty .diff-card[data-level]{padding:8px 12px 54px;gap:3px}
  #app #difficulty-screen .difficulty .diff-card .diff-face{width:48px;height:48px}
  #app #difficulty-screen .difficulty .diff-card strong{font-size:18px}
  #app #difficulty-screen .difficulty .diff-card .diff-copy{gap:4px}
  #app #difficulty-screen .difficulty .diff-card .diff-text{font-size:10px;line-height:1.25}
  #app #difficulty-screen .diff-back-head{min-height:28px;padding-bottom:4px}
  #app #difficulty-screen .diff-back-head h3{font-size:20px}
  #app #difficulty-screen .diff-facts{gap:6px 24px;font-size:12px;line-height:1.25}
}

@media(max-height:350px) and (orientation:landscape){
  #app #difficulty-screen .diff-back{padding:12px 18px}
  #app #difficulty-screen .diff-details{display:grid;grid-template-columns:120px minmax(0,1fr);gap:16px;height:100%;align-items:center}
  #app #difficulty-screen .diff-back-head{height:calc(100% - 56px);margin-bottom:56px;min-height:0;flex-direction:column;justify-content:center;padding:0;gap:5px}
  #app #difficulty-screen .diff-back-head .diff-kicker{font-size:9px}
  #app #difficulty-screen .diff-facts{gap:6px 24px}
  #app #difficulty-screen .diff-return{left:18px;right:auto;translate:none;bottom:12px;width:120px;max-width:120px;padding:5px 7px;font-size:11px;gap:4px}
}
