/* Sugar Arena: berry ink, cream candy boards, mint player / lilac AI identities. */
#duelScreen {
  --arena-muted: #705a70;
  --arena-accent-text: #815180;
  --arena-glass: rgba(255, 250, 244, 0.91);
  width: 100%;
  margin: 28px 0 36px;
  color: var(--ink);
  text-align: left;
  font-family: var(--font);
}

/* Give copy over the illustrated landscape a calm, local reading surface. */
.arena-how,
.arena-friends,
.duel-live-footer {
  background: var(--arena-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid #e5d5df;
  border-radius: 16px;
  box-shadow: 0 6px 22px #694b6809;
}
.arena-how,
.arena-friends {
  padding: 24px;
}
.duel-live-footer {
  padding: 13px 16px;
}
.play-mode-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 27px;
}
.play-mode-actions #startGame {
  margin: 0;
}
.join-pvp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 16px 18px;
  border: 1px solid #d4bbdf;
  border-radius: 15px;
  background: #f4eaf8;
  color: #855b90;
  box-shadow: 0 4px 0 #d9c5e3;
  font-size: 14px;
  font-weight: 900;
}
.join-pvp-button:hover {
  background: #ecddf4;
}
.join-pvp-button svg {
  width: 18px;
  height: 18px;
}
.arena-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--arena-muted);
  border: 1px solid #e4d5e0;
  border-radius: 8px;
  background: #fff8f2;
  font-size: 12px;
  padding: 10px 12px;
  flex-shrink: 0;
}
.arena-back svg {
  width: 14px;
  height: 14px;
  transform: rotate(180deg);
}
.arena-header {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #eadddf;
  padding: 12px 0 23px;
}
.arena-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 500 26px/1 var(--display);
  letter-spacing: -0.7px;
  flex-shrink: 0;
}
.arena-brand > svg {
  width: 32px;
  height: 32px;
  color: #a279b2;
}
.arena-brand > span > span {
  color: #aa6da4;
}
.arena-brand small {
  display: block;
  font: 900 12px var(--font);
  letter-spacing: 0.8px;
  color: var(--arena-muted);
  margin-top: 7px;
}
.arena-header nav {
  display: flex;
  gap: 6px;
  margin: auto;
}
.arena-header nav button {
  padding: 10px 17px;
  background: transparent;
  color: var(--arena-muted);
  border-radius: 9px;
  font-size: 14px;
}
.arena-header nav button.active {
  background: #f1e7f3;
  color: #92609e;
}
.arena-header > .icon-button {
  width: 33px;
  height: 33px;
  background: #fff5f0;
  border: 1px solid #e7d8df;
}
.arena-lobby {
  padding: 34px 0;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px 38px;
}
.arena-welcome .eyebrow {
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--arena-accent-text);
}
.arena-welcome h3 {
  font: 500 clamp(33px, 4vw, 48px)/1.06 var(--display);
  letter-spacing: -1px;
  margin: 17px 0;
}
.arena-welcome h3 > span {
  color: #aa70a3;
}
.arena-welcome > p:not(.arena-save-note):not(.arena-error) {
  font-size: 14px;
  line-height: 1.9;
  color: var(--arena-muted);
  max-width: 440px;
}
.arena-rule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}
.arena-rule-chips span {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f3ebf0;
  border: 1px solid #e8d9e2;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 12px;
  color: var(--arena-muted);
}
.arena-rule-chips svg {
  width: 13px;
  height: 13px;
}
.arena-start {
  font-size: 14px;
  gap: 10px;
  padding: 15px 20px;
  background: #8b4c81;
  box-shadow: 0 5px 0 #804a78;
  display: flex;
  align-items: center;
  max-width: 100%;
}
.arena-start > span {
  font-size: 12px;
  letter-spacing: 0.8px;
  opacity: 1;
  margin-left: 5px;
}
.arena-save-note {
  font-size: 13px;
  line-height: 1.8;
  color: var(--arena-muted);
  margin-top: 18px;
  max-width: 430px;
}
.arena-error {
  padding: 12px;
  border: 1px solid #e9c5d0;
  border-radius: 9px;
  color: #af5877;
  background: #fff1f2;
  font-size: 14px;
  line-height: 1.8;
}
.arena-resume {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e8f0e3;
  color: #656c5e;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.arena-resume svg {
  width: 15px;
  height: 15px;
}
.arena-opponent-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid #e1d0e8;
  border-radius: 20px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 45%, #fff8fa, transparent 60%),
    linear-gradient(140deg, #f5e8f1, #e8e3f4);
  overflow: hidden;
}
.arena-sticker {
  color: var(--arena-accent-text);
  letter-spacing: 0.8px;
  font-weight: 900;
  font-size: 12px;
}
.bot-orbit {
  width: 175px;
  height: 175px;
  border: 1px dashed #d2b6d5;
  border-radius: 50%;
  margin: 25px 0 10px;
  display: grid;
  place-items: center;
  position: relative;
}
.bot-orbit:before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid #e6d2e5;
  border-radius: 50%;
}
.bot-orbit .arena-avatar {
  width: 112px;
  height: 112px;
  border-radius: 32px;
  box-shadow:
    0 10px 25px #8e65ad22,
    inset 0 0 0 5px #fff6;
  transform: rotate(-8deg);
}
.bot-orbit > span:not(.arena-avatar) {
  position: absolute;
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border: 1px solid #d6bfde;
  border-radius: 11px;
  background: #fff7f4;
  color: #b08db8;
}
.bot-orbit > span:nth-child(2) {
  left: -5px;
  top: 25px;
  transform: rotate(-10deg);
}
.bot-orbit > span:nth-child(3) {
  right: -10px;
  bottom: 20px;
  transform: rotate(12deg);
}
.bot-orbit > span > svg {
  width: 19px;
  height: 19px;
}
.arena-opponent-preview h4 {
  font: 500 30px var(--display);
  margin: 4px 0 8px;
}
.ai-badge {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  background: #81518d;
  color: #fff7fd;
  padding: 5px 8px;
  border-radius: 5px;
}
.arena-opponent-preview p {
  font-size: 14px;
  line-height: 1.9;
  color: var(--arena-muted);
  margin: 14px 0;
}
.arena-skill-preview {
  display: flex;
  gap: 14px;
}
.arena-skill-preview > span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--arena-muted);
}
.arena-skill-preview svg {
  width: 15px;
  height: 15px;
}
.arena-how {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 24px;
}
.arena-how article {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.arena-how b {
  color: #92617e;
  font: 500 22px var(--display);
}
.arena-how h4 {
  font-size: 14px;
  margin: 1px 0 7px;
}
.arena-how p {
  font-size: 14px;
  color: var(--arena-muted);
  line-height: 1.8;
  margin: 0;
}
.arena-friends {
  grid-column: 1/-1;
}
.arena-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.arena-section-title h4 {
  font: 500 24px var(--display);
  margin: 5px 0;
}
.arena-section-title .eyebrow {
  font-size: 12px;
  color: var(--arena-muted);
  letter-spacing: 0.8px;
}
.arena-soon {
  font-size: 12px;
  background: #f0e9ef;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--arena-muted);
}
.arena-description {
  font-size: 14px;
  line-height: 1.8;
  color: var(--arena-muted);
}
#arenaFriends {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.arena-friend {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid #e7d8e1;
  border-radius: 10px;
  background: #fffdf8;
  min-width: 0;
}
.arena-friend > div {
  flex: 1;
  min-width: 0;
}
.arena-friend strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.arena-friend small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--arena-muted);
  font-size: 12px;
  margin-top: 5px;
}
.arena-friend i {
  width: 5px;
  height: 5px;
  background: #cbbdc7;
  border-radius: 50%;
}
.arena-friend .online {
  color: #4f713f;
}
.arena-friend .online i {
  background: #97b98c;
}
.arena-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #e4eee0;
  border: 1px solid #fffa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 3px #fff5;
}
.arena-avatar.bot {
  background: #e8dff1;
}
.arena-avatar img {
  width: 77%;
  height: 77%;
  object-fit: contain;
  filter: drop-shadow(0 3px 1px #694a7020);
}
.arena-friend .arena-avatar {
  width: 37px;
  height: 37px;
  border-radius: 11px;
}
.arena-friend-demo {
  padding: 16px 20px;
  margin-top: 15px;
  border: 1px dashed #d6badb;
  border-radius: 11px;
  background: #f7eef7;
}
.arena-friend-demo strong {
  font-size: 14px;
  color: #845d84;
}
.arena-friend-demo p {
  font-size: 13px;
  color: var(--arena-muted);
  line-height: 1.9;
}
.arena-ranking {
  padding: 34px 0;
}
.arena-ranking > .eyebrow {
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--arena-accent-text);
}
.arena-ranking h3 {
  font: 500 34px/1.15 var(--display);
  margin: 14px 0;
  letter-spacing: -0.6px;
}
.arena-ranking > p {
  color: var(--arena-muted);
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 25px;
}
.ranking-scroll {
  background: var(--arena-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  overflow-x: auto;
  border: 1px solid #eadde4;
  border-radius: 12px;
}
.ranking-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 560px;
  text-align: left;
}
.ranking-scroll th {
  padding: 13px 16px;
  font-size: 12px;
  color: var(--arena-muted);
  background: #f5edf2;
  white-space: nowrap;
}
.ranking-scroll td {
  padding: 14px 16px;
  border-top: 1px solid #eee3e9;
  color: #886c82;
  font-weight: 800;
}
.ranking-scroll td > small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--arena-muted);
  font-weight: 600;
}
.ranking-scroll td:first-child b {
  font: 500 23px var(--display);
  color: var(--arena-muted);
}
.ranking-scroll td button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  font-size: 14px;
  text-align: left;
}
.ranking-scroll .arena-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.ranking-scroll button small {
  display: block;
  color: #8c5c7b;
  font-size: 12px;
  letter-spacing: 0.8px;
  margin-top: 4px;
}
.ranking-self {
  background: #fbf0f6;
}
.ranking-empty {
  border: 1px dashed #dfc9df;
  border-radius: 16px;
  padding: 38px 24px;
  text-align: center;
  background: #faf3f8;
}
.ranking-empty > svg {
  width: 42px;
  height: 42px;
  color: #bd98ba;
}
.ranking-empty h4 {
  font: 500 25px var(--display);
  margin: 15px 0 8px;
}
.ranking-empty p {
  font-size: 14px;
  color: var(--arena-muted);
  line-height: 1.8;
}
.ranking-empty .primary-button {
  margin-top: 12px;
  font-size: 14px;
  padding: 12px 18px;
}
.duel-live {
  padding: 15px 0 18px;
  position: relative;
}
.duel-live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.duel-clock-wrap {
  text-align: center;
  min-width: 170px;
}
.duel-clock-wrap > span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--arena-muted);
  display: block;
}
.duel-clock-wrap > strong {
  display: block;
  font: 500 47px/0.95 var(--display);
  letter-spacing: -1.2px;
  color: #745373;
  margin: 8px 0 7px;
  font-variant-numeric: tabular-nums;
}
.duel-clock-wrap > small {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--arena-muted);
  background: #f2e8ee;
  border-radius: 5px;
  padding: 4px 9px;
}
.arena-leave {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff8f3;
  border: 1px solid #e6d6e0;
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--arena-muted);
  font-size: 12px;
}
.arena-leave svg {
  width: 14px;
  height: 14px;
}
.duel-score-race {
  height: 7px;
  border-radius: 10px;
  background: #cdb3de;
  position: relative;
  margin: 20px 0 24px;
  box-shadow: inset 0 1px 2px #74597411;
}
.duel-score-race > span {
  width: 50%;
  height: 100%;
  border-radius: 10px;
  background: #a6c59a;
  display: block;
  transition: width 0.6s ease;
}
.duel-score-race > i {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font: 900 12px var(--font);
  font-style: normal;
  background: #fffbf5;
  color: var(--arena-muted);
  border: 1px solid #dfcfdd;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}
.duel-arena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  position: relative;
  align-items: start;
}
.duel-side {
  padding: 16px 20px 15px;
  border: 1px solid #cfddc9;
  background: linear-gradient(#f2f5ed, #fcfaf2);
  border-radius: 18px;
  min-width: 0;
}
.duel-side.opponent {
  border-color: #decfe7;
  background: linear-gradient(#f0e9f7, #fcf8fa);
}
.duel-player-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
}
.duel-player-heading > div {
  min-width: 0;
}
.duel-side-label {
  font-size: 12px;
  letter-spacing: 0.8px;
  font-weight: 900;
  color: #6d6a69;
}
.opponent .duel-side-label {
  color: #ac8eb9;
}
.duel-player-heading h3 {
  font: 500 23px/1.15 var(--display);
  margin: 4px 0 3px;
  overflow-wrap: anywhere;
  letter-spacing: -0.4px;
}
.duel-player-heading small {
  font-size: 12px;
  color: var(--arena-muted);
  display: block;
}
.duel-score {
  font: 500 31px var(--display);
  color: #7b9b69;
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.opponent .duel-score {
  color: #a07eb4;
}
.duel-board-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--arena-muted);
  margin: 10px 0;
  line-height: 1.5;
}
.duel-board-label b {
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--arena-muted);
  text-align: right;
}
.opponent .duel-board-label b {
  color: var(--arena-muted);
}
.duel-board-frame {
  position: relative;
  padding: 9px;
  border: 1px solid #d9c9df;
  border-radius: 15px;
  background: #f4ebf5;
  box-shadow:
    0 5px 0 #d9c9df40,
    inset 0 0 0 4px #fff9;
}
@media (min-width: 761px) {
  /* Give the match more room and size candies by width, even on short screens. */
  .app-shell:has(> #duelScreen[data-view="match"]:not([hidden])) {
    max-width: 1560px;
    padding-inline: 24px;
  }
  .app-shell:has(> #duelScreen[data-view="match"]:not([hidden])) .site-header {
    height: 88px;
  }
  #duelScreen[data-view="match"] {
    margin-top: 16px;
  }
  .duel-board-frame {
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
  }
}
.duel-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  touch-action: none;
  user-select: none;
}
.duel-surface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: none;
  fill: none;
  overflow: visible;
}
.duel-candy {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  left: calc(var(--col) * 12.5%);
  top: calc(var(--row) * 12.5%);
  padding: 3px;
  background: none;
  border: 0;
  display: block;
  transition:
    left 0.16s ease,
    top 0.16s ease,
    filter 0.18s,
    transform 0.18s;
  border-radius: 8px;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}
