:root {
  --bg: #07090f;
  --panel: rgba(18, 22, 32, 0.82);
  --ink: #f6f1e6;
  --muted: #b7ae9d;
  --line: rgba(232, 204, 140, 0.18);
  --gold: #e8c56a;
  --gold-deep: #b8892d;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
  --glass: linear-gradient(180deg, rgba(32, 38, 52, 0.72), rgba(12, 15, 22, 0.88));
  --frame: 0 0 0 1px rgba(232, 204, 140, 0.2), 0 18px 40px rgba(0, 0, 0, 0.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --ad-height: 50px;
  --ad-bar: calc(var(--ad-height) + 1px + var(--safe-bottom));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans KR", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

body {
  position: relative;
}

.app-shell {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--ad-bar);
  left: 0;
  padding: var(--safe-top) var(--safe-right) 0 var(--safe-left);
  overflow: hidden;
}

.app-scroll {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 28px 28px 36px;
  scrollbar-color: rgba(232, 204, 140, 0.28) transparent;
}

body.is-locked .app-scroll {
  overflow: hidden;
}

.ad-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: linear-gradient(180deg, #10141d, #0a0d13);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
}

.ad-slot {
  display: grid;
  place-items: center;
  height: var(--ad-height);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
  image-rendering: auto;
}

button {
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% -8%, rgba(232, 197, 106, 0.2), transparent 34%),
    radial-gradient(circle at 88% 6%, rgba(255, 122, 164, 0.1), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(61, 214, 198, 0.07), transparent 32%),
    linear-gradient(180deg, #0b0e16 0%, #07090f 42%, #090b12 100%);
}

.page-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hub-view,
.hero,
.filters,
.hub-tools,
.gallery,
.play-view {
  position: relative;
  z-index: 1;
  width: min(1360px, 100%);
  margin: 0 auto;
}

.hero {
  text-align: center;
  padding: 8px 0 8px;
}

.hero-panel {
  padding: 36px 32px 32px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--glass);
  box-shadow: var(--frame);
  backdrop-filter: blur(16px);
}

.hero-kicker {
  margin: 0 0 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.app-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(232, 197, 106, 0.35), 0 12px 28px rgba(0, 0, 0, 0.35);
}

.hero-titles {
  text-align: left;
}

.hero h1 {
  margin: 0;
  font-family: "Noto Serif KR", "Jua", serif;
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.hero-sub {
  margin: 8px 0 0;
  color: var(--muted);
  letter-spacing: 0.16em;
  font-size: 12px;
}

.hero-copy {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--muted);
  line-height: 1.85;
  font-size: 15px;
}

.party-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.party-line li {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 13, 20, 0.55);
  color: var(--muted);
  font-size: 13px;
}

.party-line strong {
  color: var(--gold);
  margin-right: 6px;
}

.hero-launch {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 22px;
  margin-top: 26px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 26px auto 20px;
}

.filter-btn {
  border: 1px solid var(--line);
  background: rgba(16, 20, 30, 0.86);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
}

.filter-btn:hover {
  border-color: rgba(232, 197, 106, 0.45);
}

.filter-btn.is-active {
  background: linear-gradient(180deg, #f0d27a, var(--gold-deep));
  color: #2b2100;
  border-color: #f3d98a;
  box-shadow: 0 8px 20px rgba(184, 137, 45, 0.28);
}

.hub-tools {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin: 0 auto 26px;
}

.seed-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--glass);
  box-shadow: var(--frame);
  backdrop-filter: blur(12px);
}

.seed-label {
  margin: 0;
  font-family: "Jua", sans-serif;
  font-size: 20px;
}

