.ff-view, .ff-view * { box-sizing: border-box; }
.ff-view {
  --ff-night: #06151b;
  --ff-sea: #073444;
  --ff-panel: #102c35;
  --ff-wood: #513120;
  --ff-gold: #f5c75c;
  --ff-ink: #fff5d5;
  min-height: 100dvh;
  overflow-x: clip;
  color: var(--ff-ink);
  background:
    radial-gradient(circle at 12% 20%, rgba(42, 174, 188, .2), transparent 23rem),
    radial-gradient(circle at 90% 62%, rgba(245, 177, 61, .13), transparent 28rem),
    linear-gradient(155deg, #0a3540 0, #061a22 45%, #030e13 100%);
}
.ff-head {
  min-height: 64px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px auto;
  align-items: center;
  gap: 7px;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(239, 211, 139, .14);
  background: rgba(3, 16, 21, .88);
  backdrop-filter: blur(16px);
}
.ff-icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 242, 211, .17);
  border-radius: 14px;
  color: #ffe6a1;
  background: rgba(25, 69, 76, .72);
  font: 950 1.45rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.ff-help-button {
  border-color: rgba(255, 216, 107, .48);
  color: #263c3b;
  background: linear-gradient(145deg, #ffe6a0, #cf8e2d);
  font-size: 1rem;
}
.ff-heading { min-width: 0; }
.ff-heading small, .ff-heading h1 { display: block; overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.ff-heading small { color: #90b9b9; font-size: .57rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.ff-heading h1 { margin-top: 1px; color: #fff0b9; font-size: clamp(1rem, 4.3vw, 1.28rem); letter-spacing: .02em; }
.ff-wallet {
  min-width: 66px;
  max-width: 112px;
  overflow: hidden;
  padding: 9px 10px;
  border: 1px solid rgba(255, 210, 91, .3);
  border-radius: 13px;
  color: #ffe28c;
  background: rgba(5, 27, 32, .88);
  font-size: .78rem;
  font-weight: 950;
  text-align: center;
  text-overflow: ellipsis;
}
.ff-shell { width: min(100%, 1020px); margin: 0 auto; padding: 10px max(6px, env(safe-area-inset-right)) 26px max(6px, env(safe-area-inset-left)); }
.ff-game {
  position: relative;
  overflow: hidden;
  padding: 10px;
  border: 1px solid rgba(225, 198, 127, .19);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0, rgba(43, 145, 152, .3), transparent 52%),
    linear-gradient(168deg, rgba(15, 54, 62, .98), rgba(4, 21, 27, .99));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}
.ff-game::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .22;
  background-image: radial-gradient(circle, rgba(255,255,255,.38) 0 1px, transparent 1.5px);
  background-size: 31px 31px;
  mask-image: linear-gradient(to bottom, #000, transparent 55%);
}
.ff-intro { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 1px 2px 9px; }
.ff-intro small, .ff-intro h2 { display: block; margin: 0; }
.ff-intro small { color: #8db3b5; font-size: .56rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.ff-intro h2 { margin-top: 2px; font-size: clamp(.86rem, 3.7vw, 1.16rem); line-height: 1.08; }
.ff-cascade-badge { min-width: 58px; padding: 6px 7px; border: 1px solid rgba(255, 210, 91, .24); border-radius: 12px; background: rgba(2, 19, 23, .7); text-align: center; }
.ff-cascade-badge small { color: #8eaaad; font-size: .48rem; letter-spacing: .07em; text-transform: uppercase; }
.ff-cascade-badge b { display: block; margin-top: 1px; color: #ffe18a; font-size: .78rem; }

.ff-stage { position: relative; display: grid; grid-template-areas: "left" "board" "right"; gap: 7px; }
.ff-crew { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.ff-crew-left { grid-area: left; }
.ff-crew-right { grid-area: right; }
.ff-crew li {
  --ff-collector: #77d7df;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(119, 215, 223, .24);
  border-radius: 12px;
  background: rgba(4, 25, 30, .86);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ff-crew li[data-fleet-collector="ruby"] { --ff-collector: #ff6c6c; border-color: rgba(255, 108, 108, .3); }
.ff-crew li[data-fleet-collector="aqua"] { --ff-collector: #58c8ff; border-color: rgba(88, 200, 255, .3); }
.ff-crew li[data-fleet-collector="lime"] { --ff-collector: #64dc92; border-color: rgba(100, 220, 146, .3); }
.ff-crew li[data-fleet-collector="violet"] { --ff-collector: #c98aff; border-color: rgba(201, 138, 255, .3); }
.ff-crew li.is-active { z-index: 4; border-color: var(--ff-collector); box-shadow: 0 0 0 2px rgba(255,255,255,.1), 0 0 24px rgba(84, 206, 216, .25); transform: translateY(-2px) scale(1.015); }
.ff-crew li.is-complete { background: rgba(29, 61, 54, .94); }
.ff-scout-avatar { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border: 2px solid var(--ff-collector); border-radius: 50% 50% 44% 44%; color: #fff7dc; background-color: #183841; background-image: url("assets/pirwongs-color-crew-v1.webp"); background-repeat: no-repeat; background-size: 400% 180%; box-shadow: inset 0 -5px rgba(0,0,0,.18); }
.ff-scout-avatar > i { display: none; }
.ff-crew li[data-fleet-collector="ruby"] .ff-scout-avatar { background-position: 0 50%; }
.ff-crew li[data-fleet-collector="aqua"] .ff-scout-avatar { background-position: 33.333% 50%; }
.ff-crew li[data-fleet-collector="lime"] .ff-scout-avatar { background-position: 66.667% 50%; }
.ff-crew li[data-fleet-collector="violet"] .ff-scout-avatar { background-position: 100% 50%; }
.ff-crew li > span:nth-child(2) { min-width: 0; }
.ff-crew b, .ff-crew small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-crew b { font-size: .63rem; }
.ff-crew small { color: #91aaac; font-size: .47rem; }
.ff-crew small span { color: var(--ff-collector); font-weight: 950; }
.ff-crew i { height: 4px; display: block; overflow: hidden; margin-top: 3px; border-radius: 99px; background: rgba(255,255,255,.09); }
.ff-crew em { width: var(--ff-progress, 0%); height: 100%; display: block; border-radius: inherit; background: var(--ff-collector); transition: width .25s ease; }
.ff-crew output { color: var(--ff-collector); font-size: .55rem; font-weight: 950; }

.ff-board-wrap {
  grid-area: board;
  position: relative;
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 7px;
  border: 1px solid rgba(255, 213, 105, .34);
  border-radius: 20px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255,255,255,.025) 48% 52%, transparent 52%),
    linear-gradient(155deg, #5b3924, #2c1a15 58%, #172226);
  box-shadow: inset 0 0 0 3px rgba(18, 9, 7, .38), inset 0 0 28px rgba(0, 0, 0, .35), 0 18px 38px rgba(0, 0, 0, .31);
}
.ff-board-top { position: relative; min-height: 66px; display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 6px; margin: -3px 2px 6px; }
.ff-mike-art { width: 58px; height: 70px; align-self: end; display: grid; place-items: end center; overflow: visible; filter: drop-shadow(0 7px 7px rgba(0,0,0,.38)); }
.ff-mike-art img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center bottom; }
.ff-feature-meter { --ff-feature-progress: 0%; min-width: 0; padding: 7px 8px; border: 1px solid rgba(255, 222, 135, .2); border-radius: 13px; background: rgba(4, 25, 28, .76); }
.ff-feature-meter > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.ff-feature-meter small { color: #ddc98f; font-size: .51rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.ff-feature-meter output { color: #ffe17e; font-size: .61rem; font-weight: 1000; }
.ff-feature-track { height: 6px; display: block; overflow: hidden; margin: 5px 0 6px; border-radius: 99px; background: rgba(255,255,255,.1); }
.ff-feature-track i { width: var(--ff-feature-progress); height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #48c6ce, #ffd766); box-shadow: 0 0 10px rgba(255, 215, 102, .46); transition: width .25s ease; }
.ff-feature-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.ff-feature-slots span { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 3px; border: 1px solid rgba(255,255,255,.09); border-radius: 7px; color: #789092; background: rgba(0,0,0,.15); font-size: .46rem; font-weight: 850; white-space: nowrap; }
.ff-feature-slots span::before { content: "◇"; color: #739397; }
.ff-feature-slots span.is-released { border-color: rgba(255, 217, 101, .35); color: #ffe29a; background: rgba(119, 79, 13, .3); }
.ff-feature-slots span.is-released::before { content: "◆"; color: #ffd65d; }
.ff-board { position: relative; z-index: 2; aspect-ratio: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.ff-cell {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: clamp(7px, 2.2vw, 13px);
  color: #fff;
  background: linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.035));
  box-shadow: inset 0 1px rgba(255,255,255,.13), 0 4px 8px rgba(0,0,0,.25);
  font-size: clamp(1rem, 6.8vw, 2rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 2px rgba(0,0,0,.34);
  transform: translateZ(0);
}
.ff-glyph { font-style: normal; transition: opacity .16s ease, transform .16s ease; }
.ff-cell.ff-symbol-ruby, .ff-symbol-ruby i { color: #ff7777; background-color: rgba(108, 25, 34, .52); }
.ff-cell.ff-symbol-aqua, .ff-symbol-aqua i { color: #63d1ff; background-color: rgba(20, 72, 105, .52); }
.ff-cell.ff-symbol-lime, .ff-symbol-lime i { color: #72e6a0; background-color: rgba(17, 85, 56, .52); }
.ff-cell.ff-symbol-violet, .ff-symbol-violet i { color: #d59aff; background-color: rgba(80, 41, 104, .52); }
.ff-cell.ff-symbol-doubloon, .ff-symbol-doubloon i { color: #ffe06b; background-color: rgba(112, 75, 14, .52); }
.ff-cell.ff-symbol-map, .ff-symbol-map i { color: #f0d5a0; background-color: rgba(88, 57, 31, .58); }
.ff-cell.is-matched { border-color: rgba(255, 246, 190, .78); box-shadow: 0 0 0 2px rgba(255, 221, 110, .4), 0 0 18px rgba(255, 200, 67, .42); }
.ff-cell.is-collected .ff-glyph { opacity: .12; transform: scale(.58) rotate(13deg); }
.ff-cell.is-clearing { animation: ff-clear .3s ease both; }
.ff-walker { position: absolute; z-index: 5; width: 88%; aspect-ratio: 1; display: none; place-items: center; border: 2px solid currentColor; border-radius: 52% 48% 44% 56%; color: #fff; background-color: #18363b; background-image: url("assets/pirwongs-color-crew-v1.webp"); background-repeat: no-repeat; background-size: 400% 180%; box-shadow: 0 5px 10px rgba(0,0,0,.4), inset 0 -6px rgba(0,0,0,.18); animation: ff-hop .17s ease both; }
.ff-cell.has-collector .ff-walker { display: grid; }
.ff-cell[data-collector-code="ruby"] .ff-walker { color: #ff8585; background-color: #702c32; background-position: 0 50%; }
.ff-cell[data-collector-code="aqua"] .ff-walker { color: #73d7ff; background-color: #215976; background-position: 33.333% 50%; }
.ff-cell[data-collector-code="lime"] .ff-walker { color: #79e8a6; background-color: #255d42; background-position: 66.667% 50%; }
.ff-cell[data-collector-code="violet"] .ff-walker { color: #d9a4ff; background-color: #57336f; background-position: 100% 50%; }
.ff-round-note { position: relative; z-index: 1; margin: 6px 2px 0; color: #9cb5b3; font-size: .52rem; line-height: 1.22; text-align: center; }
.ff-round-note span { color: #ffdc77; font-weight: 1000; }

.ff-result { position: relative; min-height: 66px; display: grid; grid-template-columns: 39px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 8px; padding: 8px; border: 1px solid rgba(217, 202, 159, .12); border-radius: 15px; background: rgba(2, 18, 22, .68); }
.ff-result > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #ffe08b; background: #49341d; font-size: 1.18rem; font-style: normal; }
.ff-result strong, .ff-result span { display: block; }
.ff-result strong { font-size: .75rem; }
.ff-result span { margin-top: 2px; color: #9bb3b3; font-size: .55rem; line-height: 1.25; }
.ff-result > b { min-width: 43px; padding: 7px 5px; border-radius: 10px; color: #ffe394; background: rgba(220, 164, 43, .15); font-size: .71rem; text-align: center; }
.ff-result[data-kind="cascade"] { border-color: rgba(87, 201, 210, .28); background: rgba(12, 69, 74, .52); }
.ff-result[data-kind="feature"] { border-color: rgba(255, 215, 103, .42); background: rgba(112, 72, 13, .42); animation: ff-feature .44s ease both; }
.ff-result[data-kind="win"] { border-color: rgba(255, 214, 101, .28); background: rgba(116, 81, 13, .28); }
.ff-result[data-kind="win"] strong, .ff-result[data-kind="feature"] strong { color: #ffe17c; }
.ff-result[data-kind="loss"] strong, .ff-result[data-kind="error"] strong { color: #ffb8ad; }
.ff-controls { position: relative; display: grid; gap: 7px; margin-top: 8px; }
.ff-bet { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 5px 6px 5px 10px; border: 1px solid rgba(219, 202, 156, .15); border-radius: 14px; background: rgba(2, 18, 22, .56); font-size: .64rem; font-weight: 900; }
.ff-stepper { display: grid; grid-template-columns: 44px 62px 44px; overflow: hidden; border-radius: 11px; background: #031419; }
.ff-stepper button, .ff-stepper input { width: 100%; min-height: 44px; border: 0; color: #ffe795; background: transparent; text-align: center; font-weight: 950; }
.ff-stepper button { font-size: 1.1rem; cursor: pointer; }
.ff-stepper input { appearance: textfield; font-size: .72rem; }
.ff-stepper input::-webkit-inner-spin-button { display: none; }
.ff-play { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 14px; color: #263c3b; background: linear-gradient(145deg, #ffe9a2, #cf8e2e); box-shadow: 0 10px 24px rgba(218, 151, 39, .22); font-size: .75rem; font-weight: 1000; cursor: pointer; }
.ff-play:disabled, .ff-stepper button:disabled, .ff-stepper input:disabled { cursor: not-allowed; opacity: .48; box-shadow: none; }
.ff-server-note { position: relative; display: block; margin: 6px 4px 0; color: #85a09f; font-size: .52rem; line-height: 1.32; text-align: center; }

.ff-help { width: min(580px, calc(100% - 14px)); max-height: calc(100dvh - 18px); overflow: auto; padding: 0; border: 1px solid rgba(245, 201, 92, .46); border-radius: 21px; color: #fff4d1; background: #0b3035; box-shadow: 0 30px 80px rgba(0, 0, 0, .65); }
.ff-help::backdrop { background: rgba(0, 12, 15, .82); backdrop-filter: blur(4px); }
.ff-help form { padding: 13px; }
.ff-help header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ff-help header small, .ff-help header h2 { display: block; margin: 0; }
.ff-help header small { color: #91b6b4; font-size: .58rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.ff-help header h2 { margin-top: 2px; font-size: 1.05rem; }
.ff-help header button { width: 44px; height: 44px; flex: none; border: 1px solid rgba(244, 204, 102, .3); border-radius: 13px; color: #ffe6a1; background: #17494b; font-size: 1.3rem; cursor: pointer; }
.ff-help-steps { display: grid; gap: 7px; margin: 12px 0; padding: 0; list-style: none; }
.ff-help-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 8px; color: #cbdddd; font-size: .68rem; line-height: 1.38; }
.ff-help-steps b { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #263d3b; background: #ebbd4d; }
.ff-help-steps em { color: #ffe196; font-style: normal; font-weight: 900; }
.ff-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-bottom: 10px; }
.ff-legend span { min-width: 0; display: flex; align-items: center; gap: 4px; padding: 5px; border: 1px solid rgba(211, 224, 216, .12); border-radius: 9px; color: #c9dada; background: rgba(2, 20, 23, .44); font-size: .57rem; }
.ff-legend i { width: 22px; height: 22px; display: grid; place-items: center; flex: none; border-radius: 7px; font-style: normal; font-weight: 1000; }
.ff-feature-guide { display: grid; gap: 5px; margin: 0 0 10px; padding: 8px; border: 1px solid rgba(255, 220, 126, .18); border-radius: 12px; background: rgba(91, 58, 18, .18); }
.ff-feature-guide b { color: #ffe294; font-size: .63rem; }
.ff-feature-guide span { color: #b8cdcc; font-size: .59rem; line-height: 1.35; }
.ff-paytable { overflow-x: auto; border: 1px solid rgba(211, 224, 216, .14); border-radius: 13px; }
.ff-paytable table { width: 100%; border-collapse: collapse; font-size: .63rem; }
.ff-paytable th, .ff-paytable td { padding: 7px; border-bottom: 1px solid rgba(210, 222, 213, .1); text-align: left; white-space: nowrap; }
.ff-paytable th { color: #ffe39a; background: rgba(1, 19, 21, .54); font-size: .53rem; letter-spacing: .05em; text-transform: uppercase; }
.ff-paytable th:nth-child(n+2), .ff-paytable td:nth-child(n+2) { text-align: right; }
.ff-paytable tr:last-child td { border-bottom: 0; }
.ff-help > form > p { margin: 10px 2px 0; color: #a9c0bf; font-size: .63rem; line-height: 1.42; }
.ff-help > form > p strong { color: #ffe092; }
.ff-original-note { padding: 7px 8px; border-left: 3px solid #5ec2c8; border-radius: 5px; background: rgba(63, 157, 163, .1); }
.ff-help-close { width: 100%; min-height: 48px; margin-top: 11px; border: 0; border-radius: 13px; color: #263c3b; background: linear-gradient(145deg, #ffe79a, #d49a2e); font-weight: 950; cursor: pointer; }

@keyframes ff-hop { from { opacity: .5; transform: translateY(8px) scale(.78) rotate(-7deg); } to { opacity: 1; transform: translateY(0) scale(1) rotate(0); } }
@keyframes ff-clear { to { opacity: 0; transform: translateY(-16px) scale(.55) rotate(10deg); } }
@keyframes ff-feature { 50% { transform: scale(1.018); box-shadow: 0 0 28px rgba(255, 211, 78, .22); } }
@media (min-width: 560px) {
  .ff-shell { padding-top: 14px; }
  .ff-game { padding: 14px; }
  .ff-controls { grid-template-columns: minmax(220px, .65fr) minmax(220px, 1fr); }
  .ff-board-top { grid-template-columns: 72px minmax(0, 1fr); min-height: 80px; }
  .ff-mike-art { width: 72px; height: 88px; }
}
@media (min-width: 760px) {
  .ff-head { padding-inline: max(16px, calc((100% - 1000px) / 2)); }
  .ff-game { padding: 17px; }
  .ff-stage { grid-template-areas: "left board right"; grid-template-columns: 90px minmax(360px, 500px) 90px; align-items: center; justify-content: center; gap: 11px; }
  .ff-crew { grid-template-columns: 1fr; gap: 14px; }
  .ff-crew li { grid-template-columns: 1fr; justify-items: center; gap: 4px; padding: 8px 5px; text-align: center; }
  .ff-scout-avatar { width: 64px; height: 64px; }
  .ff-crew li > span:nth-child(2) { width: 100%; }
  .ff-crew output { font-size: .62rem; }
  .ff-cell { font-size: clamp(1.55rem, 3.6vw, 2.2rem); }
}
@media (max-width: 359px) {
  .ff-head { gap: 4px; padding-inline: 5px; }
  .ff-wallet { min-width: 51px; max-width: 64px; padding-inline: 5px; font-size: .68rem; }
  .ff-shell { padding-inline: 4px; }
  .ff-game { padding: 8px; border-radius: 20px; }
  .ff-intro { gap: 5px; }
  .ff-cascade-badge { min-width: 49px; padding-inline: 4px; }
  .ff-crew { gap: 4px; }
  .ff-crew li { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 3px; padding: 4px 3px; }
  .ff-scout-avatar { width: 38px; height: 38px; }
  .ff-crew b { font-size: .58rem; }
  .ff-crew small { font-size: .43rem; }
  .ff-board-wrap { padding: 5px; border-radius: 16px; }
  .ff-board-top { grid-template-columns: 52px minmax(0, 1fr); min-height: 60px; }
  .ff-mike-art { width: 52px; height: 64px; }
  .ff-feature-meter { padding: 6px; }
  .ff-feature-slots span { font-size: .41rem; }
  .ff-board { gap: 3px; }
  .ff-cell { border-radius: 7px; }
  .ff-result { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 6px; }
  .ff-stepper { grid-template-columns: 44px 54px 44px; }
  .ff-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .ff-view *, .ff-view *::before, .ff-view *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ff-crew li.is-active { transform: none; }
}