.duel-candy .candy-art {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}
.duel-candy img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.duel-candy:not([aria-disabled="true"]):hover {
  filter: brightness(1.1);
  z-index: 2;
}
.duel-candy.duel-selected {
  box-shadow:
    inset 0 0 0 2px #fff2a7,
    0 0 0 2px #c19557;
  z-index: 3;
  background: #fff2ab44;
}
.duel-candy.duel-crush {
  transform: scale(0.1) rotate(15deg);
  opacity: 0.15;
  transition:
    transform 0.14s,
    opacity 0.14s;
}
.duel-candy.duel-locked {
  background: #d6eaf488;
  box-shadow: inset 0 0 0 2px #b8c6ec;
  filter: saturate(0.55);
}
.duel-candy.duel-locked:after {
  content: "";
  position: absolute;
  inset: 25%;
  border: 2px solid #f6fdff;
  border-radius: 7px;
  background: #b2bfe6bb;
  box-shadow: 0 0 0 1px #9badd7;
  pointer-events: none;
}
.duel-candy.duel-locked:before {
  content: "";
  position: absolute;
  z-index: 3;
  width: 19%;
  height: 22%;
  left: 40%;
  top: 13%;
  border: 2px solid #f8ffff;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  pointer-events: none;
}
.duel-guard-ring {
  position: absolute;
  inset: 0;
  border: 3px solid #9bc9c3;
  border-radius: 15px;
  box-shadow:
    0 0 25px #9bc9c333,
    inset 0 0 20px #a3d4c333;
  pointer-events: none;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding-top: 9px;
  color: #6ca49b;
}
.duel-guard-ring span {
  font-size: 12px;
  letter-spacing: 0.8px;
  font-weight: 900;
  background: #e5f4ee;
  padding: 4px 8px;
  border-radius: 5px;
}
.duel-guard-ring svg {
  width: 20px;
  height: 20px;
  background: #e5f4ee;
  border-radius: 5px;
}
.duel-float {
  position: absolute;
  z-index: 7;
  top: 40%;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  color: #fff9e0;
  font: 500 42px var(--display);
  text-shadow:
    0 3px 0 #bc8d68,
    0 0 14px #ae7c6c66;
  opacity: 0;
  white-space: nowrap;
}
.duel-float.show {
  animation: duel-points 1.2s ease-out both;
}
.duel-energy-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0 7px;
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--arena-muted);
}
.duel-energy-label > span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 900;
}
.duel-energy-label svg {
  width: 13px;
  height: 13px;
}
.duel-energy-label > b {
  font-size: 12px;
  letter-spacing: 0;
}
.duel-energy-track {
  height: 7px;
  background: #e6dae7;
  border-radius: 6px;
  overflow: hidden;
}
.duel-energy-track > span {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #d6b3df, #aa7abd);
  border-radius: 6px;
  transition: width 0.35s;
  width: 30%;
}
.duel-skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 13px;
}
.duel-skills button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffbf6;
  border: 1px solid #dbc9df;
  border-radius: 9px;
  padding: 10px;
  text-align: left;
}
.duel-skills button > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  background: #efe3f2;
  color: #ab82b9;
  flex-shrink: 0;
}
.duel-skills svg {
  width: 18px;
  height: 18px;
}
.duel-skills strong {
  font-size: 12px;
  min-width: 0;
}
.duel-skills small {
  display: block;
  font-size: 12px;
  color: var(--arena-muted);
  margin-top: 4px;
  font-weight: 600;
}
.duel-skills b {
  font: 500 18px var(--display);
  color: var(--arena-muted);
  margin-left: auto;
}
.duel-skills button:disabled {
  opacity: 1;
  background: #f0eaf0;
  border-style: dashed;
}
.duel-ai-note {
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  margin: 20px 0;
  color: var(--arena-muted);
}
.duel-live-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 20px;
  color: var(--arena-muted);
  font-size: 12px;
  line-height: 1.8;
}
.demo-label {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: var(--arena-muted);
  white-space: nowrap;
}
#duelCountdown {
  position: absolute;
  z-index: 8;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 90px;
  border-radius: 25px;
  border: 4px solid #fff8e8;
  background: #b18dbd;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 40px #76517e44;
  color: #fff9f0;
  font: 500 65px var(--display);
  pointer-events: none;
}
#duelBattleMessage {
  position: absolute;
  z-index: 8;
  top: 24%;
  left: 50%;
  transform: translate(-50%, 10px);
  max-width: 75%;
  padding: 13px 18px;
  background: #755679eb;
  color: #fff8f6;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 8px 25px #76517e22;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
