/* Keep the full explanation on desktop; give the phone viewport to the pet. */
.match-style-short{display:none}
@media(max-width:800px){
 .match-shell{height:100svh;height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .match-shell .match-header{flex:none;width:100%;max-width:none;min-height:52px;padding:calc(5px + env(safe-area-inset-top)) 12px 5px;gap:10px}
 .match-header .brand{gap:7px}
 .match-header .brand-logo{width:32px;height:32px;border-radius:11px}
 .match-header .brand-logo .ico{width:22px;height:22px}
 .match-header .brand-name{font-size:23px}
 .match-header .brand-sub{display:none}
 .match-header-actions{gap:8px}
 .match-header-favorites{min-height:40px;padding:7px 10px;gap:6px}
 .match-header-favorites>span{display:none}
 .match-home-button{min-height:40px;font-size:14px;padding:7px 4px}
 .match-shell .match-layout{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;max-width:none;margin:0;padding:0 8px calc(6px + env(safe-area-inset-bottom));gap:6px}
 .match-intro{display:flex;flex-wrap:wrap;align-self:stretch;align-items:center;justify-content:space-between;flex:none;min-height:40px;padding:0 4px;gap:8px}
 .match-intro h1{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;padding:0;margin:0;border:0}
 .match-style-long{display:none}
 .match-style-short{display:inline}
 .match-style-pill{font-size:14px;min-height:38px;margin:0;padding:7px 9px;gap:4px;white-space:nowrap}
 .match-filter{margin:0;gap:4px;flex:none;white-space:nowrap}
 .match-filter button{font-size:14px;min-height:38px;padding:7px 10px}
 .match-shell .match-arena{display:grid;grid-template-rows:auto minmax(0,1fr) 76px;flex:1;min-height:0;max-width:none;width:100%}
 .match-deck-heading{margin:0 6px 5px;font-size:12px;gap:8px}
 .swipe-guide-buttons{gap:12px}
 .swipe-guide-buttons button{font-size:12px;min-height:30px}
 .match-shell .match-deck,.match-shell .match-deck.is-finished{height:auto;min-height:0}
 .match-card{border-radius:20px}
 .match-shell .match-card-photo{inset:0;width:100%;height:100%;aspect-ratio:auto}
 .match-card .catalog-photo{left:50%;top:50%;width:auto;height:100%;min-width:100%;aspect-ratio:1;transform:translate(-50%,-50%)}
 .match-shell .match-card-shade{background:linear-gradient(0deg,#071e2b 0%,#071e2bf5 12%,#071e2bba 25%,#071e2b26 48%,transparent 65%)}
 .match-shell .match-card-info{padding:0 18px 10px}
 .match-name h2{font-size:34px;line-height:1.35}
 .match-name>span{font-size:21px}
 .match-basic{display:block;font-size:14px;line-height:1.6;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .match-basic i{margin:0 4px}
 .match-personality{margin-top:8px;flex-wrap:nowrap;overflow:hidden;gap:6px}
 .match-personality span{font-size:14px;padding:4px 9px;white-space:nowrap}
 .match-reason{font-size:16px;line-height:1.65;min-height:0;margin:8px 0 2px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
 .match-detail-button{font-size:15px;min-height:42px;padding:6px 0}
 .match-shell .match-card-top{top:36px;left:12px;right:12px}
 .match-fit-badge,.match-saved-badge{font-size:11px;padding:6px 9px}
 .match-controls{align-items:center;margin:0;padding-top:8px;gap:34px}
 .match-control-wrap{gap:3px}
 .match-control-wrap>button{width:54px;height:54px}
 .match-control-wrap .match-undo{width:42px;height:42px;margin-top:6px;margin-bottom:6px}
 .match-control-wrap>span{font-size:12px}
 .match-card-note{display:none}
 .swipe-direction-signs{top:77px}
 .swipe-teach{top:28%}
 .match-finished{justify-content:center}
 .match-announcement{bottom:calc(88px + env(safe-area-inset-bottom))}
}
@media(max-width:360px){
 .match-header .brand-name{font-size:21px}
 .match-header-actions{gap:6px}
 .match-style-pill{font-size:12px;padding:7px}
 .match-filter button{font-size:13px;padding:7px 8px}
 .match-shell .match-card-info{padding-left:15px;padding-right:15px}
 .match-name h2{font-size:31px}
 .match-basic{font-size:13px}
 .match-personality span{font-size:13px}
}
@media(max-width:800px) and (max-height:700px){
 .match-shell .match-header{min-height:46px}
 .match-intro{min-height:36px}
 .match-style-pill,.match-filter button{min-height:34px;padding-top:5px;padding-bottom:5px}
 .match-shell .match-arena{grid-template-rows:auto minmax(0,1fr) 70px}
 .match-controls{padding-top:6px}
 .match-control-wrap>button{width:50px;height:50px}
 .match-control-wrap .match-undo{width:40px;height:40px;margin-top:5px;margin-bottom:5px}
 .match-reason{-webkit-line-clamp:1}
}
/* In a short landscape viewport, scroll the page instead of clipping controls. */
@media(max-width:800px) and (max-height:499px){
 .match-shell{height:auto;min-height:100svh;overflow-x:clip;overflow-y:visible}
 .match-shell .match-layout{flex:none}
 .match-shell .match-arena{flex:none;grid-template-rows:auto 420px 76px}
}

/* A narrow card has one row for its title and count and one for its tools. */
.match-arena { container-type: inline-size; }
.match-deck-heading {
 display: grid;
 grid-template-columns: max-content minmax(0, 1fr) max-content;
 grid-template-areas: "title tools count";
 align-items: center;
}
.match-deck-label { grid-area: title; }
.match-deck-label, .match-position { white-space: nowrap; }
.match-position { grid-area: count; justify-self: end; }
.match-deck-heading .swipe-guide-buttons {
 grid-area: tools;
 min-width: 0;
 margin: 0;
 justify-content: flex-end;
}
@container (max-width: 505px) {
 .match-deck-heading {
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-areas: "title count" "tools tools";
  gap: 2px 12px;
 }
 .match-deck-heading .swipe-guide-buttons {
  justify-content: space-between;
  gap: 4px 10px;
 }
}
.swipe-teach-inline{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:clamp(7px,2vw,20px);padding:6px;color:var(--gold-ink);background:var(--white);border:1px solid var(--line);border-radius:12px;font-size:14px;font-weight:650}
.swipe-teach-inline button{border:0;border-bottom:1px solid currentColor;padding:4px;background:transparent;color:var(--gold-ink);font:inherit;cursor:pointer}
.swipe-hand{display:inline-flex;color:var(--gold-ink);animation:swipe-hint 2.4s ease-in-out infinite}
@keyframes swipe-hint{0%,100%{transform:translateX(0)}25%{transform:translateX(-8px) rotate(-9deg)}75%{transform:translateX(8px) rotate(9deg)}}
@media(prefers-reduced-motion:reduce){.swipe-hand{animation:none}}.no-motion .swipe-hand,[data-motion="off"] .swipe-hand{animation:none}
.match-control-wrap>span{color:var(--ink-light);font-size:14px;white-space:nowrap}
@media(max-width:800px){.match-shell .match-arena{grid-template-rows:auto minmax(0,1fr) auto}.match-bottom-controls{min-width:0}}
@media(max-width:800px) and (max-height:520px){.match-shell .match-arena{grid-template-rows:auto 420px auto}}
