/* いふっこトランプ
   配色・角丸・影は Claude Design の IfukkoTrump.dc.html をそのまま持ってきている。 */

:root {
  --ink: #ffffff;
  --bg-deep: #150a22;
  --screen: #2a1140;
  --screen-soft: rgba(255, 255, 255, 0.06);
  --screen-line: rgba(255, 255, 255, 0.12);
  --field: rgba(20, 8, 34, 0.6);

  --gold: #f0c24b;
  --gold-deep: #e09a2c;
  --gold-shadow: #b8781c;
  --gold-light: #ffd97a;

  --violet: #8e5fd3;
  --violet-deep: #5a2e96;
  --violet-mid: #6b3ae0;

  --muted-1: #d9c7f2;
  --muted-2: #c4aee2;
  --muted-3: #b9a3d6;

  --danger: #e2445c;
  --danger-soft: #ffb3bf;
  --red: #d63b54;

  --teal: #34c6b4;
  --coral: #f2705b;

  --display: 'Reggae One', 'Zen Maru Gothic', system-ui, sans-serif;
  --body: 'Zen Maru Gothic', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* 内容は縦長の一列。広い画面では中央に寄せて、両脇は背景色にする。 */
  --app-w: 520px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--body);
  display: flex;
  justify-content: center;
  height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  color: inherit;
}

button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 4px;
}

.hand-card:focus-visible, .offer-card:focus-visible {
  z-index: 50 !important;
}

.swatch {
  color: #1b0e2b;
  font-size: 24px;
  font-weight: 900;
}

.rule-details summary {
  cursor: pointer;
  padding: 14px 0;
  color: var(--gold-light);
  font-weight: 700;
}

.rule-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--muted-1);
}

.rule-toggle > span:last-child { flex: none; white-space: nowrap; }
.rule-details .rule-grid { grid-template-columns: 1fr; }

input {
  font-family: inherit;
}

/* -------------------------------------------------------------- アプリの器 */

#app {
  position: relative;
  width: 100%;
  max-width: var(--app-w);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--screen);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
}

/* 背景の模様。中身より下に敷く。 */
#app::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23F0C24B' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M14 8v16M9 13h10M14 24c-4 5-4 10 0 13'/%3E%3Ccircle cx='52' cy='16' r='5.5'/%3E%3Cpath d='M43 16h18M52 22v6'/%3E%3Cpath d='M10 46h16M10 53h16M10 60h16'/%3E%3Cpath d='M48 42l8 14H40z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 72px 72px;
  pointer-events: none;
  z-index: 0;
}

#screen {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: calc(10px + env(safe-area-inset-top));
}

/* 対局画面は背景を画面の端まで伸ばす。 */
.screen-table {
  margin-top: calc(-10px - env(safe-area-inset-top));
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.screen > * { flex-shrink: 0; }
.screen > .scroll-body { flex-shrink: 1; min-height: 0; }

/* ------------------------------------------------------------------ 部品 */

.btn {
  border: none;
  cursor: pointer;
  font-family: var(--body);
  font-weight: 900;
  border-radius: 20px;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(2px);
}

.btn:disabled {
  cursor: default;
}

.btn-primary {
  padding: 19px;
  font-size: 18px;
  background: linear-gradient(140deg, var(--gold), var(--gold-deep));
  color: #2a1140;
  box-shadow: 0 8px 0 var(--gold-shadow);
  letter-spacing: 0.04em;
}

.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(42, 17, 64, 0.75);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
}

