.fish-matching {
  --fm-ink: #293f43;
  --fm-muted: #425b58;
  --fm-paper: #f4e7c6;
  --fm-teal: #3c645f;
  --fm-gold: #efc77d;
  --fm-wood: #ba9360;
  color: var(--fm-ink);
  font-family: Georgia, "Times New Roman", serif;
}
.fish-matching .fm-shell {
  width: 100%;
  margin: 0 auto;
  padding: 12px 18px 10px;
  border: 3px solid var(--fm-wood);
  background: var(--fm-paper);
  box-shadow: inset 0 0 0 2px #fff5dc, 0 4px 0 #806244;
}
.fish-matching .fm-heading, .fish-matching .fm-toolbar, .fish-matching .fm-actions, .fish-matching .fm-readout { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fish-matching .fm-heading { padding-bottom: 7px; border-bottom: 2px dashed #c6ad7d; }
.fish-matching .fm-kicker { margin: 0 0 2px; color: var(--fm-teal); font: 700 .68rem/1.2 system-ui, sans-serif; letter-spacing: .12em; }
.fish-matching .fm-heading h2 { margin: 0; color: var(--fm-ink); font-size: 1.45rem; }
.fish-matching .fm-stamp { padding: 5px 8px; border: 2px solid var(--fm-gold); color: #76552b; font: 800 .72rem/1.1 system-ui,sans-serif; white-space: nowrap; }
.fish-matching .fm-instructions { margin: 7px 0; color: var(--fm-muted); font: .84rem/1.35 system-ui,sans-serif; }
.fish-matching .fm-toolbar { min-height: 39px; padding: 5px 0; border-block: 1px solid #d7c49d; }
.fish-matching .fm-reward { margin: 0; color: var(--fm-muted); font: .8rem/1.25 system-ui,sans-serif; }
.fish-matching .fm-actions { justify-content: flex-end; flex-wrap: wrap; }
.fish-matching .fm-difficulty { display: inline-flex; align-items: center; gap: 6px; color: var(--fm-muted); font: 700 .78rem/1.2 system-ui,sans-serif; }
.fish-matching select, .fish-matching [data-action="retry"] { min-height: 34px; padding: 4px 8px; border: 2px solid var(--fm-teal); border-radius: 2px; background: #fff8e7; color: var(--fm-ink); font: 700 .8rem/1.2 system-ui,sans-serif; }
.fish-matching [data-action="retry"] { background: #e4efdf; cursor: pointer; }
.fish-matching select:disabled, .fish-matching [data-action="retry"]:disabled { opacity: .55; cursor: default; }
.fish-matching .fm-readout { justify-content: center; gap: clamp(15px, 5vw, 52px); margin: 6px 0; color: var(--fm-muted); font: .82rem/1.2 system-ui,sans-serif; }
.fish-matching .fm-readout strong { color: var(--fm-ink); }
.fish-matching .fm-board-wrap { padding: 5px; border: 3px solid #805f3c; background: linear-gradient(145deg,#d9cfaa,#bcaa7e); box-shadow: inset 0 0 0 2px #f5e7c3, 0 3px 0 #684c32; }
.fish-matching .fm-board { display: grid; grid-template-columns: repeat(var(--fm-columns, 4), minmax(0, 1fr)); gap: clamp(4px, .8vw, 9px); max-width: min(810px, 105vh); margin: auto; }
.fish-matching .fm-card { display: flex; min-width: 0; min-height: 71px; height: clamp(72px, 10.5vh, 98px); aspect-ratio: auto; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 2px; overflow: hidden; border: 2px solid #426c68; border-radius: 3px; background: #3f655b; color: var(--fm-ink); box-shadow: inset 3px 3px #ffffff50, inset -3px -3px #203e3d36, 0 2px 0 #54706a; cursor: pointer; }
.fish-matching .fm-card:not(:disabled):not(.is-open):hover { transform: translateY(-1px); background-color: #456b61; }
.fish-matching .fm-card:disabled { opacity: 1; cursor: default; }
.fish-matching .fm-card:focus-visible, .fish-matching select:focus-visible, .fish-matching [data-action="retry"]:focus-visible { position: relative; z-index: 1; outline: 3px solid #9b572f; outline-offset: 1px; }
.fish-matching .fm-card-back { display: grid; width: 84%; height: 82%; place-content: center; gap: 3px; border: 1px solid #e7d6a3; outline: 1px dashed #e7d6a3; outline-offset: -4px; color: #f6e4b5; text-align: center; }
.fish-matching .fm-card-back i { font-size: 1.3rem; font-style: normal; line-height: 1; }
.fish-matching .fm-card-back small { font: 800 .52rem/1 system-ui,sans-serif; letter-spacing: .16em; }
.fish-matching .fm-card.is-open { border-color: #a67740; background: #fff1d0; box-shadow: inset 0 0 0 2px #fffaf0, 0 2px 0 #916c3f; }
.fish-matching .fm-card.is-matched { border-color: #638a63; background: #e1edcf; box-shadow: inset 0 0 0 2px #f3f6dc; }
.fish-matching .fish-art { display: block; width: min(100%, 90px); height: min(76%, 60px); flex: 1 1 auto; overflow: visible; }
.fish-matching .fm-card > span:last-child:not(.fm-card-back) { max-width: 100%; overflow: hidden; color: #334c48; font: 700 clamp(.55rem, 1.15vw, .7rem)/1.1 system-ui,sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.fish-matching .fm-status { min-height: 1.3em; margin: 6px 0 0; padding: 5px 9px; border-left: 4px solid #6d9a78; background: #e8edd8; color: #39584c; font: 700 .83rem/1.3 system-ui,sans-serif; }
.fish-matching .fm-status.is-success { border-color: #4a8058; background: #e6f0d8; color: #2e5d3c; }
.fish-matching .fm-status.is-failure { border-color: #b86d4b; background: #f6e3d1; color: #784532; }
.fish-matching .fm-status.is-pending { border-color: #bd8e42; background: #fff0cc; color: #66502e; }
.fish-matching .fm-status.is-paused { border-color: #bd8e42; background: #fff0cc; color: #66502e; }
@media (max-width: 620px) {
  .fish-matching .fm-shell { box-sizing: border-box; width: 100%; min-width: 0; padding: 9px; }
  .fish-matching .fm-heading, .fish-matching .fm-toolbar { align-items: flex-start; flex-direction: column; }
  .fish-matching .fm-actions { justify-content: flex-start; }
  .fish-matching .fm-board { width: 100%; min-width: 0; }
  .fish-matching .fm-card { box-sizing: border-box; min-width: 0; min-height: 58px; width: 100%; height: auto; aspect-ratio: 1.05 / 1; }
}
@media (max-height: 760px) {
  .fish-matching .fm-shell { padding-block: 8px; }
  .fish-matching .fm-instructions { margin: 5px 0; }
  .fish-matching .fm-card { min-height: 55px; aspect-ratio: auto; height: 74px; }
  .fish-matching .fm-board { max-width: 730px; }
  .fish-matching .fm-status { margin-top: 4px; padding-block: 4px; }
}