.seed-hint,
.seed-ratio {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.seed-actions {
  display: flex;
  gap: 8px;
}

.seed-btn {
  border: 1px solid var(--line);
  background: rgba(16, 20, 30, 0.9);
  color: var(--ink);
  border-radius: 999px;
  padding: 11px 18px;
}

.seed-btn:hover {
  border-color: rgba(232, 197, 106, 0.42);
}

.seed-btn.is-active {
  background: linear-gradient(180deg, #f0d27a, var(--gold-deep));
  color: #2b2100;
  border-color: #f3d98a;
}

.seed-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.back-choices {
  display: flex;
  gap: 10px;
}

.back-choice {
  display: grid;
  gap: 6px;
  width: 96px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0c1018;
  color: inherit;
}

.back-choice img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
}

.back-choice span {
  font-size: 12px;
  text-align: center;
}

.back-choice.is-active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.ohang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.ohang-목 {
  background: #2f6b3a;
  color: #e8ffe9;
}

.ohang-화 {
  background: #a63b1d;
  color: #ffe8df;
}

.ohang-토 {
  background: #8a6d2d;
  color: #fff4d6;
}

.ohang-금 {
  background: #8a7a3e;
  color: #fff7d2;
}

.ohang-수 {
  background: #2d6284;
  color: #dff3ff;
}

.weak-ohang {
  margin: 0 0 6px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.card {
  background: transparent;
  perspective: 1200px;
}

.card:not(.is-flipped):hover {
  z-index: 2;
}

.card:not(.is-flipped):hover .card-flip {
  animation: fx-card-strike-soft 0.62s ease;
}

.card:not(.is-flipped):active .card-flip {
  animation: fx-card-hit-soft 0.48s ease;
}

.card-flip {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
}

.card.is-flipped .card-flip {
  transform: rotateY(180deg);
}

.card-face {
  border: 1px solid rgba(232, 197, 106, 0.22);
  border-radius: 30px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
  background: linear-gradient(180deg, #1d2433, #10141c);
}

.card-front {
  position: relative;
}

.card-back {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: #0c1018;
  transform: rotateY(180deg);
  backface-visibility: hidden;
}

.card-front {
  backface-visibility: hidden;
}

.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card:hover .card-front {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}

.card-flip-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(12, 16, 24, 0.72);
  color: var(--ink);
  font-size: 12px;
}

.card-hit {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.card-art,
.detail-hero {
  position: relative;
  overflow: hidden;
}

.card-art {
  height: 340px;
  background: #0c1018;
}

.card-backplate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-art .card-portrait,
.detail-hero .card-portrait {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 18%;
}

.card-fade {
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  background: linear-gradient(transparent, #151924);
}

.role-chip,
.element-row span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.role-chip {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--accent);
  color: #1a1400;
  font-weight: 700;
}

.role-chip.static {
  position: static;
}

.card-nameplate {
  padding: 12px 20px 16px;
}

.card-no {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
}

.card-nameplate h2,
.detail-meta h2 {
  margin: 2px 0 4px;
  font-family: "Noto Serif KR", "Jua", serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-title {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.element-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.element-row span {
  background: var(--accent-soft);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.banner-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
  padding: 0 14px 16px;
}

.skill-banner,
.weak-banner {
  background: rgba(8, 11, 17, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
}

.banner-label {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.thumb-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.thumb-row figure,
.weak-banner figure {
  margin: 0;
}

.thumb-row img,
.weak-banner img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: #000;
}

.thumb-row figcaption,
.weak-banner figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.weak-banner figcaption {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  top: var(--safe-top);
  right: var(--safe-right);
  bottom: var(--ad-bar);
  left: var(--safe-left);
  z-index: 30;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 12, 0.72);
}

.modal-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  margin: 12px auto;
  overflow: hidden;
  background: linear-gradient(180deg, #1a2030, #10141c);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--frame), var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #2a3142;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  z-index: 5;
}

.modal-body {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.detail {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 28px;
}

.detail-hero {
  grid-row: span 2;
  background: #0c1018;
  border-radius: 24px;
  min-height: 420px;
}

.detail-meta {
  padding-top: 8px;
}

.item-line {
  margin: 16px 0 0;
  color: var(--muted);
}

.item-line strong {
  color: var(--accent);
}

.detail-skills,
.detail-weak {
  grid-column: 2;
}

.detail-skills h3,
.detail-weak h3 {
  margin: 8px 0 12px;
  font-family: "Jua", sans-serif;
  font-size: 24px;
  font-weight: 400;
}

.skill-grid {
  display: grid;
  gap: 12px;
}

.skill-card,
.weak-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: rgba(10, 13, 20, 0.7);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.skill-card img,
.weak-card img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
}

.skill-card h4 {
  margin: 0 0 4px;
  font-size: 18px;
}

.skill-card p,
.weak-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 1100px) {
  .hub-tools {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail {
    grid-template-columns: 1fr;
  }

  .detail-hero,
  .detail-skills,
  .detail-weak {
    grid-column: auto;
    grid-row: auto;
  }

  .detail-hero {
    min-height: 320px;
  }
}

.difficulty-block {
  display: grid;
  gap: 6px;
  justify-items: start;
  text-align: left;
}

.difficulty-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-difficulty {
  margin-top: 12px;
}

.play-start {
  min-width: 148px;
  padding: 14px 26px;
  font-family: "Noto Serif KR", "Jua", serif;
  font-size: 18px;
}

.play-view {
  position: relative;
  z-index: 1;
  width: min(1360px, 100%);
  margin: 0 auto;
}

.play-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 22px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--glass);
  box-shadow: var(--frame);
}

.play-head h2 {
  margin: 6px 0 0;
  font-family: "Noto Serif KR", "Jua", serif;
  font-size: 34px;
  letter-spacing: -0.03em;
}

.draft-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.draft-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  color: inherit;
  text-align: left;
  box-shadow: var(--frame);
}

.draft-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 14px;
  background: #0c1018;
}

.draft-card span {
  color: var(--muted);
  font-size: 13px;
}

.draft-card.is-picked {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.battle-top,
.battle-log {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  box-shadow: var(--frame);
  backdrop-filter: blur(12px);
}

.battle-phase {
  margin: 0;
  font-family: "Noto Serif KR", serif;
  font-size: 18px;
}

.battle-meta {
  margin: 0;
  color: var(--muted);
}

.battle-log {
  display: block;
}

.battle-log p {
  margin: 0 0 8px;
}

.battle-end {
  font-family: "Jua", sans-serif;
  font-size: 28px;
  color: var(--gold);
}

.battle-row h3 {
  margin: 0 0 10px;
  font-family: "Jua", sans-serif;
}

.battle-party {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.battle-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #121622;
}

.battle-card img {
  height: 120px;
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.battle-card p {
  margin: 8px 0 0;
}

.hp {
  color: #ff6b9d;
  letter-spacing: 2px;
}

.battle-skills {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.battle-skill {
  border: 1px solid var(--line);
  background: #0f1420;
  color: inherit;
  border-radius: 12px;
  padding: 8px;
  text-align: left;
}

.battle-skill:disabled {
  opacity: 0.45;
  cursor: default;
}

.battle-card.is-down {
  opacity: 0.45;
}

.result-card {
  max-width: 760px;
  margin: 48px auto;
  padding: 40px 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: var(--frame);
  text-align: center;
  backdrop-filter: blur(14px);
}

.result-card.is-win {
  box-shadow: 0 0 0 1px rgba(245, 197, 24, 0.35);
}

.result-card.is-lose {
  box-shadow: 0 0 0 1px rgba(255, 107, 157, 0.28);
}

.result-kicker {
  margin: 0 0 8px;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.result-card.is-lose .result-kicker,
.result-card.is-lose .result-title {
  color: #ff8fb3;
}

.result-title {
  margin: 0 0 12px;
  font-family: "Noto Serif KR", "Jua", serif;
  font-size: 52px;
  color: var(--gold);
  letter-spacing: -0.03em;
}

.result-copy,
.result-score,
.result-party {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.6;
}

.result-score {
  color: var(--ink);
  font-size: 18px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.board-wrap {
  width: min(880px, 100%);
  margin: 0 auto;
}

.quote-banner {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-height: 82px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: var(--frame);
  animation: quote-in 0.35s ease;
}

.quote-banner.is-guide {
  border-color: rgba(245, 197, 24, 0.45);
  box-shadow: inset 0 0 0 1px rgba(245, 197, 24, 0.18);
}

.quote-banner.is-guide .quote-text {
  font-size: 15px;
}

.quote-banner.is-duel {
  justify-content: space-between;
}

.quote-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.quote-side.defend {
  flex-direction: row-reverse;
  text-align: right;
}

.quote-side img {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #111;
}

.quote-side.player img {
  border-color: var(--gold);
}

.quote-side.enemy img {
  border-color: #ff8fb3;
}

.quote-tag {
  margin: 0 0 2px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.quote-side.enemy .quote-tag {
  color: #ff8fb3;
}

.quote-name {
  margin: 0 0 4px;
  font-family: "Noto Serif KR", "Jua", serif;
  font-size: 16px;
}

.quote-text {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.quote-vs {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-family: "Jua", sans-serif;
  font-size: 14px;
}

@keyframes quote-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.board-status {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 720px) {
  .quote-banner.is-duel {
    flex-direction: column;
  }

  .quote-side.defend {
    flex-direction: row;
    text-align: left;
  }

  .quote-vs {
    padding: 2px 0;
  }
}

.board-stage {
  position: relative;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(var(--n, 10), 1fr);
  gap: 0;
  aspect-ratio: 1;
  padding: 6px;
  border: 1px solid rgba(232, 197, 106, 0.38);
  border-radius: 18px;
  background:
    linear-gradient(145deg, #3a2d1c, #1c1610 55%, #2a2116);
  box-shadow: inset 0 0 0 5px #2a2118, 0 18px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.board-cell {
  position: relative;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #3d3424;
  overflow: visible;
}

.board-cell.is-light {
  background: #4f4330;
}

.board-cell.is-dark {
  background: #2c261c;
}

.board-cell.is-home.is-light {
  background: #3f4d33;
}

.board-cell.is-home.is-dark {
  background: #2a3324;
}

.board-cell.is-away.is-light {
  background: #4d333b;
}

.board-cell.is-away.is-dark {
  background: #332028;
}

.board-cell.is-diag.is-light {
  background: #4f4730;
}

.board-cell.is-diag.is-dark {
  background: #363022;
}

.board-cell.is-move {
  box-shadow: inset 0 0 0 3px var(--gold);
}

.board-cell.is-selected {
  box-shadow: inset 0 0 0 3px #fff3b0;
}

.board-cell.is-place {
  box-shadow: inset 0 0 0 2px rgba(245, 197, 24, 0.55);
}

.board-cell.is-stone {
  cursor: default;
}

.board-stone {
  position: absolute;
  inset: 10%;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #5a5044;
  color: #e8d7b0;
  font-size: 12px;
  font-weight: 700;
}

.board-token {
  position: absolute;
  inset: 8%;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(232, 197, 106, 0.42), 0 4px 10px rgba(0, 0, 0, 0.45);
  background: #111;
}

.board-token img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.board-owner,
.board-coord {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 10px;
  line-height: 1;
}

.board-token .board-owner {
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
}

.board-coord {
  color: rgba(244, 239, 228, 0.28);
}

.board-owner.player {
  color: var(--gold);
}

.board-token:has(.board-owner.player) {
  box-shadow: 0 0 0 2px rgba(232, 197, 106, 0.7), 0 4px 10px rgba(0, 0, 0, 0.45);
}

.board-owner.enemy {
  color: #ff8fb3;
}

.board-token:has(.board-owner.enemy) {
  box-shadow: 0 0 0 2px rgba(255, 143, 179, 0.62), 0 4px 10px rgba(0, 0, 0, 0.45);
}

.board-actions {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.duel-log {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #121622;
}

.duel-log p {
  margin: 0 0 6px;
}

.dice-overlay,
.duel-table {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(11, 13, 20, 0.82);
  perspective: 480px;
}

.dice-overlay {
  gap: 14px;
  color: var(--ink);
}

.dice-overlay p {
  margin: 0;
  font-family: "Jua", sans-serif;
  font-size: 18px;
}

.dice-cube {
  position: relative;
  width: 72px;
  height: 72px;
  transform-style: preserve-3d;
}

.dice-cube.is-spin {
  animation: dice-tumble 0.9s ease-out;
}

.dice-cube.land-1 {
  transform: rotateX(0deg) rotateY(0deg);
}

.dice-cube.land-2 {
  transform: rotateX(-90deg) rotateY(0deg);
}

.dice-side {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f4efe4;
  color: #2b2100;
  font-family: "Jua", sans-serif;
  font-size: 36px;
  box-shadow: inset 0 0 0 3px #c9a227;
  backface-visibility: hidden;
}

.dice-1 { transform: rotateY(0deg) translateZ(36px); }
.dice-2 { transform: rotateX(90deg) translateZ(36px); }
.dice-3 { transform: rotateY(180deg) translateZ(36px); }
.dice-4 { transform: rotateX(-90deg) translateZ(36px); }
.dice-5 { transform: rotateY(90deg) translateZ(36px); }
.dice-6 { transform: rotateY(-90deg) translateZ(36px); }

@keyframes dice-tumble {
  0% { transform: rotateX(12deg) rotateY(-20deg); }
  35% { transform: rotateX(220deg) rotateY(160deg); }
  70% { transform: rotateX(430deg) rotateY(320deg); }
  100% { transform: rotateX(720deg) rotateY(540deg); }
}

.duel-table {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 16px;
  backdrop-filter: blur(10px);
}

.duel-row {
  display: grid;
  grid-template-columns: 92px 78px 1fr;
  gap: 10px;
  align-items: center;
}

.duel-who {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.duel-who img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--line);
}

.duel-row.player .duel-who img {
  border-color: var(--gold);
}

.duel-row.enemy .duel-who img {
  border-color: #ff8fb3;
}

.duel-who .quote-name {
  font-size: 14px;
}

.duel-slot {
  display: grid;
  place-items: center;
  width: 78px;
  height: 108px;
  border: 1px dashed rgba(245, 197, 24, 0.45);
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  background: rgba(18, 22, 34, 0.7);
}

.duel-slot.has-card {
  border-style: solid;
  border-color: var(--gold);
  padding: 4px;
}

.duel-slot .duel-card {
  width: 100%;
  height: 100%;
}

.duel-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.duel-mid {
  margin: 0;
  text-align: center;
  color: var(--gold);
  font-family: "Jua", sans-serif;
}

.duel-card {
  width: 58px;
  height: 82px;
  padding: 0;
  border: none;
  background: transparent;
  perspective: 420px;
}

.duel-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}

.duel-card.is-flipped .duel-card-inner {
  transform: rotateY(180deg);
}

.duel-card-back,
.duel-card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px;
  backface-visibility: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.duel-card-back img,
.duel-card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duel-card-face {
  display: grid;
  grid-template-rows: 1fr auto;
  background: #1a2030;
  transform: rotateY(180deg);
}

.duel-card-face span {
  padding: 3px 4px;
  color: var(--ink);
  font-size: 9px;
  line-height: 1.2;
}

.duel-card.is-gone {
  visibility: hidden;
  pointer-events: none;
}

.duel-card[data-duel-pick] {
  outline: 1px solid rgba(245, 197, 24, 0.35);
  border-radius: 8px;
}

.board-token.is-ready-atk {
  animation: fx-ready-atk 0.9s ease-in-out infinite;
  z-index: 3;
}

.board-token.is-ready-def {
  animation: fx-ready-def 0.9s ease-in-out infinite;
  z-index: 3;
}

.board-token.is-striking,
.quote-side.is-striking img,
.duel-who img {
  transform-origin: center center;
}

.board-token.is-striking {
  animation: fx-card-strike 0.58s ease-out;
  z-index: 4;
}

.board-token.is-taking {
  animation: fx-card-hit 0.7s 0.18s both;
  z-index: 4;
}

.board-token.is-striking.is-taking {
  animation: fx-card-strike 0.46s ease-out, fx-card-hit 0.62s 0.42s both;
}

.quote-side.is-striking img {
  animation: fx-card-strike 0.58s ease-out;
}

.quote-side.is-taking img {
  animation: fx-card-hit 0.7s 0.18s both;
}

.quote-side.attack.is-striking.is-taking img {
  animation: fx-card-strike 0.46s ease-out, fx-card-hit 0.62s 0.42s both;
}

.quote-side.defend.is-striking.is-taking img {
  animation: fx-card-hit 0.4s ease-out, fx-counter-strike 0.52s 0.38s both;
}

.duel-row.is-striking .duel-who img,
.duel-row.is-striking .duel-slot.has-card .duel-card {
  animation: fx-card-strike 0.58s ease-out;
}

.duel-row.is-taking .duel-who img,
.duel-row.is-taking .duel-slot.has-card .duel-card {
  animation: fx-card-hit 0.72s 0.2s both;
}

.duel-row.is-striking.is-taking[data-side="attack"] .duel-who img,
.duel-row.is-striking.is-taking[data-side="attack"] .duel-slot.has-card .duel-card {
  animation: fx-card-strike 0.44s ease-out, fx-card-hit 0.64s 0.48s both;
}

.duel-row.is-striking.is-taking[data-side="defend"] .duel-who img,
.duel-row.is-striking.is-taking[data-side="defend"] .duel-slot.has-card .duel-card {
  animation: fx-card-hit 0.4s ease-out, fx-counter-strike 0.52s 0.38s both;
}

.duel-who,
.quote-side,
.board-token {
  position: relative;
}

.duel-row.is-striking .duel-who::after,
.quote-side.is-striking::after,
.board-token.is-striking::after {
  content: "";
  position: absolute;
  inset: 8% -10%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 246, 180, 0.95) 50%, transparent 62%);
  animation: fx-slash 0.42s ease-out;
}

.duel-row.is-taking .duel-who::after,
.quote-side.is-taking::after,
.board-token.is-taking::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background: rgba(255, 72, 72, 0.42);
  animation: fx-flash 0.55s 0.18s both;
}

.duel-table.is-clash .fx-slash,
.duel-table.is-clash .fx-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
}

.duel-table.is-clash .fx-slash {
  width: 70%;
  height: 8px;
  margin: -4px 0 0 -35%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #fff6b0, #ff8a3d, transparent);
  box-shadow: 0 0 18px #ffd36a;
  animation: fx-slash-line 0.45s 0.12s ease-out both;
}

.duel-table.is-clash .fx-burst {
  width: 86px;
  height: 86px;
  margin: -43px 0 0 -43px;
  border-radius: 50%;
  border: 3px solid #ffe08a;
  box-shadow: 0 0 24px #ff9a3c;
  animation: fx-burst 0.5s 0.18s ease-out both;
}

.duel-table.winner-both .fx-burst {
  border-color: #ff6b7d;
  box-shadow: 0 0 24px #ff4d6d;
}

@keyframes fx-card-strike {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); filter: brightness(1); }
  28% { transform: translate(-10px, -12px) rotate(-9deg) scale(1.06); filter: brightness(1.2); }
  52% { transform: translate(22px, 10px) rotate(8deg) scale(1.14); filter: brightness(1.45) saturate(1.2); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); filter: brightness(1); }
}

/* v6.2: 갤러리 카드 터치/호버 연출 전용(진폭 약 30%). 듀얼 연출은 아래 원본 keyframes 를 그대로 사용 */
html { --cs: 0.3; }
html[data-fx="high"] { --cs: 0.4; }
html[data-fx="low"] { --cs: 0; }
html[data-fx="low"] .card:not(.is-flipped):hover .card-flip, html[data-fx="low"] .card:not(.is-flipped):active .card-flip { animation: none; }
@keyframes fx-card-strike-soft {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); filter: brightness(1); }
  28% { transform: translate(calc(-10px * var(--cs)), calc(-12px * var(--cs))) rotate(calc(-9deg * var(--cs))) scale(calc(1 + 0.06 * var(--cs))); filter: brightness(1.2); }
  52% { transform: translate(calc(22px * var(--cs)), calc(10px * var(--cs))) rotate(calc(8deg * var(--cs))) scale(calc(1 + 0.14 * var(--cs))); filter: brightness(1.45) saturate(1.2); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); filter: brightness(1); }
}
@keyframes fx-card-hit-soft {
  0% { transform: translate(0, 0) rotate(0deg); filter: brightness(1) saturate(1); }
  12% { transform: translate(calc(-16px * var(--cs)), calc(8px * var(--cs))) rotate(calc(-14deg * var(--cs))); filter: brightness(2.1) saturate(0.35); }
  28% { transform: translate(calc(14px * var(--cs)), calc(-7px * var(--cs))) rotate(calc(10deg * var(--cs))); filter: brightness(0.75) sepia(0.45) hue-rotate(-15deg); }
  46% { transform: translate(calc(-11px * var(--cs)), calc(5px * var(--cs))) rotate(calc(-7deg * var(--cs))); filter: brightness(1.5); }
  68% { transform: translate(calc(7px * var(--cs)), calc(3px * var(--cs))) rotate(calc(4deg * var(--cs))); }
  100% { transform: translate(0, 0) rotate(0deg); filter: brightness(1); }
}