.btn-ghost {
  padding: 15px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.btn-dashed {
  padding: 18px;
  border-radius: 20px;
  border: 2px dashed rgba(240, 194, 75, 0.55);
  background: rgba(240, 194, 75, 0.08);
  color: var(--gold);
  font-size: 16px;
}

.btn-back {
  align-self: flex-start;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-link {
  padding: 6px;
  border: none;
  background: none;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.text-input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: var(--field);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease;
}

.text-input:focus {
  border-color: var(--gold);
}

.text-input.big {
  padding: 20px;
  border-radius: 20px;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.06em;
}

.text-input.mid {
  padding: 17px;
  border-radius: 18px;
  font-size: 19px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.05em;
}

.text-input.error {
  border-color: var(--danger);
}

.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #2a1140;
  flex: none;
}

.hint {
  font-size: 11px;
  color: var(--muted-3);
  line-height: 1.6;
}

@keyframes pop {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  60% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(26px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes riseIn {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ------------------------------------------------------------ オンボード */

.onboard {
  padding: 0 28px 34px;
  overflow: hidden;
}

.onboard .mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  border-radius: 24px;
  background: linear-gradient(150deg, var(--violet), var(--violet-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(142, 95, 211, 0.45);
}

.mark-face {
  width: 30px;
  height: 38px;
  border-radius: 15px 15px 5px 5px;
  background: #fff;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.mark-face i {
  position: absolute;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2a1140;
}

.mark-face i:first-child {
  left: 6px;
}

.mark-face i:last-child {
  right: 6px;
}

.title-big {
  margin: 0;
  font-family: var(--display);
  font-size: 31px;
  line-height: 1.2;
  color: var(--gold);
  text-shadow: 0 3px 0 var(--violet-mid);
}

.lede {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted-1);
}

.card-panel {
  background: var(--screen-soft);
  border: 1px solid var(--screen-line);
  border-radius: 26px;
  padding: 24px 20px;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.swatch {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease;
}

/* ---------------------------------------------------------------- ホーム */

.home {
  padding: 0 22px 28px;
  overflow-x: hidden;
  overflow-y: auto;
}

.home > div:last-child { min-height: auto !important; }

.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 18px;
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .mark-small {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--violet), var(--violet-deep));
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand .mark-small .mark-face {
  width: 14px;
  height: 18px;
  border-radius: 7px 7px 2px 2px;
  box-shadow: none;
}

.brand .mark-small .mark-face i {
  top: 6px;
  width: 3px;
  height: 3px;
}

.brand .mark-small .mark-face i:first-child {
  left: 2px;
}

.brand .mark-small .mark-face i:last-child {
  right: 2px;
}

.brand-name {
  font-family: var(--display);
  font-size: 17px;
  color: var(--gold);
}

.chip-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.host-card {
  text-align: left;
  border: none;
  cursor: pointer;
  padding: 24px;
  border-radius: 26px;
  background: linear-gradient(140deg, var(--gold), var(--gold-deep));
  color: #2a1140;
  box-shadow: 0 10px 0 var(--gold-shadow);
  position: relative;
  overflow: hidden;
  flex: none;
}

.host-card .watermark {
  position: absolute;
  right: -14px;
  bottom: -22px;
  font-size: 96px;
  opacity: 0.16;
  font-family: var(--display);
}

.host-card .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  opacity: 0.7;
}

.host-card .headline {
  font-family: var(--display);
  font-size: 26px;
  margin: 4px 0 6px;
}

.host-card .sub {
  font-size: 12.5px;
  line-height: 1.6;
  font-weight: 500;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  flex: none;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  flex: none;
}

.game-tile {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 16px 8px 14px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease;
}

.game-tile:hover {
  background: rgba(255, 255, 255, 0.13);
}

.game-tile .glyph {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  font-family: var(--display);
}

.game-tile .name {
  font-size: 13px;
  font-weight: 700;
}

.game-tile .sub {
  font-size: 10px;
  color: var(--muted-3);
  line-height: 1.4;
  text-align: center;
}

/* 扇レイアウト */

.fan {
  position: relative;
  height: 300px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fan-card {
  position: absolute;
  width: 134px;
  height: 206px;
  left: 50%;
  margin-left: -67px;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 20px;
  transition: transform 0.3s cubic-bezier(0.3, 1.3, 0.4, 1);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.fan-card .edge {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 3px solid rgba(255, 255, 255, 0.5);
}

.fan-card .glyph {
  position: absolute;
  left: 0;
  right: 0;
  top: 34px;
  font-size: 56px;
  line-height: 1;
  font-family: var(--display);
  opacity: 0.9;
}

.fan-card .name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  font-size: 15px;
  font-weight: 900;
}

/* ------------------------------------------------------------ ルーム作成 */

.scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
}

.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.rule-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.rule-toggle .dot {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  flex: none;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.stepper button {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}

.stepper .value {
  flex: 1;
  text-align: center;
}

.stepper .value b {
  font-family: var(--display);
  font-size: 26px;
  color: var(--gold);
  font-weight: 400;
}

.sticky-foot {
  flex: none;
  padding: 12px 20px 26px;
  background: linear-gradient(to top, rgba(42, 17, 64, 1) 55%, rgba(42, 17, 64, 0));
}

/* ------------------------------------------------------------- ロビー */

.room {
  padding: 0 22px 28px;
}

.passphrase {
  flex: none;
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(140deg, rgba(240, 194, 75, 0.18), rgba(142, 95, 211, 0.18));
  border: 1px solid rgba(240, 194, 75, 0.4);
  text-align: center;
}

.passphrase .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.passphrase .word {
  font-family: var(--display);
  font-size: 32px;
  margin: 8px 0 6px;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.seat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: none;
}

.seat {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 18px;
  animation: riseIn 0.28s ease-out;
}

.seat .who {
  min-width: 0;
}

.seat .name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat .role {
  font-size: 10px;
  color: var(--muted-3);
}

/* -------------------------------------------------------------- 対局画面 */

.table {
  padding-top: calc(10px + env(safe-area-inset-top));
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 70% at 50% 42%, #3b7a5a 0%, #255741 55%, #173829 100%);
  min-height: 0;
}

.table-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 6px;
  gap: 8px;
}

.table-head .meta {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: #2a1140;
  white-space: nowrap;
  flex: none;
}

.opponents {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 6px 8px 0;
  flex-wrap: wrap;
}

.opponent {
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 2px;
  border-radius: 14px;
  transition: background 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  background: none;
  cursor: default;
}

.opponent.pickable {
  cursor: pointer;
}

.opponent .name {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56px;
}

.opponent .count {
  display: flex;
  align-items: center;
  gap: 3px;
}

.opponent .count i {
  width: 11px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(150deg, var(--violet), #4a2378);
  border: 1px solid rgba(240, 194, 75, 0.6);
}

.opponent .count b {
  font-size: 11px;
  font-weight: 900;
  color: var(--gold);
}

.opponent .status {
  font-size: 9px;
  font-weight: 700;
  color: var(--gold-light);
  height: 11px;
}

.field {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 4px 10px;
}

.field .ring {
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.13);
}

.field .empty-note {
  position: relative;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  line-height: 1.7;
}

.flash {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--gold);
  color: #2a1140;
  font-family: var(--display);
  font-size: 19px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  animation: pop 0.32s ease-out;
  white-space: nowrap;
  z-index: 5;
}

.turn-line {
  flex: none;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  padding: 0 12px 6px;
  min-height: 18px;
}

.hand {
  flex: none;
  position: relative;
  height: 126px;
}

.actions {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 4px 18px calc(22px + env(safe-area-inset-bottom));
}

.actions .btn {
  padding: 17px;
  border-radius: 18px;
  font-size: 16px;
}

.btn-pass {
  flex: 1;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink);
}

/* パスしか選べないときは、枠を光らせて迷わせない。 */
.btn-pass.only {
  border-color: var(--gold);
  background: rgba(240, 194, 75, 0.16);
  color: var(--gold-light);
  animation: passUrge 1.5s ease-in-out infinite;
}

@keyframes passUrge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 194, 75, 0.4); }
  55% { box-shadow: 0 0 0 8px rgba(240, 194, 75, 0); }
}