#duelBattleMessage.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.duel-comet {
  position: absolute;
  z-index: 9;
  top: 39%;
  left: 9%;
  width: 52px;
  height: 52px;
  background: #f3cf8c;
  border: 3px solid #fff2d4;
  border-radius: 17px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #b18c57;
  pointer-events: none;
  box-shadow: 0 0 25px #f3cf8c99;
}
.duel-comet svg {
  width: 28px;
  height: 28px;
}
.duel-comet.fly {
  display: flex;
  animation: duel-attack 0.8s cubic-bezier(0.3, 0.2, 0.5, 1) both;
}
.duel-comet.from-right {
  left: 85%;
  --duel-flight: -780%;
}
.duel-comet.from-left {
  --duel-flight: 780%;
}
.duel-comet.counter {
  background: #cce5df;
  color: #7aa297;
  border-color: #eefcf6;
}
.revenge .duel-clock-wrap > strong {
  color: #be8646;
  text-shadow: 0 2px 0 #f3e3c2;
}
.revenge .duel-clock-wrap > span {
  color: #c09156;
}
.revenge .duel-clock-wrap > small {
  background: #f7e8c5;
  color: #b48944;
}
.revenge .duel-board-frame {
  border-color: #d6b270;
  box-shadow:
    0 0 19px #eccd8e44,
    inset 0 0 0 4px #fff5;
}
.duel-network {
  font-size: 13px;
  line-height: 1.7;
  color: #856354;
  background: #fff0dc;
  padding: 9px 12px;
  border: 1px solid #ebd0a6;
  border-radius: 8px;
  margin-top: 13px;
}
#duelNotice {
  position: sticky;
  z-index: 20;
  bottom: 20px;
  margin: 0 auto 15px;
  width: fit-content;
  max-width: 85%;
  padding: 12px 18px;
  background: #72516fee;
  color: #fff7f5;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  box-shadow: 0 6px 20px #57374e22;
}
.duel-confirm {
  width: min(440px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  text-align: center;
}
.duel-confirm > div {
  padding: 32px;
  position: relative;
}
.duel-confirm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
}
.duel-confirm-close svg {
  width: 15px;
  height: 15px;
}
.duel-confirm .eyebrow {
  font-size: 12px;
  color: #7f637a;
  letter-spacing: 0.8px;
}
.duel-confirm h3 {
  font: 500 29px var(--display);
  margin: 15px 0;
}
.duel-confirm p {
  font-size: 14px;
  color: var(--arena-muted);
  line-height: 1.9;
}
.duel-confirm .primary-button {
  font-size: 14px;
  margin: 10px auto 15px;
  display: flex;
}
.duel-confirm .text-button {
  margin: auto;
  font-size: 13px;
  color: #826178;
}
#duelResult {
  display: flex;
  justify-content: center;
  padding: 34px 12px;
}
.duel-result-card {
  max-width: 560px;
  width: 100%;
  padding: 28px 35px;
  border: 1px solid #decadc;
  border-radius: 22px;
  background: linear-gradient(#fffcf7, #fcf2f6);
  box-shadow: 0 20px 60px #76517e22;
  text-align: center;
}
.duel-result-medal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  background: #f5e6bf;
  border: 4px double #d4b373;
  color: #b39251;
  border-radius: 50%;
  margin: 0 auto 18px;
}
.duel-result-medal svg {
  width: 36px;
  height: 36px;
}
.duel-result-card > .eyebrow {
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--arena-muted);
  display: block;
}
.duel-result-card h3 {
  font: 500 34px/1.1 var(--display);
  letter-spacing: -0.5px;
  margin: 12px 0;
}
.duel-result-card > p {
  font-size: 14px;
  line-height: 1.9;
  color: var(--arena-muted);
}
.duel-result-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  margin: 22px 0;
}
.duel-result-score span {
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--arena-muted);
  font-weight: 900;
}
.duel-result-score strong {
  font: 500 32px var(--display);
  display: block;
  color: #93789b;
  margin: 8px 0 5px;
}
.duel-result-player {
  min-width: 0;
  padding: 17px 8px;
  border: 2px solid #e5dae4;
  border-radius: 12px;
  background: #f8f4f6;
}
.duel-result-player.winner {
  background: linear-gradient(#fff8de, #f8e9bd);
  border-color: #cba44f;
  box-shadow: 0 5px 18px #cba44f24;
}
.duel-result-player.winner strong {
  color: #936620;
}
.duel-result-player.runner-up strong {
  color: #9d8a9e;
}
.duel-result-player.tied {
  background: #f0eaf7;
  border-color: #c5b2d3;
}
.duel-result-score .duel-result-placement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 24px;
  margin: -6px 0 13px;
  padding: 5px 6px;
  border-radius: 5px;
  background: #ece3eb;
  color: #79667b;
  font-size: 12px;
  letter-spacing: 0.7px;
}
.duel-result-placement svg {
  width: 13px;
  height: 13px;
}
.winner .duel-result-placement {
  background: #b78b34;
  color: #fffaf0;
}
.duel-result-player-name {
  margin: 6px 0 0;
  color: #836c7f;
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.duel-result-card.result-win h3 {
  color: #6d9257;
}
.duel-result-card.result-loss h3 {
  color: #ae5b78;
}
.duel-result-card.result-loss .duel-result-medal {
  background: #f4dce6;
  border-color: #d3a3b9;
  color: #b77492;
}
.duel-result-card.result-draw .duel-result-medal {
  background: #e8ddf3;
  border-color: #b9a2cf;
  color: #9575aa;
}
.duel-result-card > .duel-result-winner {
  color: #7e6078;
  font-size: 15px;
  margin: 9px 0 0;
}
.duel-result-winner b {
  overflow-wrap: anywhere;
}
.duel-result-card > .duel-result-reason {
  font-size: 12px;
  margin: 5px 0 0;
}
.duel-result-score small {
  font-size: 12px;
  color: var(--arena-muted);
}
.duel-result-score > b {
  font: 500 15px var(--display);
  color: #c5aabc;
}
.duel-result-streak {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 20px 0;
}
.duel-result-streak > span {
  font-size: 12px;
  color: var(--arena-muted);
}
.duel-result-streak b {
  display: block;
  font: 500 26px var(--display);
  color: #a47a9c;
  margin-bottom: 5px;
}
.duel-result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 16px;
}
.duel-result-actions .primary-button {
  font-size: 14px;
  padding: 12px 19px;
}
.duel-result-card > .text-button {
  font-size: 12px;
  color: #7d6278;
  margin: auto;
}
.duel-result-source {
  display: block;
  margin-top: 23px;
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--arena-muted);
}
.profile-online {
  display: inline-flex;
  font-size: 12px;
  color: #666e61;
  margin-left: 9px;
  align-items: center;
  gap: 4px;
}
.profile-online:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9ac18b;
}
.profile-duel-record {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 17px;
  margin: 18px 0;
  border: 1px solid #dfcee5;
  border-radius: 12px;
  background: linear-gradient(110deg, #f5edf6, #fcf5ec);
}
.profile-duel-record > div:first-child {
  flex: 1;
  min-width: 130px;
}
.profile-duel-record .eyebrow {
  font-size: 12px;
  letter-spacing: 0.8px;
  color: #7c637e;
}
.profile-duel-record h3 {
  font: 500 20px var(--display);
  margin: 6px 0;
}
.profile-duel-record p {
  font-size: 12px;
  color: #7b6578;
  margin: 0;
}
.profile-duel-record strong {
  font: 500 29px var(--display);
  color: #a07bab;
  display: block;
  text-align: center;
}
.profile-duel-record > div > span:not(.eyebrow) {
  display: block;
  font-size: 12px;
  color: #7a647a;
  white-space: nowrap;
}
.profile-duel-record > .text-button {
  font-size: 12px;
  color: #7e627d;
}
@keyframes duel-points {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }
  25% {
    opacity: 1;
    transform: translateY(0) scale(1.05);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-30px);
  }
}
@keyframes duel-attack {
  0% {
    opacity: 0;
    transform: translateX(0) scale(0.6) rotate(-10deg);
  }
  15% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(var(--duel-flight)) scale(1.2) rotate(20deg);
  }
}
@media (max-width: 1100px) {
  .duel-live {
    padding: 20px;
  }
  .duel-arena {
    gap: 20px;
  }
  .duel-side {
    padding: 13px;
  }
  .duel-player-heading h3 {
    font-size: 20px;
  }
  .duel-score {
    font-size: 26px;
  }
  .duel-skills button {
    padding: 8px;
    gap: 6px;
  }
  .duel-skills button > span {
    width: 26px;
    height: 26px;
  }
  .header-actions .sound-status {
    display: none;
  }
}
@media (max-width: 760px) {
  .arena-header {
    padding: 18px;
    gap: 12px;
  }
  .arena-brand {
    font-size: 22px;
    gap: 8px;
  }
  .arena-brand > svg {
    width: 24px;
    height: 24px;
  }
  .arena-header nav {
    gap: 0;
  }
  .arena-header nav button {
    font-size: 12px;
    padding: 9px 11px;
  }
  .arena-brand small {
    font-size: 12px;
  }
  .arena-lobby {
    padding: 25px;
    gap: 24px;
    grid-template-columns: 1.2fr 1fr;
  }
  .arena-welcome h3 {
    font-size: 35px;
  }
  .arena-welcome > p:not(.arena-save-note):not(.arena-error) {
    font-size: 13px;
  }
  .arena-welcome .eyebrow {
    font-size: 12px;
  }
  .arena-start {
    font-size: 14px;
    padding: 13px;
    gap: 7px;
  }
  .arena-start > span {
    display: none;
  }
  .arena-start svg {
    width: 17px;
    height: 17px;
  }
  .arena-opponent-preview {
    padding: 20px 12px;
  }
  .bot-orbit {
    width: 130px;
    height: 130px;
  }
  .bot-orbit .arena-avatar {
    width: 90px;
    height: 90px;
    border-radius: 25px;
  }
  .arena-opponent-preview h4 {
    font-size: 25px;
  }
  .arena-opponent-preview p {
    font-size: 14px;
  }
  .arena-skill-preview {
    gap: 7px;
  }
  .arena-skill-preview > span {
    font-size: 12px;
  }
  .arena-how {
    gap: 13px;
  }
  .arena-how h4 {
    font-size: 13px;
  }
  .arena-how p {
    font-size: 14px;
  }
  .arena-ranking {
    padding: 25px;
  }
  .arena-ranking h3 {
    font-size: 30px;
  }
  .duel-live .arena-brand > svg {
    display: none;
  }
  .duel-live-header {
    gap: 10px;
  }
  .duel-clock-wrap {
    min-width: 130px;
  }
  .duel-clock-wrap > strong {
    font-size: 40px;
  }
  .duel-clock-wrap > span {
    font-size: 12px;
    letter-spacing: 0.8px;
  }
  .duel-arena {
    gap: 13px;
  }
  .duel-side {
    padding: 11px;
  }
  .duel-player-heading {
    gap: 7px;
    flex-wrap: wrap;
  }
  .duel-player-heading .arena-avatar {
    width: 33px;
    height: 33px;
    border-radius: 11px;
  }
  .duel-player-heading > div {
    flex: 1;
  }
  .duel-player-heading h3 {
    font-size: 19px;
  }
  .duel-score {
    width: 100%;
    text-align: right;
    font-size: 29px;
  }
  .duel-side-label {
    font-size: 12px;
    letter-spacing: 0.7px;
  }
  .duel-player-heading small {
    font-size: 12px;
  }
  .duel-board-label {
    font-size: 12px;
    gap: 5px;
    flex-direction: column;
  }
  .duel-board-label b {
    font-size: 12px;
    text-align: left;
  }
  .duel-skills {
    gap: 6px;
  }
  .duel-skills button {
    padding: 7px 6px;
    flex-wrap: wrap;
  }
  .duel-skills strong {
    font-size: 12px;
  }
  .duel-skills small {
    font-size: 12px;
  }
  .duel-skills b {
    font-size: 14px;
  }
  .duel-skills button > span {
    width: 23px;
    height: 23px;
  }
  .duel-skills svg {
    width: 14px;
    height: 14px;
  }
  .duel-board-frame {
    padding: 5px;
    border-radius: 11px;
  }
  .duel-candy {
    padding: 2px;
    border-radius: 5px;
  }
  .duel-energy-label {
    font-size: 12px;
  }
  .duel-energy-label > b {
    font-size: 12px;
  }
  .duel-ai-note {
    font-size: 12px;
  }
  .duel-live-footer {
    font-size: 12px;
    flex-wrap: wrap;
  }
  .duel-float {
    font-size: 30px;
  }
  #duelBattleMessage {
    font-size: 12px;
    top: 33%;
    max-width: 85%;
  }
}
@media (max-width: 540px) {
  .play-mode-actions {
    flex-direction: column;
    justify-content: center;
    margin-top: 24px;
  }
  .play-mode-actions #startGame,
  .join-pvp-button {
    width: min(100%, 250px);
  }
  .join-pvp-button {
    padding: 14px 18px;
  }
  .arena-back {
    margin-left: auto;
    font-size: 12px;
    padding: 8px;
  }
  #duelScreen {
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
  }
  .arena-header {
    padding: 16px 13px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .arena-header .arena-brand {
    font-size: 23px;
  }
  .arena-header nav {
    order: 3;
    width: 100%;
    justify-content: center;
    border-top: 1px solid #ecdee5;
    padding-top: 10px;
  }
  .arena-header > .icon-button {
    margin-left: auto;
    width: 29px;
    height: 29px;
  }
  .arena-header nav button {
    padding: 7px 20px;
    font-size: 13px;
  }
  .arena-lobby {
    padding: 24px 18px;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .arena-welcome h3 {
    font-size: 38px;
  }
  .arena-welcome > p:not(.arena-save-note):not(.arena-error) {
    font-size: 14px;
  }
  .arena-start {
    font-size: 14px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .arena-start > span {
    display: inline;
    font-size: 12px;
    flex-basis: 100%;
    order: 1;
    margin-left: 0;
    text-align: center;
  }
  .arena-opponent-preview {
    display: grid;
    grid-template-columns: 90px 1fr;
    text-align: left;
    gap: 4px 16px;
    padding: 18px;
    align-items: center;
  }
  .arena-sticker {
    grid-column: 2;
    font-size: 12px;
  }
  .bot-orbit {
    grid-column: 1;
    grid-row: 1 / span 4;
    width: 80px;
    height: 80px;
    margin: 0;
  }
  .bot-orbit .arena-avatar {
    width: 65px;
    height: 65px;
    border-radius: 19px;
  }
  .bot-orbit > span:not(.arena-avatar) {
    width: 23px;
    height: 23px;
    border-radius: 7px;
  }
  .bot-orbit > span > svg {
    width: 12px;
    height: 12px;
  }
  .bot-orbit > span:nth-child(2) {
    left: -7px;
    top: -3px;
  }
  .bot-orbit > span:nth-child(3) {
    right: -8px;
    bottom: 0;
  }
  .arena-opponent-preview h4 {
    grid-column: 2;
    font-size: 24px;
    margin: 0;
  }
  .ai-badge {
    grid-column: 2;
    width: fit-content;
    font-size: 12px;
    letter-spacing: 0.8px;
  }
  .arena-opponent-preview p {
    grid-column: 1/-1;
    font-size: 14px;
    margin: 8px 0 0;
  }
  .arena-opponent-preview p br {
    display: none;
  }
  .arena-skill-preview {
    grid-column: 1/-1;
    margin-top: 8px;
  }
  .arena-skill-preview > span {
    font-size: 12px;
  }
  .arena-how {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 15px;
  }
  .arena-how h4 {
    font-size: 14px;
  }
  .arena-how p {
    font-size: 14px;
  }
  .arena-how b {
    width: 22px;
    flex-shrink: 0;
  }
  .arena-friends {
    padding: 18px;
  }
  .arena-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
  .arena-section-title h4 {
    font-size: 22px;
  }
  .arena-description {
    font-size: 14px;
  }
  #arenaFriends {
    grid-template-columns: 1fr;
  }
  .arena-ranking {
    padding: 25px 18px;
  }
  .arena-ranking h3 {
    font-size: 28px;
  }
  .arena-ranking > p {
    font-size: 13px;
  }
  .ranking-empty {
    padding: 25px 16px;
  }
  .ranking-empty h4 {
    font-size: 23px;
  }
  .duel-live {
    padding: 15px 10px;
  }
  .duel-live .arena-brand {
    font-size: 18px;
  }
  .duel-live .arena-brand small {
    font-size: 12px;
    letter-spacing: 0.8px;
  }
  .duel-clock-wrap {
    min-width: 95px;
  }
  .duel-clock-wrap > strong {
    font-size: 35px;
  }
  .duel-clock-wrap > span {
    font-size: 12px;
    letter-spacing: 0.6px;
  }
  .duel-clock-wrap > small {
    font-size: 12px;
    letter-spacing: 0.4px;
    padding: 4px;
  }
  .arena-leave {
    font-size: 12px;
    padding: 7px;
    gap: 5px;
  }
  .arena-leave svg {
    width: 11px;
    height: 11px;
  }
  .duel-score-race {
    margin: 18px 0 21px;
    height: 5px;
  }
  .duel-score-race > i {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
  .duel-arena {
    gap: 8px;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
  .duel-side {
    padding: 8px 6px;
    border-radius: 12px;
  }
  .duel-player-heading {
    gap: 5px;
    margin-bottom: 10px;
  }
  .duel-player-heading .arena-avatar {
    width: 27px;
    height: 27px;
    border-radius: 9px;
  }
  .duel-player-heading h3 {
    font-size: 14px;
    letter-spacing: -0.3px;
  }
  .duel-player-heading small {
    font-size: 12px;
  }
  .duel-side-label {
    font-size: 12px;
    letter-spacing: 0.2px;
  }
  .duel-score {
    font-size: 24px;
  }
  .duel-board-label {
    font-size: 12px;
    min-height: 27px;
    justify-content: flex-end;
    gap: 2px;
  }
  .duel-board-label b {
    font-size: 12px;
  }
  .duel-board-frame {
    padding: 3px;
    border-radius: 8px;
    box-shadow: inset 0 0 0 2px #fff9;
  }
  .duel-candy {
    padding: 1px;
    border-radius: 3px;
  }
  .duel-candy img {
    filter: drop-shadow(0 1px 0 #8f6d9a22);
  }
  .duel-candy.duel-locked:after {
    border-width: 1px;
    border-radius: 3px;
  }
  .duel-candy.duel-locked:before {
    border-width: 1px;
  }
  .duel-candy.duel-selected {
    box-shadow:
      inset 0 0 0 1px #fff2a7,
      0 0 0 1px #c19557;
  }
  .duel-skills {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 10px;
  }
  .duel-skills button {
    padding: 7px;
    flex-wrap: nowrap;
  }
  .duel-skills button > span {
    width: 22px;
    height: 22px;
  }
  .duel-skills strong {
    font-size: 12px;
  }
  .duel-skills small {
    font-size: 12px;
  }
  .duel-skills b {
    font-size: 17px;
  }
  .duel-energy-label {
    margin-top: 13px;
    font-size: 12px;
  }
  .duel-energy-label svg {
    width: 10px;
    height: 10px;
  }
  .duel-energy-label > b {
    font-size: 12px;
  }
  .duel-energy-track {
    height: 5px;
  }
  .duel-ai-note {
    font-size: 12px;
    line-height: 1.9;
    margin: 15px 0;
  }
  .duel-live-footer {
    margin-top: 16px;
    gap: 8px;
  }
  .duel-live-footer > span:first-child {
    font-size: 12px;
    line-height: 1.8;
  }
  .demo-label {
    font-size: 12px;
  }
  .duel-float {
    font-size: 22px;
  }
  .duel-guard-ring {
    border-width: 2px;
    border-radius: 8px;
    padding-top: 4px;
    gap: 2px;
  }
  .duel-guard-ring svg {
    width: 13px;
    height: 13px;
  }
  .duel-guard-ring span {
    font-size: 12px;
    padding: 3px;
    letter-spacing: 0.5px;
  }
  #duelCountdown {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    font-size: 43px;
    top: 30%;
  }
  #duelBattleMessage {
    font-size: 12px;
    padding: 10px 13px;
    top: 39%;
    max-width: 90%;
    width: max-content;
  }
  .duel-comet {
    width: 33px;
    height: 33px;
    border-radius: 11px;
    top: 36%;
    border-width: 2px;
  }
  .duel-comet svg {
    width: 18px;
    height: 18px;
  }
  .duel-comet.from-left {
    --duel-flight: 550%;
  }
  .duel-comet.from-right {
    --duel-flight: -550%;
  }
  .duel-confirm > div {
    padding: 24px 18px;
  }
  .duel-confirm h3 {
    font-size: 26px;
  }
  .duel-confirm p {
    font-size: 13px;
  }
  #duelResult {
    padding: 20px 9px;
  }
  .duel-result-card {
    padding: 24px 16px;
    border-radius: 16px;
  }
  .duel-result-card h3 {
    font-size: 28px;
  }
  .duel-result-card > p {
    font-size: 13px;
  }
  .duel-result-medal {
    width: 62px;
    height: 62px;
  }
  .duel-result-medal svg {
    width: 29px;
    height: 29px;
  }
  .duel-result-score {
    padding: 0;
    gap: 6px;
    grid-template-columns: 1fr 18px 1fr;
  }
  .duel-result-score strong {
    font-size: 25px;
  }
  .duel-result-score span {
    font-size: 12px;
    letter-spacing: 0.8px;
  }
  .duel-result-score small {
    font-size: 12px;
  }
  .duel-result-player {
    padding: 14px 5px;
  }
  .duel-result-score .duel-result-placement {
    padding: 4px;
    font-size: 12px;
    letter-spacing: 0.2px;
    gap: 3px;
  }
  .duel-result-player-name {
    font-size: 12px;
  }
  .duel-result-streak {
    gap: 6px;
  }
  .duel-result-streak b {
    font-size: 23px;
  }
  .duel-result-streak span {
    font-size: 12px;
  }
  .duel-result-actions {
    gap: 7px;
    flex-wrap: wrap;
  }
  .duel-result-actions .primary-button {
    font-size: 13px;
  }
  .duel-result-actions .small-button {
    font-size: 12px;
  }
  .duel-result-source {
    font-size: 12px;
    letter-spacing: 0.7px;
  }
  .profile-duel-record {
    gap: 12px;
    padding: 15px;
  }
  .profile-duel-record > div:first-child {
    flex-basis: 100%;
  }
  .profile-duel-record > .text-button {
    margin-left: auto;
  }
  .profile-online {
    font-size: 12px;
    margin-left: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .duel-candy,
  .duel-score-race > span,
  .duel-energy-track > span {
    transition: none;
  }
  .duel-comet.fly {
    animation: none;
    display: none;
  }
  .duel-float.show {
    animation: none;
    opacity: 0;
  }
  #duelBattleMessage {
    transition: none;
  }
}

/* Disabled actions stay legible while their muted fill signals availability. */
.arena-friend button:disabled {
  opacity: 1;
  color: var(--arena-muted);
  background: #f0eaf0;
  border-style: dashed;
}
/* The match toolbar keeps the clock and both skills above the boards. */
.duel-live-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(290px, 1.4fr) auto;
  gap: 18px;
  position: sticky;
  top: 8px;
  z-index: 12;
  padding: 8px 14px;
  border: 1px solid #e5d5df;
  border-radius: 14px;
  background: rgba(255, 250, 244, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 18px #694b680b;
}
.duel-live-header .arena-brand {
  font-size: 24px;
}
.duel-live-header .duel-skills {
  margin: 0;
}
.duel-live-header .duel-skills button {
  min-height: 48px;
}
.duel-live-header .duel-clock-wrap {
  min-width: 136px;
}
.duel-live-header .duel-clock-wrap > strong {
  font-size: 36px;
  margin: 4px 0;
}
.duel-live-header .duel-clock-wrap > small {
  font-size: 12px;
}
@media (min-width: 761px) {
  .app-shell:has(> #duelScreen[data-view="match"]:not([hidden])) .site-header {
    height: 64px;
  }
  .duel-live-header .duel-clock-wrap {
    display: grid;
    grid-template-columns: auto auto;
    gap: 4px 10px;
    align-items: center;
    text-align: left;
  }
  .duel-live-header .duel-clock-wrap > strong {
    grid-column: 1;
    grid-row: 1 / 3;
    margin: 0;
  }
  .duel-live-header .duel-clock-wrap > span,
  .duel-live-header .duel-clock-wrap > small {
    grid-column: 2;
    white-space: nowrap;
    line-height: 1.3;
  }
  #duelScreen[data-view="match"] {
    margin-top: 8px;
  }
  .duel-live {
    padding: 0;
  }
  .duel-score-race {
    margin: 10px 0 12px;
  }
  .duel-side {
    padding: 10px;
  }
  .duel-player-heading {
    margin-bottom: 0;
  }
  .duel-side-label {
    display: block;
    line-height: 1.3;
  }
  .duel-player-heading h3 {
    font-size: 21px;
    margin: 2px 0;
  }
  .duel-board-label {
    margin: 4px 0;
  }
  .duel-board-frame {
    max-width: min(640px, calc(100dvh - 320px));
  }
  .duel-energy-label {
    margin-top: 6px;
  }
  .duel-ai-note {
    display: none;
  }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .duel-live-header {
    gap: 10px;
    grid-template-columns: auto minmax(260px, 1fr) auto;
  }
  .duel-live-header .arena-brand {
    display: none;
  }
  .duel-live-header .arena-brand > svg {
    display: none;
  }
  .duel-live-header .duel-skills small {
    display: none;
  }
  .duel-live-header .duel-skills button {
    padding: 7px;
    gap: 5px;
  }
  .duel-live-header .duel-skills button > span {
    width: 22px;
    height: 22px;
  }
}
@media (max-width: 760px) {
  .duel-live-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 8px 12px;
    padding: 10px;
  }
  .duel-live-header > .arena-brand {
    grid-column: 1;
    grid-row: 1;
    font-size: 20px;
  }
  .duel-live-header > .arena-leave {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .duel-live-header > .duel-clock-wrap {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }
  .duel-live-header > .duel-skills {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: 1fr;
    gap: 6px;
    min-width: 0;
  }
  .duel-live-header .duel-skills button {
    flex-wrap: nowrap;
    padding: 7px;
    gap: 5px;
    min-height: 40px;
    min-width: 0;
  }
  .duel-live-header .duel-skills button > span {
    width: 22px;
    height: 22px;
  }
  .duel-live-header .duel-skills strong {
    font-size: 12px;
  }
  .duel-live-header .duel-skills small {
    display: none;
  }
  .duel-live-header .duel-skills b {
    font-size: 15px;
  }
  .duel-live-header .duel-clock-wrap > strong {
    font-size: 32px;
  }
  .duel-live-header .duel-clock-wrap > span {
    font-size: 12px;
    letter-spacing: 0.4px;
  }
  .duel-live-header .duel-clock-wrap > small {
    font-size: 12px;
    letter-spacing: 0;
    padding: 4px;
  }
}
/* Align both identities before either board starts. */
.arena-header {
  flex-wrap: wrap;
  row-gap: 16px;
}
.arena-section-title {
  flex-wrap: wrap;
  gap: 14px;
}
.arena-friend {
  flex-wrap: wrap;
  row-gap: 12px;
}
.duel-result-source {
  line-height: 1.6;
}
.profile-duel-record > div {
  min-width: 0;
}
@media (max-width: 540px) {
  .arena-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px 10px;
  }
  .arena-header > .arena-brand {
    grid-column: 1 / -1;
  }
  .arena-header nav {
    grid-column: 1 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }
  .arena-header nav button {
    padding: 10px 8px;
  }
  .arena-back {
    grid-column: 1 / -1;
    justify-self: start;
    margin: 0;
  }
  .arena-how,
  .arena-friends {
    padding: 20px;
  }
  .arena-how article {
    gap: 14px;
  }
  .arena-how h4 {
    line-height: 1.5;
    margin-bottom: 8px;
  }
  .arena-friend > button {
    flex-basis: 100%;
  }
  .duel-player-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 150px;
  }
  .duel-player-heading .arena-avatar {
    grid-column: 1;
    grid-row: 1;
  }
  .duel-player-heading > div {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .duel-player-heading .duel-score {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    margin: 0;
  }
  .duel-side-label {
    display: block;
    min-height: 2.6em;
    line-height: 1.3;
  }
  .duel-player-heading h3 {
    min-height: 2.3em;
    line-height: 1.15;
    margin: 5px 0;
  }
  .duel-player-heading small {
    line-height: 1.4;
  }
  .duel-board-label {
    min-height: 3.2em;
    line-height: 1.5;
  }
  .duel-live-footer {
    padding: 16px;
    gap: 12px;
  }
  .duel-result-player {
    min-width: 0;
  }
}
@media (max-width: 540px) {
  .duel-live-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
    gap: 12px;
  }
  .duel-live-header > .duel-clock-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 14px;
    align-items: center;
    text-align: left;
  }
  .duel-live-header .duel-clock-wrap > strong {
    grid-column: 1;
    grid-row: 1 / 3;
    margin: 0;
  }
  .duel-live-header .duel-clock-wrap > span {
    grid-column: 2;
    grid-row: 1;
  }
  .duel-live-header .duel-clock-wrap > small {
    grid-column: 2;
    grid-row: 2;
    width: fit-content;
  }
  .duel-live-header > .duel-skills {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .duel-live-header .duel-skills button {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    padding: 8px;
    min-height: 50px;
  }
  .duel-live-header .duel-skills button > span {
    width: 20px;
    height: 22px;
  }
  .duel-live-header .duel-skills strong {
    line-height: 1.3;
  }
  .duel-live-header .duel-skills b {
    margin: 0;
  }
  .duel-player-heading small {
    min-height: 2.8em;
  }
  .duel-board-label {
    min-height: 4.8em;
  }
  .duel-energy-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: 38px;
  }
}