@keyframes fx-counter-strike {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  40% { transform: translate(-18px, -10px) rotate(-10deg) scale(1.12); filter: brightness(1.35); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); filter: brightness(1); }
}

@keyframes fx-card-hit {
  0% { transform: translate(0, 0) rotate(0deg); filter: brightness(1) saturate(1); }
  12% { transform: translate(-16px, 8px) rotate(-14deg); filter: brightness(2.1) saturate(0.35); }
  28% { transform: translate(14px, -7px) rotate(10deg); filter: brightness(0.75) sepia(0.45) hue-rotate(-15deg); }
  46% { transform: translate(-11px, 5px) rotate(-7deg); filter: brightness(1.5); }
  68% { transform: translate(7px, 3px) rotate(4deg); }
  100% { transform: translate(0, 0) rotate(0deg); filter: brightness(1); }
}

@keyframes fx-ready-atk {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.06); filter: brightness(1.12); }
}

@keyframes fx-ready-def {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.94); filter: saturate(0.85); }
}

@keyframes fx-slash {
  0% { opacity: 0; transform: rotate(-32deg) scaleX(0.15); }
  35% { opacity: 1; transform: rotate(-32deg) scaleX(1.15); }
  100% { opacity: 0; transform: rotate(-32deg) translateX(28px) scaleX(0.3); }
}