.btn-play {
  flex: 1.5;
  border: none;
  background: linear-gradient(140deg, var(--gold), var(--gold-deep));
  color: #2a1140;
  box-shadow: 0 6px 0 var(--gold-shadow);
  font-size: 17px;
}

.btn-play:disabled {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
}

/* カード */

.card {
  position: relative;
  border-radius: 9px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 6px;
  box-sizing: border-box;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

/* 左上の指標。重なった手札でも、この帯だけ見えれば数字とマークが分かる。 */
.card .idx {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  width: 15px;
  flex: none;
}

.card .rank {
  font-size: 15px;
  font-weight: 900;
  font-family: var(--body);
  letter-spacing: -0.06em;
}

/* ♠♥♦♣ は本文フォントだと大きさがそろわないので、記号の得意なフォントに寄せる。 */
.card .mini,
.card .suit,
.board-row .suit-label {
  font-family: 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', 'Hiragino Sans', var(--body);
}

.card .mini {
  font-size: 11px;
  margin-top: 1px;
}

.card .mini.big {
  font-size: 19px;
  margin-top: 2px;
}

.card .suit {
  font-size: 21px;
  line-height: 1;
  text-align: right;
  align-self: flex-end;
}

.card.joker .suit {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-family: var(--body); /* 「JOKER」は文字なので記号フォントに寄せない */
}

.hand-card {
  position: absolute;
  width: 56px;
  height: 80px;
  padding: 5px 6px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: bottom 0.16s ease, border-color 0.16s ease;
}

.hand-card.selected {
  border-color: var(--gold);
}

/* いま使えない札。押せなくはしないが、ひと目で候補から外れて見えるようにする。 */
.hand-card.dim {
  filter: grayscale(0.8) brightness(0.66);
  opacity: 0.72;
}

.pile-card {
  position: absolute;
  width: 58px;
  height: 82px;
  padding: 6px 7px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.card-back {
  border-radius: 9px;
  background: #f4edf7 url('../assets/cards/card-back.jpg') center / cover no-repeat;
  border: 2px solid rgba(240, 194, 75, 0.6);
  position: relative;
}

.card-back::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 5px;
  border: 1px solid rgba(240, 194, 75, 0.45);
}

/* ババ抜き: 引く相手の伏せ札 */

.offer {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 6px 12px;
}

.offer-fan {
  position: relative;
  width: 100%;
  height: 150px;
}

.offer-card {
  position: absolute;
  bottom: 0;
  width: 48px;
  height: 70px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.offer-card:hover,
.offer-card:focus-visible {
  translate: 0 -14px;
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

.offer-hint {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-light);
}

.offer-card.shuffling {
  animation: shuffleOffer 360ms ease-in-out;
  cursor: wait;
  translate: none;
  outline: none;
}

@keyframes shuffleOffer {
  0% { translate: var(--shuffle-x) 0; }
  35% { translate: calc(var(--shuffle-x) + var(--shuffle-sway)) -10px; }
  65% { translate: var(--shuffle-x) 0; }
  100% { translate: 0 0; }
}

.flying-card {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  padding: 5px 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* 7並べ盤面 */

.board {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
}

.board-row {
  display: grid;
  grid-template-columns: 16px repeat(13, 1fr);
  gap: 2px;
  align-items: center;
}

.board-row .suit-label {
  font-size: 13px;
  text-align: center;
  opacity: 0.75;
}

.slot {
  aspect-ratio: 0.68;
  border-radius: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.12);
}

.slot.filled {
  background: #fff;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.1);
  font-size: 11px;
}

.slot.open {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(240, 194, 75, 0.12);
  animation: pop 0.25s ease-out;
}

.pass-pips {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}

.pass-pips i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.pass-pips i.on {
  background: var(--gold);
}

/* --------------------------------------------------------------- 交換画面 */

.exchange {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 22px 26px;
  min-height: 0;
}

.exchange .got {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 12px 0 4px;
}

.exchange .got .card {
  position: relative;
  width: 54px;
  height: 76px;
  animation: pop 0.3s ease-out;
}

.pick-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  padding: 12px 2px;
}

.pick-card {
  position: relative;
  width: 46px;
  height: 66px;
  padding: 4px 5px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.pick-card .rank {
  font-size: 13px;
}

.pick-card .mini {
  font-size: 9px;
}

.pick-card .suit {
  font-size: 16px;
}

.pick-card.joker .suit {
  font-size: 8px;
}

.pick-card.selected {
  border-color: var(--gold);
  transform: translateY(-8px);
}

/* --------------------------------------------------------------- 結果画面 */

.result {
  padding: 0 24px 30px;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  animation: riseIn 0.3s ease-out both;
}

.result-row .pos {
  font-family: var(--display);
  font-size: 19px;
  color: var(--gold);
  width: 22px;
  flex: none;
}

.result-row .name {
  font-size: 14px;
  font-weight: 900;
}

.result-row .title {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(240, 194, 75, 0.2);
  font-size: 12px;
  font-weight: 900;
  color: var(--gold-light);
  flex: none;
}

/* ----------------------------------------------------------------- 説明 */

.sheet {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(11, 4, 20, 0.72);
  display: flex;
  align-items: flex-end;
  /* 覆いは色が乗るだけ。動くのは下から出てくる本体のほう。 */
  animation: fadeIn 0.18s ease-out;
}

.sheet-body {
  animation: slideUp 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
  width: 100%;
  max-height: 78%;
  overflow-y: auto;
  background: #2f1548;
  border-radius: 28px 28px 0 0;
  padding: 22px 22px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sheet h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 21px;
  color: var(--gold);
  font-weight: 400;
}

.sheet dl {
  margin: 16px 0 0;
}

.sheet dt {
  font-size: 13px;
  font-weight: 900;
  color: var(--gold-light);
  margin-top: 14px;
}

.sheet dd {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted-1);
}

/* -------------------------------------------------------------- 画面幅 */

@media (max-width: 520px) {
  #app {
    box-shadow: none;
  }
}

@media (max-width: 360px) {
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .swatch { width: 44px; justify-self: center; }
}

@media (max-height: 720px) {
  .fan {
    height: 244px;
  }

  .fan-card {
    width: 118px;
    height: 178px;
    margin-left: -59px;
  }

  .hand {
    height: 108px;
  }
}
