@charset "utf-8";

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: #f4f1e3;
  background:
    radial-gradient(circle at 12% 10%, rgba(34, 96, 138, .34), transparent 24rem),
    radial-gradient(circle at 86% 14%, rgba(7, 29, 17, 0.342), transparent 22rem),
    linear-gradient(135deg, #02040a 0%, #061222 48%, #0a213b 100%);
  font-family: "Hiragino Kaku Gothic Pro", "Meiryo", sans-serif;
}

a { color: inherit; }

button,
input,
select {
  font: inherit;
}

.makashic-page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

body[data-page="shiritori"] {
  min-height: 100svh;
  overflow: hidden;
}

body[data-page="index"] {
  color: #173241;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 248, 213, .86), transparent 23rem),
    radial-gradient(circle at 82% 8%, rgba(96, 177, 220, .30), transparent 25rem),
    linear-gradient(135deg, #9fd9f5 0%, #d7eff7 43%, #fff3cf 100%);
}

body.eye-blackout::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  background: #000;
}

body.eye-blackout {
  overflow: hidden;
}

.eye-black-stage {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  overflow: hidden;
  background: #000;
  color: #fff;
  pointer-events: none;
}

.omen-lane {
  position: absolute;
  left: 0;
  top: var(--omen-y, 50vh);
  width: 100vw;
  overflow: visible;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: 0;
  text-shadow: none;
}

.omen-rail {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  width: max-content;
  will-change: transform;
}

.omen-white {
  --rainbow-fill: 0%;
  color: #fff;
  clip-path: inset(0 0 0 var(--rainbow-fill));
}

.omen-rainbow {
  color: transparent;
  opacity: 0;
  --rainbow-fill: 0%;
  text-shadow: none;
  background: repeating-linear-gradient(
    90deg,
    #e31a45 0rem,
    #ff641c 1.25rem,
    #e8c900 2.5rem,
    #24c866 3.75rem,
    #0088e8 5rem,
    #5545e8 6.25rem,
    #9d25cc 7.5rem,
    #e31a45 8.75rem
  );
  background-size: 17.5rem 100%;
  line-height: 1.18;
  clip-path: inset(0 calc(100% - var(--rainbow-fill)) 0 0);
  -webkit-background-clip: text;
  background-clip: text;
  transition: opacity 2.4s linear;
}

.eye-black-stage.omen-rainbow-on .omen-rainbow {
  opacity: 1;
}

.omen-slab {
  display: inline-block;
}

body[data-page="index"] .page-title p {
  color: #3c3932;
}

body[data-page="index"] .control-panel,
body[data-page="index"] .detail-panel {
  border-color: #3f3a31;
  background: rgba(255, 249, 224, .94);
  box-shadow: 6px 6px 0 rgba(54, 48, 38, .30);
}

body[data-page="index"] .count-pill {
  border-color: #3f3a31;
  background: #f4e7bc;
  box-shadow: 4px 4px 0 rgba(54, 48, 38, .36);
}

body[data-page="index"] .index-range-pill {
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}

body[data-page="index"] .index-range-pill.dragging {
  background: #fbd56a;
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 rgba(54, 48, 38, .55);
}

body[data-page="index"] .makashic-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding-bottom: 18px;
}

body[data-page="index"] .page-title {
  padding: 12px 0 14px;
}

body[data-page="index"] .page-title h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
}

body[data-page="index"] .index-layout {
  min-height: 0;
  align-items: stretch;
}

body[data-page="index"] .index-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

body[data-page="index"] .control-panel {
  position: sticky;
  top: 8px;
  z-index: 2;
}

body[data-page="index"] .monster-index-list {
  min-height: 0;
  max-height: calc(100vh - 255px);
  overflow-y: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  border: 2px solid rgba(63, 58, 49, .72);
  border-radius: 4px;
  background: rgba(255, 255, 255, .60);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
  padding: 0;
}

body[data-page="index"] .detail-panel {
  max-height: calc(100vh - 18px);
  overflow: auto;
}

body[data-page="shiritori"] .makashic-page {
  height: 100svh;
  max-height: 100svh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  overflow: hidden;
}

.makashic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0 22px;
}

.brand {
  font-weight: 900;
  text-decoration: none;
}

.makashic-head nav,
.mode-panel,
.sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.makashic-head a,
.primary-link,
.mode-panel button,
.answer-form button,
.sort-buttons button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #181716;
  background: #fffbf3;
  padding: 9px 14px;
  color: #181716;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 4px 4px 0 #181716;
}

body[data-page="shiritori"] .makashic-head a.brand,
body[data-page="shiritori"] .makashic-head nav a[href="index.html"] {
  background: #a5a5a5;
}

.mode-panel button[data-mode="spectate"] {
  background: #92f3f336;
}

.makashic-head a[aria-current="page"],
.mode-panel button.selected,
.sort-buttons button.selected {
  background: #1f7d93;
  color: #fff;
}

.zukan-sort-buttons {
  align-items: center;
  gap: 7px;
}

