/* Spring samurai dojo: the same game, set in the bright sakura sketch. */
@font-face {
  font-family: "Zen Maru Gothic";
  src: url("/fonts/anime/ZenMaruGothic-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
html[data-style="anime"] {
  color-scheme: light;
  --anime-cards-image: url("/anime-spring-cards.1d48a263f32d.webp");
  --anime-dojo-image: url("/anime-spring-dojo.c90112c4f5b5.webp");
  --bg: #efe2ce;
  --surface: #fbf4e8;
  --muted: #655746;
  --accent: #d84370;
  --mint: #276e50;
  --line: #9b765980;
  color: #211913;
  background: #caa17c;
  font-family: "Zen Maru Gothic", "Noto Sans", sans-serif;
}
@supports (background-image: image-set(url("fallback.webp") type("image/webp"))) {
  html[data-style="anime"] {
    --anime-cards-image: image-set(url("/anime-spring-cards.ba494b8900a4.avif") type("image/avif"), url("/anime-spring-cards.1d48a263f32d.webp") type("image/webp"));
    --anime-dojo-image: image-set(url("/anime-spring-dojo.c5f4ceb63340.avif") type("image/avif"), url("/anime-spring-dojo.c90112c4f5b5.webp") type("image/webp"));
  }
}
html[data-style="anime"] .room-code { font-family: "Zen Maru Gothic", "Noto Sans", sans-serif; }
html[data-style="anime"] body {
  min-width: 0;
  background: #caa17c var(--anime-dojo-image) center top / cover fixed no-repeat;
}
html[data-style="anime"] button:focus-visible,
html[data-style="anime"] a:focus-visible,
html[data-style="anime"] input:focus-visible { outline-color: #d84370; }
html[data-style="anime"] main:has(> #setup:not([hidden])),
html[data-style="anime"] main:has(> #match:not([hidden])) { padding-top: clamp(46px, 6.5vw, 120px); }
html[data-style="anime"] main:has(> #match:not([hidden])) { padding-top: clamp(34px, 5.5vw, 110px); }

/* Parchment banner and ink-black mark. */
html[data-style="anime"] .masthead {
  min-height: 84px;
  padding: 9px clamp(20px, 9vw, 175px);
  border-top: 6px solid #694127;
  border-bottom: 13px solid #75482a;
  background: linear-gradient(#fffaf1f5, #f4e9daf5);
  box-shadow: 0 3px 0 #2f1d14, 0 10px 20px #39200f85;
}
html[data-style="anime"] .masthead .brand { color: #171310; text-shadow: none; }
html[data-style="anime"] .masthead .brand .spark {
  width: clamp(43px, 4vw, 60px);
  height: clamp(43px, 4vw, 60px);
  flex-basis: clamp(43px, 4vw, 60px);
  background-image: url("/triangle-anime-spring.svg");
}
html[data-style="anime"] .brand-wordmark span:nth-child(5),
html[data-style="anime"] .brand-wordmark span:nth-child(6) { color: #d93b68; }
html[data-style="anime"] .edition { color: #4b352a; }
html[data-style="anime"] .masthead .quiet { color: #211913; text-shadow: none; }
html[data-style="anime"] .masthead .quiet:hover,
html[data-style="anime"] .masthead .quiet:focus-visible { color: #b72a53; background: #f5dce2; }
html[data-style="anime"] .style-options {
  border: 2px solid #79543a;
  background: #fff7eb;
  color: #271a13;
  box-shadow: 0 12px 28px #35200f70;
}
html[data-style="anime"] .style-options button { color: #271a13; border: 1px solid transparent; }

/* Warm paper and visible timber frames across setup, results and account. */
html[data-style="anime"] .panel,
html[data-style="anime"] dialog,
html[data-style="anime"] .intro,
html[data-style="anime"] .arena,
html[data-style="anime"] .history {
  color: #231a14;
  border: 7px ridge #8a5a37;
  border-radius: 3px;
  background: radial-gradient(circle at 20% 20%, #fffdf4d0, #f4e6d2c2 72%),
              repeating-linear-gradient(35deg, transparent 0 3px, #a6794e12 3px 4px);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: inset 0 0 0 2px #c9a279, 0 12px 26px #3720147a;
}
html[data-style="anime"] .intro { padding: 22px; }
html[data-style="anime"] .intro h1 { color: #1d1713; text-shadow: none; }
html[data-style="anime"] .intro h1 span { color: #251915; }
html[data-style="anime"] .eyebrow,
html[data-style="anime"] legend>span:first-child { color: #c53661; }
html[data-style="anime"] .lead,
html[data-style="anime"] .help,
html[data-style="anime"] dialog p { color: #615344; }
html[data-style="anime"] .intro-bottom strong,
html[data-style="anime"] legend { color: #2b1c14; }
html[data-style="anime"] .mini-icon { border-color: #a3664b; color: #b5325a; }
html[data-style="anime"] input {
  color: #211913;
  border-color: #ab856a;
  background: #fffaf1;
}
html[data-style="anime"] .primary,
html[data-style="anime"] .segmented button[aria-pressed="true"],
html[data-style="anime"] .targets button[aria-pressed="true"],
html[data-style="anime"] .modes button[aria-pressed="true"],
html[data-style="anime"] .rating-tabs button[aria-pressed="true"],
html[data-style="anime"] .profile-tabs button[aria-pressed="true"],
html[data-style="anime"] .rating-periods button[aria-pressed="true"],
html[data-style="anime"] .style-options button[aria-pressed="true"],
html[data-style="anime"] .nick-options button[aria-pressed="true"] {
  color: #fff9ed;
  border: 1px solid #9b2e50;
  background: linear-gradient(#bf3d69, #9b2e50);
}
html[data-style="anime"] .segmented button,
html[data-style="anime"] .targets button,
html[data-style="anime"] .modes button,
html[data-style="anime"] .rating-tabs button,
html[data-style="anime"] .rating-periods button,
html[data-style="anime"] .profile-tabs button,
html[data-style="anime"] .history-item,
html[data-style="anime"] .match-end-actions .quiet,
html[data-style="anime"] .rating-page-heading .quiet {
  color: #2d2018;
  border: 1px solid #b68a69;
  background: #fff9ecb8;
}
html[data-style="anime"] :is(main, dialog) button:not(.primary):not([data-move]):not([aria-pressed="true"]):not([id="exit"]) {
  color: #2d2018;
  border: 1px solid #b68a69;
  background: #fff9ecb8;
}
html[data-style="anime"] button:not(.primary):not([data-move]):not([aria-pressed="true"]):is(:hover, :focus-visible):not(:disabled) {
  color: #fff9ed;
  border-color: #9b2e50;
  background: linear-gradient(#bf3d69, #9b2e50);
  box-shadow: 0 3px 9px #9b2e5040;
}
html[data-style="anime"] :is(.primary, button[aria-pressed="true"]):is(:hover, :focus-visible):not(:disabled) {
  color: #fff9ed;
  border-color: #74203e;
  background: linear-gradient(#a83259, #7d2443);
  box-shadow: 0 3px 9px #7d244355;
}
html[data-style="anime"] .history-item:is(:hover, :focus-visible) :is(span, small, strong) { color: #fff9ed; }

/* One aligned source image keeps every hand and card in proportion. */
html[data-style="anime"] .trio>div,
html[data-style="anime"] .trio>div:nth-child(2),
html[data-style="anime"] .move-buttons button {
  aspect-ratio: 3 / 4;
  border: 1px solid #8e5d3c;
  border-radius: 5px;
  background-color: #fff5e5;
  background-image: var(--anime-cards-image);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  box-shadow: 0 6px 11px #5d321f66;
}
html[data-style="anime"] .trio>div:first-child,
html[data-style="anime"] .move-buttons button[data-move="rock"] { background-position: left center; }
html[data-style="anime"] .trio>div:nth-child(2),
html[data-style="anime"] .move-buttons button[data-move="scissors"] { background-position: center center; }
html[data-style="anime"] .trio>div:last-child,
html[data-style="anime"] .move-buttons button[data-move="paper"] { background-position: right center; }
html[data-style="anime"] .trio>div:first-child,
html[data-style="anime"] .trio>div:nth-child(2),
html[data-style="anime"] .trio>div:last-child,
html[data-style="anime"] .move-buttons button[data-move="rock"],
html[data-style="anime"] .move-buttons button[data-move="scissors"],
html[data-style="anime"] .move-buttons button[data-move="paper"] { background-image: var(--anime-cards-image); }
html[data-style="anime"] .trio b,
html[data-style="anime"] .turn-stage.mode-image .move-buttons b {
  right: 6px;
  bottom: 4px;
  left: 6px;
  height: 36%;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  color: #251b16;
  font-family: "Zen Maru Gothic", "Noto Sans", sans-serif;
  font-size: clamp(.945rem, 1.575vw, 1.425rem);
  font-weight: 700;
  letter-spacing: .12em;
  text-shadow: none;
  text-transform: uppercase;
}
html[data-style="anime"] .turn-stage.mode-image .move-buttons b {
  right: 8px;
  bottom: 6px;
  left: 8px;
  height: max(42px, 31%);
}
html[data-style="anime"] .trio b::after,
html[data-style="anime"] .move-buttons b::after {
  order: -1;
  color: #211913;
  font-size: 1.36em;
  line-height: 1;
  text-shadow: none;
}
html[data-style="anime"] .move-buttons button:hover:not(:disabled) { box-shadow: 0 12px 22px #5d321f8a, 0 0 0 3px #d53e6e; }

/* The playing surface follows the two framed paper panels in the sketch. */
html[data-style="anime"] .match-grid { grid-template-columns: minmax(0, 1.85fr) minmax(320px, .95fr); gap: 9px; }
html[data-style="anime"] .arena { padding: 20px 16px 24px; }
html[data-style="anime"] .history { padding: 20px 15px; container-type: inline-size; }
html[data-style="anime"] .match-meta {
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: clamp(5px, 1.2vw, 14px);
  row-gap: 0;
  min-height: 58px;
  margin-bottom: 0;
  color: #2d2018;
  text-shadow: none;
}
html[data-style="anime"] .match-round {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-width: 0;
  width: max-content;
  aspect-ratio: 4.0972;
  padding: 0;
  color: #fffaf0;
  background: transparent;
  clip-path: none;
  font-size: clamp(.85rem, 1.7vw, 1.55rem);
  text-align: center;
  text-shadow: none;
  white-space: nowrap;
}
html[data-style="anime"] .match-round::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 180%;
  aspect-ratio: 7.375;
  background: #211a19;
  clip-path: polygon(0 13%, 6% 5%, 16% 9%, 30% 0, 55% 7%, 80% 2%, 100% 18%, 96% 39%, 100% 79%, 86% 92%, 56% 98%, 28% 90%, 4% 100%, 7% 73%);
  transform: translate(-50%, -50%);
}
html[data-style="anime"] .match-target {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  color: #2d211c;
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-shadow: none;
}
html[data-style="anime"] .match-meta #exit {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  color: #6c4839;
  text-shadow: none;
  white-space: nowrap;
}
html[data-style="anime"] .match-meta #exit:hover,
html[data-style="anime"] .match-meta #exit:focus-visible { color: #fff9ec; border-color: #9b2e50; background: linear-gradient(#bf3d69, #9b2e50); }
html[data-style="anime"] .arena .move-heading {
  margin: 6px 0 0;
  color: #221914;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  font-style: normal;
  text-shadow: none;
}
html[data-style="anime"] .turn-stage { margin-top: 11px; }
html[data-style="anime"] .turn-stage.mode-image .move-buttons { align-items: center; }
html[data-style="anime"] .turn-stage.mode-image .move-buttons button { top: -15px; }
html[data-style="anime"] .turn-stage.mode-image,
html[data-style="anime"] .turn-stage.mode-voice,
html[data-style="anime"] .turn-stage.mode-visual,
html[data-style="anime"] .turn-stage.match-ended { height: 350px; }
html[data-style="anime"] .turn-stage:has(.turn-feedback),
html[data-style="anime"] .turn-stage.match-ended { height: auto; min-height: 350px; }
html[data-style="anime"] .turn-stage:has(.turn-feedback) .turn-feedback,
html[data-style="anime"] .turn-stage:has(.turn-feedback) .turn-feedback>.result-panel,
html[data-style="anime"] .turn-stage:has(.turn-feedback) .turn-feedback>.waiting,
html[data-style="anime"] .turn-stage.match-ended .result-panel { min-height: 350px; }
html[data-style="anime"] .move-buttons { --anime-card-max-width: 174px; }
html[data-style="anime"] .move-buttons button { width: min(calc((100% - 72px) / 3), var(--anime-card-max-width)); }
html[data-style="anime"] .scoreboard {
  width: min(100% - 26px, 500px);
  margin: 0 auto;
  padding: 8px 18px;
  border: 0;
  border-top: 1px solid #a98569;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html[data-style="anime"] .score-player .name { color: #32261e; }
html[data-style="anime"] .score-player strong { color: #231914!important; text-shadow: none!important; }
html[data-style="anime"] .scoreboard .colon { color: #d43f6e; }
html[data-style="anime"] .history h2 {
  position: relative;
  isolation: isolate;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 7px 0;
  border: 0;
  color: #fffaf0;
  background: transparent;
  clip-path: none;
}
html[data-style="anime"] .history h2::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 50%;
  width: min(250%, 100cqw);
  height: 100%;
  background: #211a19;
  clip-path: polygon(0 15%, 9% 2%, 47% 8%, 76% 0, 100% 20%, 96% 75%, 70% 99%, 24% 92%, 2% 100%);
  transform: translateX(-50%);
}
html[data-style="anime"] .history-section h3 { color: #2a1e18; }
html[data-style="anime"] .history-section .help { color: #574433; border-color: #c9ae91; background: #fffaf08c; }
html[data-style="anime"] .history .winner { color: #a62b53; }
html[data-style="anime"] .history table,
html[data-style="anime"] .history-detail table { border: 1px solid #9b7659; background: #fffaf07a; }
html[data-style="anime"] .history th,
html[data-style="anime"] .history-detail th { color: #35231a; background: #dfcdb4b0; }
html[data-style="anime"] .history td,
html[data-style="anime"] .history th,
html[data-style="anime"] .history-detail td,
html[data-style="anime"] .history-detail th { border-color: #aa896e69; }
html[data-style="anime"] .win,
html[data-style="anime"] .connected { color: #28764e; }
html[data-style="anime"] .loss { color: #bc4d31; }
html[data-style="anime"] .draw { color: #6b5c46; }

html[data-style="anime"] .move-symbol,
html[data-style="anime"] .history td .move-symbol,
html[data-style="anime"] .history-detail td .move-symbol,
html[data-style="anime"] .profile-stat-card .move-symbol,
html[data-style="anime"] .reveal .move-symbol,
html[data-style="anime"] #rules-footer .move-symbol {
  background-color: #fff5e5;
  background-image: var(--anime-cards-image);
  background-size: 300% 100%;
  background-repeat: no-repeat;
}
html[data-style="anime"] .move-symbol[data-move="rock"],
html[data-style="anime"] .history td .move-symbol[data-move="rock"],
html[data-style="anime"] .history-detail td .move-symbol[data-move="rock"],
html[data-style="anime"] .reveal .move-symbol[data-move="rock"],
html[data-style="anime"] #rules-footer .move-symbol[data-move="rock"] { background-position: left center; }
html[data-style="anime"] .move-symbol[data-move="scissors"],
html[data-style="anime"] .history td .move-symbol[data-move="scissors"],
html[data-style="anime"] .history-detail td .move-symbol[data-move="scissors"],
html[data-style="anime"] .reveal .move-symbol[data-move="scissors"],
html[data-style="anime"] #rules-footer .move-symbol[data-move="scissors"] { background-position: center center; }
html[data-style="anime"] .move-symbol[data-move="paper"],
html[data-style="anime"] .history td .move-symbol[data-move="paper"],
html[data-style="anime"] .history-detail td .move-symbol[data-move="paper"],
html[data-style="anime"] .reveal .move-symbol[data-move="paper"],
html[data-style="anime"] #rules-footer .move-symbol[data-move="paper"] { background-position: right center; }
html[data-style="anime"] .move-symbol[data-move="rock"] { --anime-move-name: "Камень"; --anime-move-kanji: "石"; }
html[data-style="anime"] .move-symbol[data-move="scissors"] { --anime-move-name: "Ножницы"; --anime-move-kanji: "鋏"; }
html[data-style="anime"] .move-symbol[data-move="paper"] { --anime-move-name: "Бумага"; --anime-move-kanji: "紙"; }
html[lang="uk"][data-style="anime"] .move-symbol[data-move="rock"] { --anime-move-name: "Камінь"; }
html[lang="uk"][data-style="anime"] .move-symbol[data-move="scissors"] { --anime-move-name: "Ножиці"; }
html[lang="uk"][data-style="anime"] .move-symbol[data-move="paper"] { --anime-move-name: "Папір"; }
html[lang="en"][data-style="anime"] .move-symbol[data-move="rock"] { --anime-move-name: "Rock"; }
html[lang="en"][data-style="anime"] .move-symbol[data-move="scissors"] { --anime-move-name: "Scissors"; }
html[lang="en"][data-style="anime"] .move-symbol[data-move="paper"] { --anime-move-name: "Paper"; }
html[data-style="anime"] .history td .move-symbol[data-move],
html[data-style="anime"] .history-detail td .move-symbol[data-move],
html[data-style="anime"] .reveal .move-symbol[data-move],
html[data-style="anime"] #rules-footer .move-symbol[data-move] { background-image: var(--anime-cards-image); }
html[data-style="anime"] .history td .move-symbol,
html[data-style="anime"] .history-detail td .move-symbol,
html[data-style="anime"] .profile-stat-card .move-symbol,
html[data-style="anime"] .reveal .move-symbol,
html[data-style="anime"] #rules-footer .move-symbol {
  position: relative;
  overflow: hidden;
}
html[data-style="anime"] .history td .move-symbol::before,
html[data-style="anime"] .history-detail td .move-symbol::before,
html[data-style="anime"] .profile-stat-card .move-symbol::before,
html[data-style="anime"] .reveal .move-symbol::before,
html[data-style="anime"] #rules-footer .move-symbol::before,
html[data-style="anime"] .history td .move-symbol::after,
html[data-style="anime"] .history-detail td .move-symbol::after,
html[data-style="anime"] .profile-stat-card .move-symbol::after,
html[data-style="anime"] .reveal .move-symbol::after,
html[data-style="anime"] #rules-footer .move-symbol::after {
  position: absolute;
  right: 3%;
  left: 3%;
  display: block;
  color: #241a15;
  font-family: "Zen Maru Gothic", "Noto Sans", sans-serif;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
html[data-style="anime"] .history td .move-symbol::before,
html[data-style="anime"] .history-detail td .move-symbol::before,
html[data-style="anime"] .profile-stat-card .move-symbol::before,
html[data-style="anime"] .reveal .move-symbol::before,
html[data-style="anime"] #rules-footer .move-symbol::before {
  content: var(--anime-move-kanji);
  bottom: calc(5% + var(--anime-mini-name-size) + 1px);
  font-size: var(--anime-mini-kanji-size);
}
html[data-style="anime"] .history td .move-symbol::after,
html[data-style="anime"] .history-detail td .move-symbol::after,
html[data-style="anime"] .profile-stat-card .move-symbol::after,
html[data-style="anime"] .reveal .move-symbol::after,
html[data-style="anime"] #rules-footer .move-symbol::after {
  content: var(--anime-move-name);
  bottom: 5%;
  font-size: var(--anime-mini-name-size);
}
html[data-style="anime"] .reveal>div>b { display: none; }
html[data-style="anime"] .history td .move-symbol,
html[data-style="anime"] .history-detail td .move-symbol {
  width: clamp(38px, 4vw, 52px);
  --anime-mini-name-size: clamp(6px, .8vw, 8px);
  --anime-mini-kanji-size: clamp(9px, 1.2vw, 13px);
}
html[data-style="anime"] .profile-stat-card .move-symbol {
  width: 36px;
  height: auto;
  aspect-ratio: 3 / 4;
  --anime-mini-name-size: 6px;
  --anime-mini-kanji-size: 9px;
}
html[data-style="anime"] .reveal .move-symbol {
  --anime-mini-name-size: clamp(9px, 1.3vw, 12px);
  --anime-mini-kanji-size: clamp(14px, 2vw, 20px);
}
html[data-style="anime"] #rules-footer .move-symbol {
  --anime-footer-card-width: clamp(38px, 5vw, 48px);
  --anime-mini-name-size: clamp(6px, .7vw, 7.5px);
  --anime-mini-kanji-size: clamp(9px, 1vw, 12px);
  width: var(--anime-footer-card-width);
  height: calc(var(--anime-footer-card-width) * 4 / 3);
}
html[data-style="anime"] .result-panel,
html[data-style="anime"] .waiting {
  color: #241a14;
  border: 1px solid #a88765;
  background: #fff9e9a6;
  box-shadow: 0 4px 12px #72452c33;
}
html[data-style="anime"] .turn-stage .result-panel h2 { color: #bb315c; }
html[data-style="anime"] .reveal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(8px, 2vw, 24px);
  row-gap: 4px;
}
html[data-style="anime"] .reveal>div { display: contents; }
html[data-style="anime"] .reveal>div:first-child .move-symbol,
html[data-style="anime"] .reveal>div:first-child small { grid-column: 1; }
html[data-style="anime"] .reveal>div:last-child .move-symbol,
html[data-style="anime"] .reveal>div:last-child small { grid-column: 3; }
html[data-style="anime"] .reveal .move-symbol {
  grid-row: 1;
  justify-self: center;
  margin: 0;
}
html[data-style="anime"] .reveal small {
  display: block;
  grid-row: 2;
  justify-self: center;
  color: #665442;
  line-height: 1.2;
}
html[data-style="anime"] .reveal .vs {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  line-height: 1.2;
}
html[data-style="anime"] .waiting .lock { color: #bc3d65; }
html[data-style="anime"] .profile-stat-card,
html[data-style="anime"] .history-detail,
html[data-style="anime"] .rating-table-wrap { border-color: #bb9876; background: #fff9edb9; }
html[data-style="anime"] .profile-metrics strong,
html[data-style="anime"] .room-code { color: #bb315c; }
html[data-style="anime"] .rating-table th { color: #39271d; background: #e5d4bd; }
html[data-style="anime"] .rating-table tr.self { background: #f8dce4; }
html[data-style="anime"] .rating-page-heading h1,
html[data-style="anime"] .profile-page h1 { color: #231914; text-shadow: none; }
html[data-style="anime"] #rules-footer {
  color: #241a15;
  border: 6px ridge #875837;
  background: #f7eddded;
  box-shadow: 0 8px 20px #45240f8a;
}
html[data-style="anime"] #rules-footer i { background: #d54671; box-shadow: none; }
html[data-style="anime"] dialog::backdrop { background: #2d1d17af; }
html[data-style="anime"] .account-dialog,
html[data-style="anime"] .rating-dialog { color: #231a14; background: #faf0e1; }
html[data-style="anime"] .account-dialog .dialog-heading { background: #e5d0b5; }
html[data-style="anime"] .account-dialog .dialog-heading h2 { color: #241915; }
html[data-style="anime"] .account-dialog .dialog-heading button,
html[data-style="anime"] #leave-dialog .quiet { color: #9d3152; }
html[data-style="anime"] #leave-dialog .quiet:is(:hover, :focus-visible):not(:disabled) { color: #fff9ed; }

@media (max-width: 1150px) {
  html[data-style="anime"] body { background-image: var(--anime-dojo-image); }
  html[data-style="anime"] main:has(> #setup:not([hidden])),
  html[data-style="anime"] main:has(> #match:not([hidden])) { padding-top: 60px; }
  html[data-style="anime"] main:has(> #match:not([hidden])) { padding-top: 44px; }
}
@media (max-width: 1000px) {
  html[data-style="anime"] .match-grid,
  html[data-style="anime"] .setup-grid { grid-template-columns: 1fr; }
  html[data-style="anime"] .shell { width: min(720px, calc(100% - 40px)); }
}
@media (max-width: 720px) {
  html[data-style="anime"] body { background: #e8c8a9 var(--anime-dojo-image) center top / auto 100vh scroll no-repeat; }
  html[data-style="anime"] main:has(> #setup:not([hidden])),
  html[data-style="anime"] main:has(> #match:not([hidden])) { padding-top: 14px; }
  html[data-style="anime"] main:has(> #match:not([hidden])) { padding-top: 8px; }
  html[data-style="anime"] .shell { width: calc(100% - 20px); }
  html[data-style="anime"] .intro h1 { font-size: clamp(1.7rem, 8vw, 2.25rem); }
  html[data-style="anime"] .masthead { min-height: 62px; padding: 5px 8px; border-bottom-width: 7px; }
  html[data-style="anime"] .masthead .brand .spark { width: clamp(24px, 6vw, 38px); height: clamp(24px, 6vw, 38px); flex-basis: clamp(24px, 6vw, 38px); }
  html[data-style="anime"] .masthead .edition { display: none; }
  html[data-style="anime"] .arena,
  html[data-style="anime"] .history,
  html[data-style="anime"] .intro { border-width: 4px; }
  html[data-style="anime"] .arena { padding: 15px 8px; }
  html[data-style="anime"] .match-meta { grid-template-columns: minmax(0, 1fr) auto; gap: 4px; min-height: 59px; padding: 0; }
  html[data-style="anime"] .match-round {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    font-size: clamp(.9rem, 3vw, 1.1rem);
    letter-spacing: 0;
  }
  html[data-style="anime"] .match-target {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    font-size: clamp(.7rem, 2.3vw, .8rem);
    letter-spacing: 0;
  }
  html[data-style="anime"] .match-meta #exit {
    grid-column: 2;
    grid-row: 1;
    padding: 4px 2px;
    font-size: clamp(.7rem, 2.3vw, .8rem);
  }
  html[data-style="anime"] .arena .move-heading { margin-top: 5px; }
  html[data-style="anime"] .turn-stage { margin-top: 10px; }
  html[data-style="anime"] .turn-stage:has(.turn-feedback),
  html[data-style="anime"] .turn-stage.match-ended { height: auto; min-height: 240px; }
  html[data-style="anime"] .turn-stage:has(.turn-feedback) .turn-feedback,
  html[data-style="anime"] .turn-stage:has(.turn-feedback) .turn-feedback>.result-panel,
  html[data-style="anime"] .turn-stage:has(.turn-feedback) .turn-feedback>.waiting,
  html[data-style="anime"] .turn-stage.match-ended .result-panel { min-height: 240px; }
  html[data-style="anime"] .move-buttons { --anime-card-max-width: 142px; }
  html[data-style="anime"] .turn-stage.mode-image .move-buttons b {
    right: 2px;
    left: 2px;
    font-size: clamp(.68rem, 2.8vw, 1.26rem);
    letter-spacing: 0;
  }
  html[data-style="anime"] .trio b {
    right: 1px;
    left: 1px;
    font-size: clamp(.78rem, 2.8vw, 1.2rem);
    letter-spacing: 0;
  }
  html[data-style="anime"] #rules-footer { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  html[data-style="anime"] .match-meta { gap: 2px; }
  html[data-style="anime"] .move-buttons { --anime-card-max-width: 126px; }
  html[data-style="anime"] .turn-stage.mode-image .move-buttons b { height: 36%; }
  html[data-style="anime"] .trio b { height: 42%; }
}

/* Reserve the reveal area from the start so a chosen card never moves the score. */
html[data-style="anime"] .turn-stage.mode-image,
html[data-style="anime"] .turn-stage.mode-image:has(.turn-feedback),
html[data-style="anime"] .turn-stage.mode-image.match-ended {
  height: 316px;
  min-height: 0;
}
html[data-style="anime"] .turn-stage.mode-image .turn-base,
html[data-style="anime"] .turn-stage.mode-image .choice-area,
html[data-style="anime"] .turn-stage.mode-image .move-buttons { height: 100%; }
html[data-style="anime"] .turn-stage.mode-image:has(.turn-feedback) .turn-feedback {
  position: absolute;
  inset: 0;
  display: block;
  min-height: 0;
  overflow: hidden;
}
html[data-style="anime"] .turn-stage.mode-image:has(.turn-feedback) .turn-feedback>.result-panel,
html[data-style="anime"] .turn-stage.mode-image:has(.turn-feedback) .turn-feedback>.waiting,
html[data-style="anime"] .turn-stage.mode-image.match-ended .result-panel {
  height: 100%;
  min-height: 0;
  overflow: visible;
}
html[data-style="anime"] .turn-stage.mode-image:has(.turn-feedback) .result-panel {
  padding-block: 6px;
  overflow: visible;
}
html[data-style="anime"] .turn-stage.mode-image .reveal .move-symbol {
  width: min(100%, 150px);
}
html[data-style="anime"] .turn-stage.mode-image.match-ended .reveal {
  margin: 2px 0;
}
html[data-style="anime"] .turn-stage.mode-image.match-ended .result-panel {
  justify-content: center;
  gap: clamp(12px, 2vw, 18px);
  padding: 6px 16px;
}
html[data-style="anime"] .turn-stage.mode-image.match-ended .match-end-actions button {
  min-height: 36px;
  padding-block: 6px;
}
@media (max-width: 720px) {
  html[data-style="anime"] .turn-stage.mode-image,
  html[data-style="anime"] .turn-stage.mode-image:has(.turn-feedback),
  html[data-style="anime"] .turn-stage.mode-image.match-ended { height: 300px; }
  html[data-style="anime"] .turn-stage.mode-image.match-ended .result-panel { padding: 7px 10px; }
  html[data-style="anime"] .turn-stage.mode-image .reveal .move-symbol { width: min(100%, 142px); }
  html[data-style="anime"] .turn-stage.mode-image.match-ended .reveal { margin: 2px 0 4px; column-gap: 8px; }
  html[data-style="anime"] .turn-stage.mode-image.match-ended .match-end-actions { gap: 5px; }
  html[data-style="anime"] .turn-stage.mode-image.match-ended .match-end-actions button {
    min-height: 36px;
    padding: 6px 8px;
    font-size: .8rem;
  }
}
@media (max-width: 380px) {
  html[data-style="anime"] .turn-stage.mode-image .reveal .move-symbol {
    width: min(100%, 126px);
  }
}