@keyframes fx-slash-line {
  0% { opacity: 0; transform: rotate(-28deg) scaleX(0.2); }
  40% { opacity: 1; transform: rotate(-28deg) scaleX(1); }
  100% { opacity: 0; transform: rotate(-28deg) scaleX(0.4); }
}

@keyframes fx-flash {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes fx-burst {
  0% { opacity: 0; transform: scale(0.25); }
  40% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.7); }
}

@media (max-width: 720px) {
  .app-scroll {
    padding: 14px 12px 20px;
  }

  .hero-panel {
    padding: 24px 16px 22px;
  }

  .hero-brand {
    flex-direction: column;
  }

  .hero-titles {
    text-align: center;
  }

  .hub-tools {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex: 0 0 auto;
  }

  .gallery,
  .banner-row,
  .skill-card,
  .weak-card {
    grid-template-columns: 1fr;
  }

  .card-art {
    height: 250px;
  }

  .draft-grid,
  .battle-party {
    grid-template-columns: 1fr;
  }

  .board-owner,
  .board-coord {
    font-size: 8px;
  }

  .duel-row {
    grid-template-columns: 64px 64px 1fr;
    gap: 6px;
  }

  .duel-card {
    width: 48px;
    height: 68px;
  }

  .duel-slot {
    width: 64px;
    height: 88px;
  }
}