.zukan-sort-buttons button {
  min-height: 34px;
  padding: 6px 10px;
  border-color: rgba(12, 107, 141, .42);
  background: linear-gradient(#ffffff, #e7fbff);
  color: #0d5668;
  box-shadow: 3px 3px 0 rgba(24, 23, 22, .62);
  font-size: .82rem;
}

.zukan-sort-buttons button.selected {
  border-color: #0d5668;
  background: linear-gradient(135deg, #0d5668, #1f7d93);
  color: #fff;
}

.page-title {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 18px;
  align-items: end;
  padding: 26px 0;
}

.page-title p {
  grid-column: 1 / -1;
  margin: 0;
  color: #f4c542;
  font-weight: 800;
}

.page-title h1 {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 4.7rem);
  line-height: 1;
}

.count-pill {
  min-width: 128px;
  border: 3px solid #181716;
  background: #f4c542;
  padding: 12px;
  text-align: center;
  box-shadow: 5px 5px 0 #181716;
}

.count-pill strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.count-pill span {
  font-size: .8rem;
  font-weight: 800;
}

.index-layout,
.battle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.control-panel,
.detail-panel,
.mode-panel,
.opponent-panel,
.play-panel {
  border: 3px solid #181716;
  background: rgba(255, 249, 235, .93);
  color: #181716;
  padding: 16px;
  box-shadow: 7px 7px 0 rgba(24, 23, 22, .72);
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.panel-toggle {
  display: none;
  width: 100%;
  border: 2px solid #181716;
  background: #fff8d9;
  color: #181716;
  padding: 6px 8px;
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.control-panel.collapsed > :not(.panel-toggle),
.detail-panel.collapsed > :not(.panel-toggle) {
  display: none;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 2px solid #181716;
  background: #fff;
  padding: 8px 10px;
}

.result-line {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin: 18px 0 10px;
  font-weight: 800;
}

.result-line strong {
  font-size: 1.5rem;
}

.monster-index-list {
  width: 100%;
  overflow: auto;
}

.public-zukan-table {
  width: 100%;
  min-width: 520px;
  border-collapse: separate;
  border-spacing: 0;
  color: #181716;
  font-size: .92rem;
  table-layout: fixed;
}

.public-zukan-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: .58rem .68rem;
  border-bottom: 2px solid rgba(63, 58, 49, .45);
  color: #fff;
  background: linear-gradient(90deg, #0d5668, #1f7d93);
  text-align: left;
  white-space: nowrap;
}

.public-zukan-table th:nth-child(1),
.public-zukan-table td:nth-child(1) {
  width: 5.3rem;
}

.public-zukan-table th:nth-child(3),
.public-zukan-table td:nth-child(3) {
  width: 13rem;
}

.public-zukan-table tbody td {
  padding: .42rem .68rem;
  border-bottom: 1px solid rgba(63, 58, 49, .18);
  background: rgba(255, 255, 255, .48);
  vertical-align: middle;
}

.public-zukan-table tbody tr:nth-child(even) td {
  background: rgba(255, 250, 225, .66);
}

.public-zukan-table tbody tr {
  cursor: pointer;
}

.public-zukan-table tbody tr:hover td,
.public-zukan-table tbody tr:focus-visible td {
  background: #e8fbff;
  outline: 2px solid #1f7d93;
  outline-offset: -2px;
}

.public-zukan-table tbody tr.featured-random td {
  background: #fff3cf;
  border-top: 3px solid #181716;
  border-bottom: 3px solid #181716;
}

.public-zukan-table tbody tr.featured-random strong {
  color: #181716;
  font-size: 1.28rem;
  font-weight: 900;
}

.public-zukan-table tbody tr.featured-random .row-no {
  min-width: 4.6rem;
  font-size: .86rem;
}

.public-zukan-table tbody tr.index-eye-row {
  cursor: default;
}

.public-zukan-table tbody tr.index-eye-row strong {
  color: #181716;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.row-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.8rem;
  border: 1px solid rgba(63, 58, 49, .42);
  border-radius: 3px;
  background: #eee4c7;
  color: #2f2a22;
  font-family: Consolas, monospace;
  font-size: .72rem;
  font-weight: 900;
}

.public-zukan-table strong {
  min-width: 0;
  display: block;
  color: #12333e;
  font-size: .95rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.public-zukan-table small {
  display: block;
  color: #43545a;
  font-size: .82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.detail-panel {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 14px;
}

.thumb-box,
.opponent-image {
  --image-pad-y: 0%;
  position: relative;
  min-height: 230px;
  height: 100%;
  min-width: 0;
  display: grid;
  place-items: center;
  border: 2px solid #181716;
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--fighter-soft, #e6f4f7), transparent 18%) 25%, transparent 25% 50%, color-mix(in srgb, var(--fighter-soft, #e6f4f7), transparent 18%) 50% 75%, transparent 75%),
    #fff;
  background-size: 22px 22px;
  overflow: hidden;
  font-weight: 900;
}

.opponent-image {
  min-height: clamp(84px, 20svh, 230px);
  height: auto;
  max-height: 100%;
}

.thumb-box {
  min-height: 160px;
  height: auto;
  place-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  padding: 8px;
}

.thumb-link {
  position: relative;
  display: block;
  min-height: 118px;
  border: 2px solid #22546a;
  background: rgba(255, 255, 255, .72);
  overflow: hidden;
}

.thumb-box img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.opponent-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.thumb-link img {
  position: absolute;
  inset: 0;
}

.illust-link-list {
  display: grid;
  gap: 8px;
}

.illust-page-link {
  min-height: 36px;
  padding: 7px 10px;
  box-shadow: 3px 3px 0 #181716;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  border-bottom: 1px solid rgba(24, 23, 22, .25);
  padding-bottom: 8px;
}

dt {
  color: #65313e;
  font-weight: 900;
}

dd {
  margin: 0;
  line-height: 1.55;
}

.battle-layout {
  grid-template-columns: 330px minmax(0, 1fr);
}

body[data-page="shiritori"] .page-title,
body[data-page="shiritori"] .mode-panel,
body[data-page="shiritori"] .battle-layout {
  min-height: 0;
}

body[data-page="shiritori"] .page-title {
  padding: 0;
}

body[data-page="shiritori"] .makashic-head {
  padding: 0;
}

body[data-page="shiritori"] .compact-head {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.sound-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sound-notice {
  position: absolute;
  top: 50%;
  right: calc(100% + 6px);
  transform: translateY(-50%);
  z-index: 24;
  padding: 3px 5px;
  background: rgba(255, 255, 255, .58);
  color: #aa423f;
  font-size: .72rem;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
}

.sound-notice.hidden {
  display: none;
}

.sound-toggle {
  width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #181716;
  background: #fff9eb;
  padding: 0;
  color: #181716;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 3px 3px 0 #181716;
  cursor: pointer;
}

.sound-toggle[aria-pressed="true"] {
  background: #f4c542;
}

.sound-control input[type="range"] {
  width: 82px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  min-height: 0;
  accent-color: #f4c542;
  cursor: pointer;
}

.sound-control input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border: 2px solid #181716;
  background: #fff9eb;
}

.sound-control input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 22px;
  margin-top: -10px;
  border: 2px solid #181716;
  background: #f4c542;
  -webkit-appearance: none;
  appearance: none;
}

.sound-control input[type="range"]::-moz-range-track {
  height: 6px;
  border: 2px solid #181716;
  background: #fff9eb;
}

.sound-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 22px;
  border: 2px solid #181716;
  border-radius: 0;
  background: #f4c542;
}

body[data-page="shiritori"] .compact-head h1 {
  margin: 0;
  overflow: hidden;
  font-size: clamp(1rem, 2.6vw, 1.45rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="shiritori"] .compact-head .count-pill {
  min-width: 88px;
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 4px;
  align-items: baseline;
  padding: 5px 7px;
  border-width: 2px;
  box-shadow: 2px 2px 0 #181716;
}

body[data-page="shiritori"] .compact-head .count-pill strong {
  font-size: 1rem;
}

body[data-page="shiritori"] .compact-head .count-pill span {
  font-size: .64rem;
}

body[data-page="shiritori"] .pool-pill {
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
  position: relative;
}

body[data-page="shiritori"] .pool-pill.dragging {
  background: #ffd45a;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #181716;
}

body[data-page="shiritori"] .page-title p {
  display: none;
}

body[data-page="shiritori"] .page-title h1 {
  font-size: clamp(1.18rem, 3vw, 1.85rem);
}

body[data-page="shiritori"] .count-pill {
  min-width: 92px;
  padding: 7px 9px;
}

body[data-page="shiritori"] .count-pill strong {
  font-size: 1.25rem;
}

body[data-page="shiritori"] .mode-panel {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
}

body[data-page="shiritori"] .mode-panel button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.bet-panel {
  --wallet-col: 64px;
  --wallet-font: .62rem;
  --wallet-icon: 18px;
  --wallet-pad: 4px 3px;
  --bet-gap: 8px;
  position: relative;
  display: grid;
  grid-template-columns: var(--wallet-col) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--bet-gap);
  align-items: stretch;
  border: 3px solid #181716;
  background: rgba(255, 249, 235, .93);
  color: #181716;
  padding: 6px;
  box-shadow: 6px 6px 0 rgba(24, 23, 22, .72);
}

.bet-panel::before {
  content: "勝敗予想";
  position: absolute;
  left: 10px;
  top: -0.78em;
  padding: 0 6px;
  background: rgba(255, 249, 235, .0);
  color: #181716;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    -1px -1px 0 #fff9eb,
    1px -1px 0 #fff9eb,
    -1px 1px 0 #fff9eb,
    1px 1px 0 #fff9eb;
  pointer-events: none;
}

.bet-panel[hidden] {
  display: none;
}

.wallet-line,
.bet-box {
  min-width: 0;
  gap: 4px;
  align-items: center;
  border: 2px solid #181716;
  background: #fff;
  padding: 6px;
}

.wallet-line {
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: var(--wallet-pad);
}

.wallet-line span {
  display: none;
}

.bet-box span {
  font-size: .7rem;
  font-weight: 900;
}

.bet-box strong {
  min-width: 0;
  display: inline-flex;
  gap: 2px;
  align-items: center;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
}

.wallet-line strong {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  gap: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: var(--wallet-font);
  line-height: 1;
  white-space: nowrap;
}

.wallet-line img {
  flex: 0 0 auto;
  width: var(--wallet-icon);
  height: var(--wallet-icon);
  object-fit: contain;
}

.wallet-line b {
  flex: 0 1 auto;
  min-width: 0;
}

[data-wallet-kado].wallet-digits-4,
[data-wallet-kado-main].wallet-digits-4 {
  font-size: .86em;
}

[data-wallet-kado].wallet-digits-5,
[data-wallet-kado-main].wallet-digits-5 {
  font-size: .74em;
}

[data-wallet-kado].wallet-digits-6,
[data-wallet-kado-main].wallet-digits-6 {
  font-size: .64em;
}

.bet-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  background: linear-gradient(90deg, var(--bet-soft, #fff), #fff 68%);
  box-shadow: inset 7px 0 0 var(--bet-color, transparent);
}

.bet-box span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-box em {
  color: #9d1426;
  font-size: .82rem;
  font-style: normal;
  font-weight: 900;
}

.bet-box button {
  min-height: 28px;
  border: 2px solid #181716;
  background: #f1d34a;
  padding: 2px 6px;
  color: #181716;
  font-weight: 900;
  box-shadow: 2px 2px 0 #181716;
}

.shop-panel {
  position: relative;
  z-index: 2147483100;
  display: grid;
  gap: 8px;
  border: 3px solid #181716;
  background: rgba(255, 249, 235, .96);
  color: #181716;
  padding: 10px;
  box-shadow: 6px 6px 0 rgba(24, 23, 22, .72);
}

.shop-panel[hidden] {
  display: none;
}

.shop-head,
.shop-item > div,
.shop-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.shop-head {
  justify-content: space-between;
}

.shop-shelf {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.shop-item {
  display: grid;
  grid-template-rows: 72px auto minmax(3.8em, auto) auto auto;
  gap: 6px;
  border: 2px solid #181716;
  background: #fff;
  padding: 8px;
  box-shadow: inset 7px 0 0 #f4c542;
}

.shop-dot {
  display: grid;
  place-items: center;
  margin: 0;
  min-height: 72px;
  border: 2px solid #181716;
  background:
    linear-gradient(180deg, #fffdf4 0 66%, #d2a94b 66% 74%, #8f6630 74% 100%);
  box-shadow: inset 0 -5px 0 rgba(24, 23, 22, .16);
}

.shop-dot img {
  display: block;
  max-width: min(92px, 88%);
  max-height: 60px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.shop-item strong {
  font-weight: 900;
}

.shop-item span,
.shop-item p,
.shop-status {
  margin: 0;
  color: #65313e;
  font-size: .76rem;
  font-weight: 800;
}

.shop-item label {
  display: grid;
  gap: 4px;
  font-size: .72rem;
  font-weight: 900;
}

.shop-item select,
.shop-item input {
  min-width: 0;
  border: 2px solid #181716;
  background: #cefae9;
  padding: 5px;
  color: #181716;
  font-weight: 800;
}

[data-shop-toggle].shop-open {
  background: #f4c542;
  color: #181716;
  box-shadow: 3px 3px 0 #181716;
}

.power-help {
  border-top: 2px solid #181716;
  padding-top: 5px;
  font-size: .72rem;
  font-weight: 800;
}

.power-help summary {
  cursor: pointer;
  color: #181716;
  font-weight: 900;
}

.power-help ul {
  display: grid;
  gap: 4px;
  max-height: min(220px, 34vh);
  margin: 6px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-left: 1.2em;
  padding-right: 6px;
  color: #65313e;
}

.shop-panel button {
  min-height: 28px;
  border: 2px solid #181716;
  background: #f4c542;
  padding: 3px 8px;
  color: #181716;
  font-weight: 900;
  box-shadow: 2px 2px 0 #181716;
}

.shop-panel button:disabled {
  border-color: #74706a;
  background: #beb9ad;
  color: #5f5a53;
  box-shadow: 1px 1px 0 #74706a;
  cursor: not-allowed;
}

body[data-page="shiritori"] .battle-layout {
  height: 100%;
  align-items: stretch;
}

.opponent-panel,
.play-panel {
  display: grid;
  gap: 14px;
}

.fighter-card {
  position: relative;
  top: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(1.55em, auto);
  gap: 10px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.power-tooltip {
  position: fixed;
  left: var(--tip-x, 0);
  top: var(--tip-y, 0);
  z-index: 2147483200;
  width: max-content;
  max-width: min(260px, calc(100vw - 18px));
  border: 1px solid #fff;
  background: #181818;
  color: #f5f5f5;
  padding: 2px 5px;
  font-family: "Hiragino Kaku Gothic Pro", "Meiryo", sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  white-space: pre-line;
  box-shadow: none;
  pointer-events: none;
  opacity: 0;
}

.power-tooltip-strong {
  color: #e9dbdc;
}

.power-tooltip-weak {
  color: #e0e9f3;
}

.fighter-card.tooltip-open .power-tooltip:not([hidden]),
.power-tooltip.tooltip-open:not([hidden]) {
  opacity: 1;
}

.token-stack {
  position: absolute;
  right: 2px;
  bottom: 2.3em;
  z-index: 2147483000;
  width: 72px;
  height: calc(100% - 2.3em);
  pointer-events: none;
  overflow: visible;
}

.bet-token {
  position: absolute;
  right: calc(var(--token-x, 0) * 9px);
  bottom: calc(var(--token-y, 0) * 7px);
  width: 0;
  height: 0;
  border-right: 8px solid transparent;
  border-bottom: 14px solid #f4c542;
  border-left: 8px solid transparent;
  filter: drop-shadow(1px 2px 0 #181716);
  animation: token-hop .28s ease both;
}

.bet-token.flying {
  animation: token-fly .72s ease-in forwards;
}

.bet-token.token-fx {
  position: fixed;
  z-index: 2147483000;
  pointer-events: none;
}

.bet-token.scattering {
  z-index: 2147483000;
  animation: token-scatter .82s cubic-bezier(.2, .78, .45, 1) forwards;
}

@keyframes token-hop {
  0% { transform: translateY(-10px) scale(.88); opacity: 0; }
  70% { transform: translateY(2px) scale(1.06); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes token-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--fly-x, 0px), var(--fly-y, 0px)) scale(.25) rotate(460deg); opacity: 0; }
}

@keyframes token-scatter {
  0% { transform: translate(0, 0) scale(1.15) rotate(0deg); opacity: 1; filter: drop-shadow(0 0 5px #fff) drop-shadow(1px 2px 0 #181716); }
  42% { opacity: 1; }
  100% { transform: translate(var(--scatter-x, 0px), var(--scatter-y, 0px)) scale(.32) rotate(920deg); opacity: 0; filter: drop-shadow(0 0 7px #f4c542) drop-shadow(1px 2px 0 #181716); }
}

body:not(.spectator-mode) .rival-card {
  display: none;
}

body.spectator-mode .opponent-panel {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

body[data-page="shiritori"] .opponent-panel,
body[data-page="shiritori"] .play-panel {
  min-height: 0;
}

body[data-page="shiritori"] .play-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

body[data-page="shiritori"].game-ended .play-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

body[data-page="shiritori"].game-ended .answer-form {
  display: none;
}

.opponent-panel p {
  margin: 0;
  min-height: 1.55em;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  color: #181716;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .18s ease;
}

.opponent-panel p span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opponent-panel p b {
  min-width: 3.2em;
  border: 2px solid #181716;
  background: rgba(255, 255, 255, .82);
  padding: 2px 5px;
  color: #181716;
  font-size: .82rem;
  line-height: 1;
  transition: color .18s ease;
}

.opponent-panel p.time-danger {
  color: var(--time-color, #f2263a);
}

body.spectator-mode .answer-form {
  display: none;
}

body.spectator-mode .play-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

body.spectator-mode [data-hide-colosseum] {
  display: none;
}

body.spectator-mode .opponent-panel p {
  min-height: 1.55em;
  font-size: .88rem;
}

.status-line {
  display: flex;
  gap: 6px;
  align-items: stretch;
  justify-content: space-between;
}

.status-grid {
  display: grid;
  grid-template-columns: auto auto auto max-content;
  justify-content: start;
  gap: 6px;
}

.status-grid div {
  min-width: 0;
  border: 2px solid #181716;
  background: #fff;
  padding: 5px 8px;
  overflow: hidden;
}

.status-grid span {
  display: block;
  color: #5b5a56;
  font-size: .62rem;
  font-weight: 800;
}

.status-grid strong {
  display: block;
  margin-top: 1px;
  font-size: 1.05rem;
  line-height: 1;
  white-space: nowrap;
  transition: color .18s ease;
}

.hint-tool {
  display: grid;
  grid-template-columns: max-content;
  gap: 5px;
  align-items: stretch;
}

.hint-tool[hidden] {
  display: none;
}

.hint-tool button {
  min-height: 0;
  border: 2px solid #181716;
  padding: 4px 6px;
  color: #181716;
  font-weight: 900;
  line-height: 1.1;
}

.hint-tool button {
  background: #b9efc5;
  cursor: pointer;
  box-shadow: 2px 2px 0 #181716;
}

.hint-tool button:disabled {
  background: #beb9ad;
  color: #5f5a53;
  cursor: not-allowed;
}

.status-grid .wallet-status {
  min-width: max-content;
  overflow: visible;
}

.status-grid .wallet-status strong {
  display: inline-flex;
  align-items: baseline;
  min-width: max-content;
  font-size: .9rem;
}

.status-grid div.time-danger {
  border-color: var(--time-color, #f2263a);
}

.status-grid div.time-danger span,
.status-grid div.time-danger strong,
.status-grid strong.time-danger,
.status-grid strong .time-danger {
  color: var(--time-color, #f2263a);
}

.opponent-panel p b.time-danger {
  border-color: var(--time-color, #f2263a);
  color: var(--time-color, #f2263a);
}

.answer-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.answer-form button {
  min-width: 94px;
  background: #e9566f;
  color: #fff;
}

.judge-line {
  min-height: 48px;
  margin: 0;
  border: 2px solid #181716;
  background: #e2a829;
  padding: 12px;
  font-weight: 900;
}

.judge-line small {
  margin-left: .5em;
  font-size: .72em;
  font-weight: 900;
}

.judge-line.win { background: #98d8c0; }
.judge-line.lose { background: #ef9b9b; }

.history-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  list-style: none;
}

body[data-page="shiritori"] .history-list {
  min-height: 0;
  max-height: none;
}

body[data-page="shiritori"].game-ended .history-list {
  border: 2px solid rgba(24, 23, 22, .35);
  background: rgba(255, 255, 255, .38);
  padding: 6px;
}

.history-list li {
  display: grid;
  grid-template-columns: 70px 1fr 42px;
  gap: 8px;
  align-items: center;
  border: 2px solid #181716;
  background: #fff;
  padding: 8px 10px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.history-list li.speaker-left {
  background: linear-gradient(90deg, var(--speaker-soft, #f1f1ec), #f1f1ec 58%);
  border-color: #181716;
  box-shadow: inset 8px 0 0 var(--speaker-color, #d8d8d0);
}

.history-list li.speaker-right {
  background: linear-gradient(270deg, var(--speaker-soft, #f1f1ec), #f1f1ec 58%);
  border-color: #181716;
  box-shadow: inset -8px 0 0 var(--speaker-color, #d8d8d0);
}

.history-list li.n-end-lost strong {
  color: #d71920;
  text-shadow: 1px 1px 0 rgba(24, 23, 22, .18);
}

.history-list li.jump {
  animation: history-jump .34s ease;
}

@keyframes history-jump {
  0% { transform: translateY(0); }
  45% { transform: translateY(-7px); box-shadow: 0 7px 0 rgba(24, 23, 22, .22); }
  100% { transform: translateY(0); }
}

.fighter-card.active-turn .opponent-image {
  animation: fighter-glow 1s ease-in-out infinite alternate;
  box-shadow: 0 0 0 3px #fff, 0 0 18px var(--fighter-color, #f4c542), 0 0 34px var(--fighter-color, #f4c542);
}

.fighter-card.speaking {
  animation: fighter-jump .34s ease;
}

.fighter-card.death-rattle .opponent-image {
  animation: death-rattle .085s linear infinite;
}

.fighter-card.death-rattle .bet-token:not(.flying):not(.scattering) {
  animation: death-rattle .085s linear infinite;
}

.fighter-card.knockout .opponent-image {
  animation: knockout-shake .9s ease both;
}

.fighter-card.knockout .opponent-image img {
  animation: knockout-blink .9s steps(2, end) both;
}

@keyframes fighter-glow {
  from { filter: brightness(1); }
  to { filter: brightness(1.18); }
}

@keyframes fighter-jump {
  0% { top: 0; }
  45% { top: -8px; }
  100% { top: 0; }
}

@keyframes death-rattle {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-1px, 1px) rotate(-.35deg); }
  50% { transform: translate(1px, -1px) rotate(.35deg); }
  75% { transform: translate(-1px, -1px) rotate(.2deg); }
  100% { transform: translate(1px, 1px) rotate(-.2deg); }
}

@keyframes knockout-shake {
  0%, 100% { transform: translateX(0); filter: brightness(1); }
  12% { transform: translateX(-6px); filter: brightness(1.45); }
  24% { transform: translateX(7px); filter: brightness(.65); }
  36% { transform: translateX(-7px); filter: brightness(1.55); }
  48% { transform: translateX(5px); filter: brightness(.45); }
  70% { transform: translateX(0); filter: brightness(.15); }
  100% { transform: translateX(0); filter: brightness(0); }
}

@keyframes knockout-blink {
  0% { opacity: 1; }
  20% { opacity: .08; }
  40% { opacity: 1; }
  62% { opacity: .06; }
  100% { opacity: 0; }
}

.history-list span,
.history-list em {
  color: #65313e;
  font-size: .82rem;
  font-style: normal;
  font-weight: 900;
}

.history-list em {
  color: var(--tail-heat-color, #181716);
}

.loading {
  border: 2px solid #181716;
  background: #fff9eb;
  padding: 16px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .page-title,
  .index-layout,
  .battle-layout,
  .control-panel,
  .answer-form,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

  body[data-page="shiritori"] .makashic-page {
    width: min(560px, calc(100% - 16px));
    gap: 6px;
    padding: 8px 0;
  }

  body[data-page="shiritori"] .makashic-head {
    padding: 0;
  }

  body[data-page="shiritori"] .compact-head {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 4px;
  }

  body[data-page="shiritori"] .brand {
    max-width: none;
    white-space: nowrap;
    line-height: 1;
  }

  body[data-page="shiritori"] .compact-head nav {
    justify-content: flex-end;
  }

  body[data-page="shiritori"] .compact-head h1 {
    grid-column: 1 / 3;
    min-width: 0;
  }

  body[data-page="shiritori"] .sound-control {
    grid-column: 3;
    grid-row: 2;
  }

  body[data-page="shiritori"] .compact-head .count-pill {
    grid-column: 4;
    grid-row: 2;
  }

  body[data-page="shiritori"] .makashic-head a,
  body[data-page="shiritori"] .mode-panel button,
  body[data-page="shiritori"] .answer-form button {
    min-height: 34px;
    padding: 6px 9px;
    box-shadow: 3px 3px 0 #181716;
    font-size: .86rem;
  }

  body[data-page="shiritori"] .makashic-head nav,
  body[data-page="shiritori"] .mode-panel {
    gap: 6px;
  }

  body[data-page="shiritori"] .page-title {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
  }

  body[data-page="shiritori"] .page-title p {
    overflow: hidden;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="shiritori"] .page-title h1 {
    font-size: clamp(1.15rem, 5vw, 1.55rem);
  }

  body[data-page="shiritori"] .count-pill {
    min-width: 74px;
    padding: 4px 6px;
    border-width: 2px;
    box-shadow: 3px 3px 0 #181716;
  }

  body[data-page="shiritori"] .count-pill strong {
    font-size: 1.25rem;
  }

  body[data-page="shiritori"] .count-pill span {
    font-size: .66rem;
  }

  body[data-page="shiritori"] .mode-panel {
    padding: 7px;
  }

  body[data-page="shiritori"] .battle-layout {
    gap: 8px;
    grid-template-rows: auto minmax(0, 1fr);
  }

  body[data-page="shiritori"] .opponent-panel,
  body[data-page="shiritori"] .play-panel {
    gap: 7px;
    border-width: 2px;
    box-shadow: 4px 4px 0 rgba(24, 23, 22, .72);
  }

  body[data-page="shiritori"] .opponent-panel {
    padding: 9px 8px;
  }

  body[data-page="shiritori"] .play-panel {
    padding: 8px;
  }

  body[data-page="shiritori"] .opponent-panel {
    grid-template-columns: 1fr;
    align-items: start;
  }

  body.spectator-mode .opponent-panel {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  body.spectator-mode .fighter-card {
    gap: 5px;
  }

  body[data-page="shiritori"] .opponent-image {
    min-height: clamp(94px, 19svh, 141px);
    height: auto;
  }

  body[data-page="shiritori"] .opponent-panel p {
    text-align: left;
  }

  body.spectator-mode .opponent-panel p {
    text-align: center;
    white-space: normal;
    line-height: 1.2;
  }

  body[data-page="shiritori"] .status-grid {
    grid-template-columns: auto auto auto max-content;
    justify-content: start;
    gap: 6px;
  }

  body[data-page="shiritori"] .status-line {
    gap: 5px;
  }

  body[data-page="shiritori"] .hint-tool {
    grid-template-columns: max-content;
    min-width: 0;
  }

  body[data-page="shiritori"] .hint-tool button {
    padding: 3px 5px;
    font-size: .72rem;
  }

  body[data-page="shiritori"] .status-grid div {
    min-width: 0;
    padding: 4px 5px;
    border-width: 2px;
  }

  body[data-page="shiritori"] .status-grid span {
    font-size: .56rem;
  }

  body[data-page="shiritori"] .status-grid strong {
    font-size: .86rem;
  }

  body[data-page="shiritori"] .status-grid .wallet-status strong {
    font-size: .78rem;
  }

  body[data-page="shiritori"] .answer-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  body[data-page="shiritori"] label {
    gap: 4px;
    font-size: .78rem;
  }

  body[data-page="shiritori"] input {
    min-height: 36px;
    padding: 6px 8px;
  }

  body[data-page="shiritori"] .judge-line {
    min-height: 38px;
    padding: 8px;
    font-size: .86rem;
  }

  body[data-page="shiritori"] .history-list {
    gap: 5px;
  }

  body[data-page="shiritori"] .history-list li {
    grid-template-columns: 54px minmax(0, 1fr) 28px;
    gap: 5px;
    padding: 5px 7px;
    border-width: 2px;
  }

  body[data-page="shiritori"] .history-list strong {
    overflow: visible;
    line-height: 1.25;
    text-overflow: clip;
    white-space: normal;
  }

  body[data-page="shiritori"] .history-list span,
  body[data-page="shiritori"] .history-list em {
    font-size: .7rem;
  }
}

@media (max-width: 560px) {
  .makashic-head {
    align-items: flex-start;
    flex-direction: column;
  }

  body:not([data-page="shiritori"]) .page-title h1 {
    font-size: 2.3rem;
  }

  body[data-page="index"] {
    overflow: auto;
  }

  body[data-page="index"] .makashic-page {
    min-height: 100svh;
    gap: 5px;
    padding: max(18px, env(safe-area-inset-top)) 8px 12px;
    overflow: visible;
  }

  body[data-page="index"] .makashic-head {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    padding: 0;
    width: 100%;
    overflow: visible;
  }

  body[data-page="index"] .makashic-head nav {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-start;
  }

  body[data-page="index"] .makashic-head a {
    min-height: 28px;
    padding: 4px 7px;
    box-shadow: 2px 2px 0 #181716;
    font-size: .66rem;
    line-height: 1;
    white-space: nowrap;
  }

  body[data-page="index"] .brand {
    flex: 0 1 auto;
    max-width: 136px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="index"] .page-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1px 6px;
    width: 100%;
    align-items: center;
  }

  body[data-page="index"] .page-title h1 {
    grid-column: 1;
    width: 100%;
    font-size: 1rem;
    line-height: 1.05;
  }

  body[data-page="index"] .page-title p {
    display: block;
    grid-column: 1;
    width: 100%;
    font-size: .58rem;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  body[data-page="index"] .count-pill {
    min-width: auto;
    display: inline-grid;
    grid-template-columns: auto auto;
    gap: 3px;
    align-items: baseline;
    padding: 2px 4px;
    border-width: 2px;
    box-shadow: 2px 2px 0 rgba(54, 48, 38, .36);
  }

  body[data-page="index"] .count-pill strong {
    font-size: .78rem;
  }

  body[data-page="index"] .count-pill span {
    font-size: .48rem;
  }

  body[data-page="index"] .index-layout {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 6px;
    overflow: visible;
  }

  body[data-page="index"] .index-main {
    overflow: visible;
    grid-template-rows: auto minmax(0, 1fr);
  }

  body[data-page="index"] .control-panel {
    position: static;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 5px;
    border-width: 2px;
    box-shadow: 3px 3px 0 rgba(54, 48, 38, .30);
  }

  body[data-page="index"] .control-panel .panel-toggle {
    grid-column: 1 / -1;
  }

  body[data-page="index"] .control-panel label {
    gap: 3px;
    font-size: .68rem;
  }

  body[data-page="index"] .control-panel input,
  body[data-page="index"] .control-panel select {
    min-height: 30px;
    padding: 5px 6px;
    font-size: .78rem;
  }

  body[data-page="index"] .control-panel .sort-buttons {
    gap: 4px;
  }

  body[data-page="index"] .control-panel .sort-buttons button {
    min-height: 30px;
    padding: 5px 7px;
    font-size: .72rem;
  }

  body[data-page="index"] .panel-toggle {
    display: block;
  }

  body[data-page="index"] .monster-index-list {
    max-height: 64svh;
    overflow: auto;
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    border: 2px solid rgba(63, 58, 49, .72);
    border-radius: 4px;
    background: rgba(255, 255, 255, .60);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
    padding: 0;
  }

  body[data-page="index"] .public-zukan-table {
    min-width: 430px;
    font-size: .82rem;
  }

  body[data-page="index"] .public-zukan-table th:nth-child(1),
  body[data-page="index"] .public-zukan-table td:nth-child(1) {
    width: 4.6rem;
  }

  body[data-page="index"] .public-zukan-table th:nth-child(3),
  body[data-page="index"] .public-zukan-table td:nth-child(3) {
    width: 8.4rem;
  }

  body[data-page="index"] .public-zukan-table thead th,
  body[data-page="index"] .public-zukan-table tbody td {
    padding: .36rem .48rem;
  }

  body[data-page="index"] .row-no {
    min-width: 3.1rem;
    font-size: .68rem;
  }

  body[data-page="index"] .public-zukan-table strong {
    font-size: .86rem;
  }

  body[data-page="index"] .public-zukan-table small {
    font-size: .72rem;
  }

  body[data-page="index"] .detail-panel {
    max-height: 30svh;
    overflow: auto;
    gap: 8px;
    padding: 5px;
    border-width: 2px;
    box-shadow: 3px 3px 0 rgba(54, 48, 38, .30);
  }

  body[data-page="index"] .detail-panel.collapsed {
    max-height: 34px;
    overflow: hidden;
  }

  body[data-page="index"] .detail-panel h2 {
    font-size: 1rem;
  }

  body[data-page="index"] .detail-panel p {
    margin: 0;
    font-size: .72rem;
  }

  body[data-page="shiritori"] .makashic-head {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }

  body[data-page="shiritori"] .compact-head h1,
  body[data-page="shiritori"] .sound-control,
  body[data-page="shiritori"] .compact-head .count-pill {
    grid-column: auto;
  }

  .bet-panel {
    --wallet-col: 48px;
    --wallet-font: .50rem;
    --wallet-icon: 12px;
    --wallet-pad: 2px 1px;
    --bet-gap: 4px;
    gap: 4px;
    padding: 4px;
  }

  body.spectator-mode .bet-box {
    grid-template-columns: minmax(0, 1fr) auto auto auto auto;
    gap: 2px;
    padding: 3px;
    box-shadow: inset 4px 0 0 var(--bet-color, transparent);
  }

  body.spectator-mode .bet-box span {
    font-size: .58rem;
  }

  body.spectator-mode .bet-box strong {
    font-size: .68rem;
  }

  body.spectator-mode .bet-box em {
    font-size: .58rem;
  }

  body.spectator-mode .bet-box button {
    min-height: 21px;
    padding: 0 3px;
    border-width: 1px;
    font-size: .62rem;
    box-shadow: 1px 1px 0 #181716;
  }

  .shop-panel {
    gap: 5px;
    padding: 6px;
    border-width: 2px;
    box-shadow: 3px 3px 0 rgba(24, 23, 22, .72);
  }

  .shop-item {
    gap: 4px;
    min-width: 160px;
    padding: 5px;
    border-width: 2px;
    grid-template-rows: 56px auto minmax(3em, auto) auto auto;
  }

  .shop-dot {
    min-height: 56px;
  }

  .shop-dot img {
    max-height: 48px;
    max-width: min(78px, 86%);
  }

  .shop-shelf {
    grid-auto-columns: minmax(160px, 72vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .shop-item {
    scroll-snap-align: start;
  }

  .shop-item p,
  .shop-item span,
  .shop-status {
    font-size: .64rem;
  }

  .shop-panel button {
    min-height: 24px;
    padding: 2px 5px;
    font-size: .68rem;
  }

  .power-help ul {
    max-height: min(150px, 24vh);
  }

  body[data-page="shiritori"] .opponent-panel {
    justify-items: center;
  }

  body[data-page="shiritori"] .fighter-card {
    width: 100%;
  }

  body[data-page="shiritori"] .opponent-panel p {
    white-space: normal;
  }

  body[data-page="shiritori"] .opponent-panel p span {
    overflow: visible;
    text-overflow: clip;
  }

  body[data-page="shiritori"] .status-grid {
    grid-template-columns: auto auto auto max-content;
    justify-content: start;
    gap: 3px;
  }

  body[data-page="shiritori"] .status-grid div {
    padding: 3px 4px;
  }

  body[data-page="shiritori"] .status-grid span {
    font-size: .54rem;
  }

  body[data-page="shiritori"] .status-grid strong {
    font-size: .82rem;
  }

  body[data-page="shiritori"] .status-grid .wallet-status strong {
    font-size: .7rem;
  }

  body[data-page="shiritori"] .compact-head {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }

  body[data-page="shiritori"] .compact-head h1 {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  body[data-page="shiritori"] .sound-control {
    grid-column: 3;
    grid-row: 2;
  }

  body[data-page="shiritori"] .compact-head .count-pill {
    grid-column: 4;
    grid-row: 2;
  }
}

@media (max-width: 420px) and (max-height: 720px) {
  body[data-page="shiritori"] .brand {
    font-size: .9rem;
  }

  body[data-page="shiritori"] .page-title p {
    display: none;
  }

  body[data-page="shiritori"] .page-title h1 {
    font-size: 1.45rem;
  }

  body[data-page="shiritori"] .mode-panel button {
    flex: 0 0 auto;
  }

  body[data-page="shiritori"] .battle-layout {
    grid-template-rows: auto minmax(0, 1fr);
  }

  body[data-page="shiritori"] .opponent-image {
    min-height: clamp(77px, 18svh, 112px);
  }

  body[data-page="shiritori"] .opponent-panel p {
    font-size: .8rem;
    white-space: normal;
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  body[data-page="shiritori"] .makashic-page {
    width: min(1180px, calc(100% - 12px));
    gap: 5px;
    padding: 5px 0;
  }

  body[data-page="shiritori"] .makashic-head {
    padding: 0;
    gap: 8px;
  }

  body[data-page="shiritori"] .brand {
    font-size: .72rem;
    max-width: none;
  }

  body[data-page="shiritori"] .makashic-head nav {
    gap: 5px;
  }

  body[data-page="shiritori"] .compact-head {
    grid-template-columns: auto auto minmax(120px, 1fr) auto auto;
    gap: 5px;
  }

  body[data-page="shiritori"] .compact-head h1 {
    font-size: 1rem;
  }

  body[data-page="shiritori"] .makashic-head a,
  body[data-page="shiritori"] .sound-toggle,
  body[data-page="shiritori"] .mode-panel button,
  body[data-page="shiritori"] .answer-form button {
    min-height: 28px;
    padding: 4px 8px;
    box-shadow: 2px 2px 0 #181716;
    font-size: .78rem;
  }

  body[data-page="shiritori"] .sound-toggle {
    width: 28px;
    padding: 0;
  }

  body[data-page="shiritori"] .sound-control input[type="range"] {
    width: 58px;
  }

  body[data-page="shiritori"] .page-title {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    padding: 0;
  }

  body[data-page="shiritori"] .page-title p {
    display: none;
  }

  body[data-page="shiritori"] .page-title h1 {
    font-size: clamp(1.25rem, 4vh, 1.7rem);
  }

  body[data-page="shiritori"] .count-pill {
    min-width: 76px;
    padding: 4px 6px;
    border-width: 2px;
    box-shadow: 2px 2px 0 #181716;
  }

  body[data-page="shiritori"] .count-pill strong {
    font-size: 1rem;
  }

  body[data-page="shiritori"] .count-pill span {
    font-size: .58rem;
  }

  body[data-page="shiritori"] .mode-panel {
    gap: 5px;
    padding: 5px;
    border-width: 2px;
    box-shadow: 3px 3px 0 rgba(24, 23, 22, .72);
  }

  body[data-page="shiritori"] .bet-panel {
    --wallet-col: 48px;
    --wallet-font: .42rem;
    --wallet-icon: 8px;
    --wallet-pad: 2px 1px;
    --bet-gap: 5px;
    gap: 5px;
    padding: 5px;
    border-width: 2px;
    box-shadow: 3px 3px 0 rgba(24, 23, 22, .72);
  }

  body[data-page="shiritori"] .bet-box {
    padding: 4px;
  }

  body[data-page="shiritori"] .wallet-line {
    padding: var(--wallet-pad);
  }

  body[data-page="shiritori"] .bet-box {
    grid-template-columns: auto auto auto auto auto;
  }

  body[data-page="shiritori"] .bet-box strong {
    font-size: .78rem;
  }

  body[data-page="shiritori"] .bet-box button {
    min-height: 24px;
    padding: 1px 5px;
    font-size: .72rem;
  }

  body[data-page="shiritori"] .battle-layout {
    grid-template-columns: minmax(180px, 28%) minmax(0, 1fr);
    gap: 7px;
  }

  body[data-page="shiritori"] .opponent-panel,
  body[data-page="shiritori"] .play-panel {
    gap: 5px;
    border-width: 2px;
    box-shadow: 3px 3px 0 rgba(24, 23, 22, .72);
  }

  body[data-page="shiritori"] .opponent-panel {
    padding: 7px 6px;
  }

  body[data-page="shiritori"] .play-panel {
    padding: 6px;
  }

  body[data-page="shiritori"] .fighter-card {
    gap: 4px;
  }

  body[data-page="shiritori"] .opponent-panel p {
    font-size: .72rem;
    line-height: 1.15;
    white-space: normal;
  }

  body[data-page="shiritori"] .status-grid {
    gap: 5px;
  }

  body[data-page="shiritori"] .hint-tool {
    grid-template-columns: max-content;
  }

  body[data-page="shiritori"] .status-grid div {
    padding: 3px 6px;
  }

  body[data-page="shiritori"] .status-grid span {
    font-size: .58rem;
  }

  body[data-page="shiritori"] .status-grid strong {
    margin-top: 1px;
    font-size: .92rem;
  }

  body[data-page="shiritori"] .answer-form {
    gap: 5px;
  }

  body[data-page="shiritori"] label {
    gap: 2px;
    font-size: .7rem;
  }

  body[data-page="shiritori"] input {
    min-height: 30px;
    padding: 4px 7px;
  }

  body[data-page="shiritori"] .judge-line {
    min-height: 30px;
    padding: 5px 7px;
    font-size: .76rem;
  }

  body[data-page="shiritori"] .history-list {
    gap: 4px;
  }

  body[data-page="shiritori"] .history-list li {
    grid-template-columns: 52px minmax(0, 1fr) 24px;
    gap: 5px;
    padding: 4px 6px;
  }

  body[data-page="shiritori"] .history-list span,
  body[data-page="shiritori"] .history-list em {
    font-size: .64rem;
  }
}
