:root {
  --bg: #f4f6f0;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #69716b;
  --line: #d6ddd4;
  --green: #168f57;
  --green-dark: #0d683e;
  --amber: #f2b84b;
  --red: #e35b53;
  --blue: #4f78d8;
  --shadow: 0 14px 38px rgba(20, 36, 26, .14);
  --adaptive-ad-height: 50px;
  --bottom-ad-background-strip: max(10px, env(safe-area-inset-bottom));
  --global-ad-space: calc(var(--adaptive-ad-height) + var(--bottom-ad-background-strip) + 16px);
  --title-outline:
    1px 0 #5b3912,
    -1px 0 #5b3912,
    0 1px #5b3912,
    0 -1px #5b3912,
    1px 1px #5b3912,
    -1px 1px #5b3912,
    1px -1px #5b3912,
    -1px -1px #5b3912,
    0 3px 0 rgba(82, 48, 13, .36),
    0 0 14px rgba(255, 230, 150, .55);
}

* { box-sizing: border-box; }

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(22,143,87,.08), transparent 38%),
    var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.mandatory-update-screen {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding:
    max(24px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  background:
    linear-gradient(rgba(255, 255, 255, .74), rgba(244, 250, 247, .86)),
    url("assets/title/title-bg-soft-green-20260630.webp?v=20260630-title-bg-01") center / cover no-repeat;
}

.mandatory-update-screen[hidden] {
  display: none;
}

.mandatory-update-card {
  width: min(100%, 420px);
  padding: 34px 24px 28px;
  border: 1px solid rgba(18, 101, 70, .2);
  border-radius: 20px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 48px rgba(10, 55, 40, .18);
  color: var(--ink);
  text-align: center;
}

.mandatory-update-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  line-height: 62px;
}

.mandatory-update-card h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
}

.mandatory-update-card p {
  margin: 16px 0 26px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.8;
}

.mandatory-update-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #1aa86a, #087947);
  box-shadow: 0 6px 14px rgba(8, 121, 71, .24);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.mandatory-update-button:active {
  transform: translateY(1px);
}

button, input { font: inherit; }

button:not(.cell):not(.home-character):not(:disabled):not([aria-disabled="true"]) {
  transition: translate 90ms ease-out, scale 90ms ease-out, box-shadow 90ms ease-out, filter 90ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

button:not(.cell):not(.home-character):not(:disabled):not([aria-disabled="true"]):active {
  translate: 0 4px;
  scale: .965;
  box-shadow: 0 2px 5px rgba(12,45,72,.18), inset 0 5px 12px rgba(4,24,58,.3);
  filter: brightness(.88) saturate(1.1);
}

.app {
  position: relative;
  width: min(100%, 480px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(155deg, #fff 0%, #fffdf8 48%, #f8f3e8 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.05);
}

/* Keep the display-cutout and gesture-navigation safe areas visually separate
   from the app canvas and the native AdMob banner. */
.app::before,
.app::after {
  content: "";
  position: absolute;
  z-index: 1000;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.app::before {
  top: 0;
  height: env(safe-area-inset-top);
  background: #000;
}

.app::after {
  bottom: 0;
  height: var(--bottom-ad-background-strip);
  background: transparent;
}

html.ui-confirmation-app {
  --bottom-ad-background-strip: env(safe-area-inset-bottom);
}

html.ui-confirmation-app {
  --adaptive-ad-height: 0px;
  --global-ad-space: calc(var(--bottom-ad-background-strip) + 16px);
}

html.ui-confirmation-app .app::after {
  background: #000;
}

html.ui-confirmation-app .app::after {
  background: transparent;
}

/* UI-confirmation device preview: retain the Xiaomi 13T 393 x 873 CSS canvas
   and fit it proportionally into a centered 320 x 568 minimum-phone frame.
   Only the frame's unused width continues the decorative Reversi background;
   everything outside that simulated device remains black. */
html.ui-confirmation-app.ui-minimum-phone-preview,
html.ui-confirmation-app.ui-minimum-phone-preview body {
  background: #000;
}

html.ui-confirmation-app.ui-minimum-phone-preview .app {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 393px;
  max-width: none;
  height: 873px;
  min-height: 873px;
  margin: 0;
  z-index: 1;
  transform: translate(-50%, -50%) scale(.65063);
  transform-origin: center center;
  background: transparent;
  box-shadow: none;
}

html.ui-confirmation-app.ui-minimum-phone-preview .app {
  padding-top: 0;
}

html.ui-confirmation-app.ui-minimum-phone-preview .app::before,
html.ui-confirmation-app.ui-minimum-phone-preview .app::after {
  display: none;
}

html.ui-confirmation-app.ui-minimum-phone-preview .app > .home-piece-flow,
html.ui-confirmation-app.ui-minimum-phone-preview .app > .home-piece-veil {
  display: none;
}

html.ui-confirmation-app.ui-minimum-phone-preview .minimum-phone-preview-backdrop {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 568px;
  z-index: 0;
  display: block;
  overflow: hidden;
  contain: strict;
  transform: translate(-50%, -50%);
  background: linear-gradient(155deg, #fff 0%, #fffdf8 48%, #f8f3e8 100%);
  pointer-events: none;
}

html.ui-confirmation-app.ui-minimum-phone-preview body.title-mode .minimum-phone-preview-backdrop {
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.02) 52%, rgba(255,255,255,.18)),
    url("assets/title/title-bg-soft-green-20260630.webp?v=20260630-title-bg-01") center / cover no-repeat;
}

html.ui-confirmation-app.ui-minimum-phone-preview body.title-mode .title-screen {
  background: transparent;
}

html.ui-confirmation-app.ui-minimum-phone-preview body.title-mode .title-screen::before,
html.ui-confirmation-app.ui-minimum-phone-preview body.title-mode .title-screen::after {
  display: none;
}

html.ui-confirmation-app.ui-minimum-phone-preview body.title-mode
  .minimum-phone-preview-backdrop > .home-floating-piece {
  display: none;
}

html.ui-confirmation-app.ui-minimum-phone-preview .minimum-phone-preview-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 14% at 50% 7%, rgba(255, 253, 247, .46), transparent 76%),
    radial-gradient(ellipse 28% 19% at 31% 36%, rgba(255, 253, 247, .42), transparent 74%);
  pointer-events: none;
}

html.ui-confirmation-app.ui-minimum-phone-preview .minimum-phone-preview-overlay-extension {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 568px;
  z-index: 0;
  display: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

html.ui-confirmation-app.ui-minimum-phone-preview body:has(.result-overlay:not([hidden]))
  .minimum-phone-preview-overlay-extension {
  display: block;
  background: linear-gradient(
    to right,
    rgba(5, 10, 9, .76) 0 32.14px,
    transparent 32.14px 287.86px,
    rgba(5, 10, 9, .76) 287.86px 320px
  );
}

html.ui-confirmation-app.ui-minimum-phone-preview body:has(.resign-confirm:not([hidden]))
  .minimum-phone-preview-overlay-extension {
  display: block;
  background: linear-gradient(
    to right,
    rgba(8, 18, 14, .48) 0 32.14px,
    transparent 32.14px 287.86px,
    rgba(8, 18, 14, .48) 287.86px 320px
  );
}

html.ui-confirmation-app.ui-minimum-phone-preview body:has(dialog[open])
  .minimum-phone-preview-overlay-extension {
  display: block;
  background: linear-gradient(
    to right,
    rgba(4, 15, 11, .58) 0 32.14px,
    transparent 32.14px 287.86px,
    rgba(4, 15, 11, .58) 287.86px 320px
  );
}

html.ui-confirmation-app.ui-minimum-phone-preview body.title-mode
  .minimum-phone-preview-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 16%, rgba(255,255,255,.72), transparent 28%),
    radial-gradient(circle at 50% 96%, rgba(16,143,87,.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0) 36%);
  pointer-events: none;
}

html.ui-confirmation-app.ui-minimum-phone-preview body.title-mode
  .minimum-phone-preview-backdrop::after {
  inset: auto 12% 10% 12%;
  height: 130px;
  background:
    radial-gradient(ellipse, rgba(255,255,255,.38), transparent 62%),
    linear-gradient(90deg, transparent, rgba(22,143,87,.12), transparent);
  filter: blur(16px);
}

.topbar {
  display: none;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #151918;
  color: #f8faf5;
  outline: 2px solid #f8faf5;
  box-shadow: 0 0 0 3px #151918;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}

.brand p {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
}

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
}

main {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
}

body.title-mode main {
  padding: 0;
}

body.title-mode .app {
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.02) 52%, rgba(255,255,255,.18)),
    url("assets/title/title-bg-soft-green-20260630.webp?v=20260630-title-bg-01") center / cover no-repeat;
}

body.title-mode .topbar {
  display: none;
}

body.character-setup-mode main {
  padding: 0;
}

body.character-setup-mode .topbar {
  display: none;
}

body.menu-mode main {
  padding: 0;
}

body.menu-mode .topbar {
  display: none;
}

body.setup-mode main,
body.game-mode main {
  padding: 0;
}

body.my-page-mode main {
  padding: 0;
}

body.friend-flow-mode main {
  padding: 0;
}

body.friend-flow-mode .app {
  padding-top: 0;
}

body.my-page-mode .topbar {
  display: none;
}

.ai-setup-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  height: 100%;
  min-height: 0;
  padding: 34px 14px 14px;
  background: transparent;
  overflow: hidden;
}

.ai-setup-title {
  width: min(100%, 460px);
  margin: 0 auto;
  text-align: center;
}

.ai-setup-title h2 {
  margin: 0;
  color: #168b55;
  font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Sans", sans-serif;
  font-size: clamp(34px, 9.2vw, 46px);
  font-weight: 900;
  line-height: 1.08;
  -webkit-text-stroke: 2.2px #111;
  paint-order: stroke fill;
  text-shadow: none;
}

.ai-setup-title h2#setupTitle,
.shop-heading h2,
.settings-page > h2,
.mission-panel > h2,
.outfit-panel > h2,
.gacha-topbar h2 {
  color: #0b6845;
  background: linear-gradient(180deg, #249b65 0%, #075f40 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0;
  paint-order: normal;
  font-weight: 950;
  letter-spacing: .025em;
  text-shadow: 2px 3px 5px rgba(7, 79, 51, .2);
}

.ai-setup-title p {
  margin-top: 8px;
  color: #111;
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 900;
  line-height: 1.35;
  text-shadow: none;
}

.ai-level-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  width: min(100%, 680px);
  min-height: 0;
  margin: 0 auto;
  padding: 12px;
  border: 2px solid rgba(21, 58, 45, .22);
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 26px rgba(22,55,38,.1);
}

.ai-level-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border: 2px solid rgba(8, 105, 65, .42);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
}

.ai-level-summary span {
  color: #fff;
  font-size: clamp(13px, 3.5vw, 15px);
  font-weight: 800;
  opacity: 1;
}

.ai-level-summary strong {
  font-size: 20px;
  line-height: 1;
}

.ai-level-groups {
  display: grid;
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding-right: 16px;
}

.ai-level-scroll-shell {
  min-height: 0;
}

.ai-level-group h3 {
  margin: 0 0 6px;
  color: #184332;
  font-size: 15px;
  line-height: 1;
}

.ai-level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.ai-level-secret-grid {
  grid-template-columns: 1fr;
}

.ai-level-btn {
  position: relative;
  min-height: 38px;
  border: 2px solid rgba(18, 93, 69, .32);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #edf5ef);
  color: #143d2f;
  font-size: 16px;
  font-weight: 900;
}

.ai-level-btn span {
  display: block;
}

.ai-level-btn small {
  display: none;
}

.ai-level-btn.is-selected {
  border-color: rgba(255,255,255,.8);
  background: linear-gradient(180deg, #1a9f60, #0b6f48);
  color: #fff;
  box-shadow: 0 8px 16px rgba(15, 83, 56, .22), inset 0 1px 0 rgba(255,255,255,.35);
}

.ai-level-secret-btn {
  min-height: 54px;
  border-color: rgba(255, 221, 126, .85);
  background: linear-gradient(180deg, #1b2535, #090d18);
  color: #ffe08a;
  box-shadow:
    0 10px 22px rgba(6, 11, 22, .22),
    inset 0 1px 0 rgba(255,255,255,.2);
}

.ai-level-secret-btn small {
  display: block;
  margin-top: 3px;
  color: #fff2bd;
  font-size: 10px;
  opacity: .88;
}

.ai-level-secret-btn.is-selected {
  border-color: rgba(255,255,255,.9);
  background: linear-gradient(180deg, #c59b35, #5d3909);
  color: #fff;
  box-shadow:
    0 10px 24px rgba(83, 49, 7, .28),
    inset 0 1px 0 rgba(255,255,255,.35);
}

.ai-level-btn.is-cleared::after {
  content: "✓";
  position: absolute;
  right: -5px;
  top: -6px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f2b84b;
  color: #183d31;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(63, 39, 8, .24);
}

.ai-level-btn.is-cleared small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  line-height: 1;
  opacity: .74;
}

.ai-side-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-side-btn {
  min-height: 46px;
  padding: 8px 10px;
  border: 2px solid rgba(21, 58, 45, .2);
  border-radius: 8px;
  background: rgba(248, 251, 246, .9);
  color: #173d30;
  font-size: 13px;
  font-weight: 900;
}

.ai-side-btn.is-selected {
  border-color: #b77813;
  background: linear-gradient(180deg, #ffd873, #e7aa32);
  color: #342508;
  box-shadow: 0 8px 16px rgba(130, 82, 10, .24), inset 0 1px 0 rgba(255,255,255,.52);
}

.ai-setup-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: min(100%, 680px);
  margin: 0 auto;
}

.ai-setup-actions .primary-btn,
.ai-setup-actions .secondary-btn {
  min-height: 54px;
  border: 2px solid #000;
}

html.ui-confirmation-app #setupHomeBtn {
  background: #fff;
}

#gameView {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "opponent resign"
    "opponent-message opponent-message"
    "board board"
    "message message"
    "player player"
    "ad ad";
  grid-template-rows: auto auto auto auto auto auto;
  align-content: start;
  gap: 8px;
  height: 100%;
  min-height: 0;
  padding: 10px 14px 12px;
  background: transparent;
  overflow: hidden;
}

.view {
  display: none;
  height: 100%;
  min-height: 0;
}

.view:not(.view-active) { display: none !important; }

.view-active { display: block; }

#gameView.view-active { display: grid; }

.custom-scroll-shell {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.custom-scroll-target {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.custom-scroll-target::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.custom-scrollbar {
  position: absolute;
  top: 5px;
  right: 3px;
  bottom: 5px;
  z-index: 6;
  display: block;
  width: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 143, 91, .15);
  box-shadow: inset 0 0 0 1px rgba(11, 104, 69, .08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.custom-scrollbar.is-scrollable {
  opacity: 1;
  visibility: visible;
}

.custom-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  min-height: 36px;
  border-radius: inherit;
  background: linear-gradient(180deg, #1aa667, #08764c);
  box-shadow: 0 2px 5px rgba(5, 84, 52, .24);
  will-change: height, transform;
}

.title-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  height: 100%;
  min-height: 0;
  padding: clamp(82px, 15vh, 132px) 14px 32px;
  overflow: hidden;
  text-align: center;
  color: #153d2f;
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.02) 52%, rgba(255,255,255,.18)),
    url("assets/title/title-bg-soft-green-20260630.webp?v=20260630-title-bg-01") center / cover no-repeat;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.title-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 16%, rgba(255,255,255,.72), transparent 28%),
    radial-gradient(circle at 50% 96%, rgba(16,143,87,.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0) 36%);
  pointer-events: none;
}

.title-screen::after {
  content: "";
  position: absolute;
  inset: auto 12% 10% 12%;
  height: 130px;
  background:
    radial-gradient(ellipse, rgba(255,255,255,.38), transparent 62%),
    linear-gradient(90deg, transparent, rgba(22,143,87,.12), transparent);
  filter: blur(16px);
  pointer-events: none;
}

.title-orbit {
  display: none;
  position: relative;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  box-shadow: inset 0 0 36px rgba(255,255,255,.08), 0 0 48px rgba(22,143,87,.28);
}

.title-orbit::before,
.title-orbit::after {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
}

.title-orbit::after {
  inset: 58px;
}

.title-disc {
  position: absolute;
  display: block;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(0,0,0,.28);
}

.title-disc.black-disc {
  left: 28px;
  top: 62px;
  background: radial-gradient(circle at 30% 26%, #666, #111 58%, #000);
}

.title-disc.white-disc {
  right: 28px;
  top: 62px;
  background: radial-gradient(circle at 30% 26%, #fff, #e8eee8 60%, #bfc8bf);
}

.title-logo {
  z-index: 1;
  width: min(94%, 470px);
  margin-top: 0;
  padding: 0 10px;
}

.title-logo img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.title-logo h2 {
  margin: 0;
  color: #fff2bd;
  font-family: "Meiryo", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  font-size: clamp(39px, 10.5vw, 52px);
  font-weight: 800;
  line-height: 1.04;
  white-space: nowrap;
  letter-spacing: 0;
  text-shadow: var(--title-outline);
  -webkit-text-stroke: 0 transparent;
}

.title-logo p {
  display: inline-block;
  max-width: min(100%, 430px);
  margin-top: 14px;
  padding: 0 4px;
  color: rgba(255,255,255,.98);
  font-size: clamp(14px, 3.8vw, 20px);
  font-weight: 900;
  line-height: 1.46;
  text-shadow:
    0 2px 8px rgba(0,0,0,.62),
    0 0 16px rgba(14,87,65,.55),
    0 0 28px rgba(255,239,185,.36);
}

.title-start {
  z-index: 1;
  margin-top: auto;
  margin-bottom: clamp(34px, 8vh, 70px);
  border: 0;
  background: transparent;
  color: rgba(17, 67, 50, .94);
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: none;
  text-shadow:
    0 1px 0 rgba(255,255,255,.92),
    0 0 18px rgba(255,255,255,.84),
    0 8px 18px rgba(22, 72, 52, .16);
  pointer-events: none;
  animation: titleStartPulse 2.25s ease-in-out infinite;
}

.title-start.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: clamp(26px, 7.2vw, 38px);
  opacity: 1;
  animation: none;
}

.title-start.is-loading::before {
  content: "";
  width: 0.9em;
  height: 0.9em;
  border: 3px solid rgba(22, 139, 85, 0.22);
  border-top-color: #168b55;
  border-radius: 50%;
  animation: titleLoadingSpin 0.72s linear infinite;
}

@keyframes titleLoadingSpin {
  to { transform: rotate(360deg); }
}

@keyframes titleStartPulse {
  0%, 100% {
    opacity: .38;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.title-links {
  z-index: 1;
  display: flex;
  gap: 14px;
  margin-top: 20px;
}

.title-links button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  font-size: 12px;
}

.hero-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #193126, #0f5d3a);
  box-shadow: var(--shadow);
}

.record {
  min-height: 70px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  color: #fff;
}

.record span {
  display: block;
  font-size: 12px;
  opacity: .8;
}

.record strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.home-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  height: 100%;
  min-height: 0;
  padding: 10px 14px 10px;
  background: transparent;
  overflow: hidden;
}

.home-piece-flow,
.home-piece-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  touch-action: none;
}

.app > .home-piece-flow {
  z-index: 0;
}

.app > .home-piece-veil {
  z-index: 1;
}

.app > .topbar,
.app > main {
  position: relative;
  z-index: 2;
}

body.title-mode .app > .home-piece-flow,
body.title-mode .app > .home-piece-veil {
  display: none;
}

.home-piece-flow {
  z-index: 0;
  overflow: hidden;
  contain: strict;
}

.home-piece-veil {
  z-index: 1;
  background:
    radial-gradient(ellipse 45% 14% at 50% 7%, rgba(255, 253, 247, .46), transparent 76%),
    radial-gradient(ellipse 28% 19% at 31% 36%, rgba(255, 253, 247, .42), transparent 74%);
}

.home-floating-piece {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--piece-size);
  height: var(--piece-size);
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
  animation: home-piece-drift var(--flow-duration) linear var(--flow-delay) infinite;
}

.home-floating-piece::before,
.home-floating-piece::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.home-floating-piece::before {
  background:
    radial-gradient(circle at 34% 27%, rgba(255,255,255,.7), rgba(35,38,36,.88) 31%, #050606 76%);
  box-shadow: 0 5px 11px rgba(12, 17, 14, .34);
}

.home-floating-piece::after {
  background:
    radial-gradient(circle at 34% 27%, #fff, #f4f2eb 57%, #cfcac0 100%);
  box-shadow:
    inset 0 0 0 2px rgba(55, 62, 58, .32),
    0 5px 11px rgba(12, 17, 14, .28);
  transform: rotateY(180deg);
}

.home-floating-piece-white {
  transform-style: preserve-3d;
}

.home-floating-piece-white::before {
  transform: rotateY(180deg);
}

.home-floating-piece-white::after {
  transform: rotateY(0);
}

@keyframes home-piece-drift {
  0% {
    opacity: 0;
    transform: translate3d(var(--start-x), var(--start-y), 0) rotate(-8deg);
  }
  7% {
    opacity: .14;
  }
  46% {
    opacity: .14;
  }
  54% {
    opacity: .09;
  }
  62% {
    opacity: .14;
  }
  92% {
    opacity: .14;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--end-x), var(--end-y), 0) rotate(11deg);
  }
}

.home-title,
.home-main,
.home-utility-grid {
  position: relative;
  z-index: 3;
}

.home-title {
  position: relative;
  z-index: 4;
  width: min(96%, 455px);
  margin: 0 auto -8px;
  padding: 0 4px;
  text-align: center;
}

.home-title img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

#homeLogoToggle {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#homeLogoToggle:focus-visible {
  outline: 3px solid rgba(218, 174, 64, .88);
  outline-offset: 3px;
  border-radius: 10px;
}

.home-screen.home-controls-hidden .home-right-column,
.home-screen.home-controls-hidden .home-utility-grid {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.home-title h2 {
  margin: 0;
  color: #fff1b8;
  font-family: "Meiryo", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  font-size: clamp(39px, 10.5vw, 52px);
  font-weight: 800;
  line-height: 1.04;
  white-space: nowrap;
  text-shadow: var(--title-outline);
  -webkit-text-stroke: 0 transparent;
}

.title-logo h2,
.home-title h2 {
  color: #168b55;
  background: none;
  font-family: "Arial Black", "Noto Sans JP", "Meiryo", sans-serif;
  -webkit-text-fill-color: #168b55;
  -webkit-text-stroke: 2.8px #111;
  paint-order: stroke fill;
  letter-spacing: 0;
  text-shadow: none;
  filter: none;
}

.title-logo p,
.home-title p,
.character-setup-title p {
  max-width: 390px;
  margin: 8px auto 0;
  color: #111;
  font-size: clamp(13px, 3.5vw, 17px);
  font-weight: 900;
  line-height: 1.42;
  -webkit-text-stroke: 0;
  paint-order: stroke fill;
  text-shadow: none;
}

.home-main {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(128px, .82fr);
  align-items: stretch;
  gap: 12px;
  width: min(100%, 680px);
  min-height: 0;
  margin: 0 auto;
  padding-bottom: 10px;
  box-sizing: border-box;
  overflow: visible;
}

.home-left-column,
.home-right-column {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.home-screen .home-right-column {
  position: relative;
  z-index: 3;
  align-content: center;
  gap: 14px;
}

.home-left-column {
  position: relative;
  z-index: 1;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
}

.home-character {
  position: relative;
  display: grid;
  align-items: end;
  justify-items: center;
  height: 100%;
  min-height: 0;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-character img {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 50%;
  display: block;
  width: auto;
  height: calc(100% - 14px);
  max-width: var(--home-character-width, 138%);
  max-height: calc(100% - 14px);
  margin: auto 0;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(calc(-50% + var(--home-character-shift-x, 0px)));
  filter: drop-shadow(0 18px 22px rgba(0,0,0,.18));
}

/*
 * Home portraits have very different transparent margins.
 * Size each outfit from its visible alpha bounds instead of sharing a width cap.
 */
.home-character img[data-character] {
  top: var(--home-portrait-top, var(--sena-home-top, 0%));
  bottom: auto;
  z-index: 1;
  width: auto;
  height: min(var(--home-portrait-height, var(--sena-home-height, 100%)), var(--home-wide-height-limit, 9999px));
  max-width: none;
  max-height: none;
  margin: 0;
  pointer-events: none;
  left: -14px;
  transform: translateX(var(--home-alpha-left-shift, 0px));
}

/* UI-confirmation character gacha portraits: keep wide auras intact and center narrow art in the free column. */
.home-character img[data-character="ui-gacha-character-1"] { --home-portrait-height: 100%; --home-alpha-left-shift: -2%; }
.home-character img[data-character="ui-gacha-character-2"] { --home-portrait-height: 102%; --home-portrait-top: -.5%; --home-alpha-left-shift: -.43%; }
.home-character img[data-character="ui-gacha-character-3"] { --home-portrait-height: 100%; --home-alpha-left-shift: -5.1%; }
.home-character img[data-character="ui-gacha-character-4"] { --home-portrait-height: 104%; --home-portrait-top: -1.7%; left: calc(50% + 6px); transform: translateX(-48.05%); }
.home-character img[data-character="ui-gacha-character-5"] { --home-portrait-height: 108%; --home-portrait-top: -4%; left: calc(50% + 6px); transform: translateX(-47.82%); }
.home-character img[data-character="ui-gacha-character-6"] { --home-portrait-height: 100%; --home-alpha-left-shift: -3.19%; }
.home-character img[data-character="ui-gacha-character-7"] { --home-portrait-height: 100%; --home-alpha-left-shift: -3.29%; }
.home-character img[data-character="ui-gacha-character-8"] { --home-portrait-height: 101%; --home-portrait-top: -.5%; --home-alpha-left-shift: -6.56%; }

/* Dark outfits include a full-frame aura. Keep its upper edge below the logo
   while preserving roughly the same foot position as the default fit. */
.home-character img[data-character="ui-gacha-character-4"][data-outfit="ui-gacha-character-4-alternate"] { --home-portrait-height: 102.3%; --home-portrait-top: 0%; }
.home-character img[data-character="ui-gacha-character-5"][data-outfit="ui-gacha-character-5-alternate"] { --home-portrait-height: 104%; --home-portrait-top: 0%; left: calc(50% + 60px); }
.home-character img[data-character="ui-gacha-character-7"][data-outfit="ui-gacha-character-7-alternate"] { --home-portrait-height: 100%; --home-portrait-top: 0%; }
.home-character img[data-character="ui-gacha-character-8"][data-outfit="ui-gacha-character-8-alternate"] { --home-portrait-height: 100.5%; --home-portrait-top: 0%; }

.home-character img[data-character="rookie"][data-outfit="default"] { --home-character-width: 140%; }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-1"] { --home-character-width: 132%; }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-2"] { --home-character-width: 158%; }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-3"] { --home-character-width: 146%; }

.home-character img[data-character="sharp"][data-outfit="default"] { --sena-home-height: 101.30%; --sena-home-top: -0.25%; --home-character-shift-x: -0.29%; }
.home-character img[data-character="sharp"][data-outfit="sharp-mission-outfit-1"] { --sena-home-height: 101.09%; --sena-home-top: -0.58%; --home-character-shift-x: -2.49%; }
.home-character img[data-character="sharp"][data-outfit="sharp-mission-outfit-2"] { --sena-home-height: 100.89%; --sena-home-top: -0.31%; --home-character-shift-x: 0.10%; }
.home-character img[data-character="sharp"][data-outfit="sharp-mission-outfit-3"] { --sena-home-height: 101.02%; --sena-home-top: 0.08%; --home-character-shift-x: 0.68%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-1"] { --sena-home-height: 99.89%; --sena-home-top: -0.04%; --home-character-shift-x: -1.90%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-2"] { --sena-home-height: 101.37%; --sena-home-top: -0.52%; --home-character-shift-x: 0.39%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-3"] { --sena-home-height: 99.95%; --sena-home-top: -0.04%; --home-character-shift-x: 0.63%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-4"] { --sena-home-height: 100.69%; --sena-home-top: -0.25%; --home-character-shift-x: 0.54%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-5"] { --sena-home-height: 101.09%; --sena-home-top: -0.18%; --home-character-shift-x: -2.34%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-6"] { --sena-home-height: 101.78%; --sena-home-top: -0.46%; --home-character-shift-x: -0.39%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-7"] { --sena-home-height: 101.37%; --sena-home-top: -0.39%; --home-character-shift-x: -2.25%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-8"] { --sena-home-height: 100.15%; --sena-home-top: -0.30%; --home-character-shift-x: -0.59%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-9"] { --sena-home-height: 99.29%; --sena-home-top: 0.09%; --home-character-shift-x: -0.34%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-10"] { --sena-home-height: 100.82%; --sena-home-top: -0.05%; --home-character-shift-x: -5.13%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-11"] { --sena-home-height: 101.23%; --sena-home-top: -0.32%; --home-character-shift-x: 0.78%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-12"] { --sena-home-height: 100.69%; --sena-home-top: -0.25%; --home-character-shift-x: -0.88%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-13"] { --sena-home-height: 101.85%; --sena-home-top: -0.66%; --home-character-shift-x: -3.91%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-14"] { --sena-home-height: 99.03%; --sena-home-top: -0.03%; --home-character-shift-x: -1.51%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-15"] { --sena-home-height: 101.30%; --sena-home-top: -0.25%; --home-character-shift-x: 0.15%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-16"] { --sena-home-height: 101.57%; --sena-home-top: -0.32%; --home-character-shift-x: -2.69%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-rare-1"] { --sena-home-height: 103.51%; --sena-home-top: -0.99%; --home-character-shift-x: 2.20%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-rare-2"] { --sena-home-height: 100.62%; --sena-home-top: 0.34%; --home-character-shift-x: -3.42%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-rare-3"] { --sena-home-height: 99.69%; --sena-home-top: 0.16%; --home-character-shift-x: 0%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-super-1"] { --sena-home-height: 114.57%; --sena-home-top: -0.35%; --home-character-shift-x: 0.15%; }

.home-character img[data-character="kaito"][data-outfit="default"] { --home-character-width: 150%; }
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-1"] { --home-character-width: 132%; }
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-2"] { --home-character-width: 130%; }
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-3"] { --home-character-width: 112%; }

.home-character img[data-character="mellow"][data-outfit="default"] { --home-character-width: 140%; }
.home-character img[data-character="mellow"][data-outfit^="mellow-mission-outfit-"] { --home-character-width: 132%; }

.home-character img[data-character="genji"] { --home-character-width: 112%; }
.home-character img[data-character="genji"][src*="yura-online-100-default"] { --home-character-width: 140%; }

.home-character img[data-character="rookie"][data-outfit="default"] { --home-portrait-height: 100.53%; --home-portrait-top: -0.44%; --home-character-shift-x: -0.16%; }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-1"] { --home-portrait-height: 100.71%; --home-portrait-top: -0.26%; --home-character-shift-x: 0.64%; }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-2"] { --home-portrait-height: 100.59%; --home-portrait-top: -0.38%; --home-character-shift-x: -0.27%; }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-3"] { --home-portrait-height: 100.46%; --home-portrait-top: -0.56%; --home-character-shift-x: -1.33%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-1"] { --home-portrait-height: 100.65%; --home-portrait-top: -0.99%; --home-character-shift-x: 0.96%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-2"] { --home-portrait-height: 100.53%; --home-portrait-top: -0.62%; --home-character-shift-x: 0.69%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-3"] { --home-portrait-height: 99.67%; --home-portrait-top: -0.25%; --home-character-shift-x: -4.04%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-4"] { --home-portrait-height: 100.46%; --home-portrait-top: 0.46%; --home-character-shift-x: -1.06%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-5"] { --home-portrait-height: 100.22%; --home-portrait-top: -0.38%; --home-character-shift-x: -1.91%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-6"] { --home-portrait-height: 104.50%; --home-portrait-top: -2.38%; --home-character-shift-x: -2.34%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-7"] { --home-portrait-height: 99.73%; --home-portrait-top: -0.01%; --home-character-shift-x: -2.44%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-8"] { --home-portrait-height: 100.46%; --home-portrait-top: -0.20%; --home-character-shift-x: 0.27%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-9"] { --home-portrait-height: 102.92%; --home-portrait-top: -0.23%; --home-character-shift-x: -2.66%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-10"] { --home-portrait-height: 100.96%; --home-portrait-top: -0.57%; --home-character-shift-x: -1.38%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-11"] { --home-portrait-height: 100.40%; --home-portrait-top: -0.62%; --home-character-shift-x: -1.28%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-12"] { --home-portrait-height: 100.28%; --home-portrait-top: -0.38%; --home-character-shift-x: 0.80%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-13"] { --home-portrait-height: 100.16%; --home-portrait-top: -0.44%; --home-character-shift-x: -1.86%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-14"] { --home-portrait-height: 100.46%; --home-portrait-top: -0.38%; --home-character-shift-x: 0.96%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-15"] { --home-portrait-height: 104.37%; --home-portrait-top: -2.12%; --home-character-shift-x: -1.01%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-16"] { --home-portrait-height: 100.46%; --home-portrait-top: -0.32%; --home-character-shift-x: -2.13%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-rare-1"] { --home-portrait-height: 103.12%; --home-portrait-top: -1.28%; --home-character-shift-x: 0.00%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-rare-2"] { --home-portrait-height: 101.58%; --home-portrait-top: -0.58%; --home-character-shift-x: 0.74%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-rare-3"] { --home-portrait-height: 101.08%; --home-portrait-top: -0.63%; --home-character-shift-x: -1.59%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-super-1"] { --home-portrait-height: 119.60%; --home-portrait-top: -10.80%; --home-character-shift-x: -0.90%; }
.home-character img[data-character="kaito"][data-outfit="default"] { --home-portrait-height: 101.77%; --home-portrait-top: -1.19%; --home-character-shift-x: -3.45%; }
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-1"] { --home-portrait-height: 102.82%; --home-portrait-top: -2.36%; --home-character-shift-x: -0.69%; }
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-2"] { --home-portrait-height: 99.49%; --home-portrait-top: 0.61%; --home-character-shift-x: 5.52%; }
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-3"] { --home-portrait-height: 100.53%; --home-portrait-top: -0.14%; --home-character-shift-x: -1.70%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-1"] { --home-portrait-height: 99.49%; --home-portrait-top: -0.37%; --home-character-shift-x: 0.43%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-2"] { --home-portrait-height: 101.27%; --home-portrait-top: -0.88%; --home-character-shift-x: -1.59%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-3"] { --home-portrait-height: 104.37%; --home-portrait-top: -1.12%; --home-character-shift-x: -2.07%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-4"] { --home-portrait-height: 103.31%; --home-portrait-top: -0.92%; --home-character-shift-x: -5.10%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-5"] { --home-portrait-height: 102.86%; --home-portrait-top: -1.46%; --home-character-shift-x: -5.37%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-6"] { --home-portrait-height: 100.03%; --home-portrait-top: -0.68%; --home-character-shift-x: -2.76%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-7"] { --home-portrait-height: 105.71%; --home-portrait-top: -2.73%; --home-character-shift-x: 1.86%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-8"] { --home-portrait-height: 100.83%; --home-portrait-top: -0.57%; --home-character-shift-x: -0.53%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-9"] { --home-portrait-height: 103.38%; --home-portrait-top: -1.23%; --home-character-shift-x: -6.43%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-10"] { --home-portrait-height: 103.77%; --home-portrait-top: -1.48%; --home-character-shift-x: -0.85%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-11"] { --home-portrait-height: 101.52%; --home-portrait-top: 0.03%; --home-character-shift-x: -2.55%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-12"] { --home-portrait-height: 102.41%; --home-portrait-top: -0.72%; --home-character-shift-x: 4.68%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-13"] { --home-portrait-height: 102.86%; --home-portrait-top: -0.23%; --home-character-shift-x: 0.11%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-14"] { --home-portrait-height: 105.78%; --home-portrait-top: -3.49%; --home-character-shift-x: -5.84%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-15"] { --home-portrait-height: 101.33%; --home-portrait-top: -1.36%; --home-character-shift-x: 1.17%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-16"] { --home-portrait-height: 101.27%; --home-portrait-top: -1.30%; --home-character-shift-x: -2.98%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-rare-1"] { --home-portrait-height: 102.35%; --home-portrait-top: -1.14%; --home-character-shift-x: 1.06%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-rare-2"] { --home-portrait-height: 100.59%; --home-portrait-top: -0.80%; --home-character-shift-x: 0.00%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-rare-3"] { --home-portrait-height: 101.02%; --home-portrait-top: -0.39%; --home-character-shift-x: -0.48%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-super-1"] { --home-portrait-height: 119.60%; --home-portrait-top: -9.01%; --home-character-shift-x: -1.22%; }
.home-character img[data-character="mellow"][data-outfit="default"] { --home-portrait-height: 102.54%; --home-portrait-top: -1.21%; --home-character-shift-x: 1.54%; }
.home-character img[data-character="mellow"][data-outfit="mellow-mission-outfit-1"] { --home-portrait-height: 106.26%; --home-portrait-top: -3.77%; --home-character-shift-x: -0.27%; }
.home-character img[data-character="mellow"][data-outfit="mellow-mission-outfit-2"] { --home-portrait-height: 104.37%; --home-portrait-top: -2.81%; --home-character-shift-x: -2.28%; }
.home-character img[data-character="mellow"][data-outfit="mellow-mission-outfit-3"] { --home-portrait-height: 107.38%; --home-portrait-top: -4.39%; --home-character-shift-x: 2.28%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-1"] { --home-portrait-height: 102.99%; --home-portrait-top: -1.59%; --home-character-shift-x: -2.82%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-2"] { --home-portrait-height: 104.97%; --home-portrait-top: -3.39%; --home-character-shift-x: 2.23%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-3"] { --home-portrait-height: 105.99%; --home-portrait-top: -3.37%; --home-character-shift-x: 0.69%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-4"] { --home-portrait-height: 108.66%; --home-portrait-top: -3.16%; --home-character-shift-x: 4.99%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-5"] { --home-portrait-height: 103.84%; --home-portrait-top: -1.73%; --home-character-shift-x: 0.16%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-6"] { --home-portrait-height: 108.30%; --home-portrait-top: -6.25%; --home-character-shift-x: 3.08%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-7"] { --home-portrait-height: 105.44%; --home-portrait-top: -4.30%; --home-character-shift-x: -0.96%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-8"] { --home-portrait-height: 107.38%; --home-portrait-top: -4.91%; --home-character-shift-x: 0.69%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-9"] { --home-portrait-height: 108.51%; --home-portrait-top: -4.71%; --home-character-shift-x: -0.58%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-10"] { --home-portrait-height: 108.66%; --home-portrait-top: -2.70%; --home-character-shift-x: -5.15%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-11"] { --home-portrait-height: 106.82%; --home-portrait-top: -4.43%; --home-character-shift-x: 3.29%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-12"] { --home-portrait-height: 103.90%; --home-portrait-top: -2.05%; --home-character-shift-x: 0.27%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-13"] { --home-portrait-height: 112.38%; --home-portrait-top: -8.21%; --home-character-shift-x: -2.39%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-14"] { --home-portrait-height: 104.50%; --home-portrait-top: -4.25%; --home-character-shift-x: 1.22%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-15"] { --home-portrait-height: 104.43%; --home-portrait-top: -3.93%; --home-character-shift-x: -5.15%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-16"] { --home-portrait-height: 114.58%; --home-portrait-top: -9.28%; --home-character-shift-x: -3.83%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-rare-1"] { --home-portrait-height: 113.95%; --home-portrait-top: -4.86%; --home-character-shift-x: -0.80%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-rare-2"] { --home-portrait-height: 119.43%; --home-portrait-top: -9.21%; --home-character-shift-x: 1.86%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-rare-3"] { --home-portrait-height: 105.51%; --home-portrait-top: -1.97%; --home-character-shift-x: 0.43%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-super-1"] { --home-portrait-height: 130.04%; --home-portrait-top: -11.25%; --home-character-shift-x: -0.43%; }
.home-character img[data-character="genji"][data-outfit="default"] { --home-portrait-height: 99.57%; --home-portrait-top: 0.22%; --home-character-shift-x: 0.51%; }
.home-character img[data-character="genji"][data-outfit="default"][src*="yura-online-100-default"] { --home-portrait-height: 104.00%; --home-portrait-top: -1.00%; --home-character-shift-x: 0%; }

/* Precomputed from each source image's alpha bounds so every visible pose starts at the screen edge. */
.home-character img[data-character="rookie"][data-outfit="default"] { --home-alpha-left-shift: -21.5728%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-1"] { --home-alpha-left-shift: -4.8884%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-10"] { --home-alpha-left-shift: -27.4176%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-11"] { --home-alpha-left-shift: -23.2731%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-12"] { --home-alpha-left-shift: -20.1913%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-13"] { --home-alpha-left-shift: -26.5675%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-14"] { --home-alpha-left-shift: -24.3358%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-15"] { --home-alpha-left-shift: -14.7715%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-16"] { --home-alpha-left-shift: -22.9543%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-2"] { --home-alpha-left-shift: -23.9107%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-3"] { --home-alpha-left-shift: -24.4421%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-4"] { --home-alpha-left-shift: -25.7173%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-5"] { --home-alpha-left-shift: -27.8427%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-6"] { --home-alpha-left-shift: -16.3656%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-7"] { --home-alpha-left-shift: -25.8236%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-8"] { --home-alpha-left-shift: -14.6652%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-9"] { --home-alpha-left-shift: -27.6302%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-rare-1"] { --home-alpha-left-shift: -2.4442%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-rare-2"] { --home-alpha-left-shift: -21.2540%; }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-rare-3"] { --home-alpha-left-shift: -7.5452%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-super-1"] { --home-alpha-left-shift: -19.7662%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-1"] { --home-alpha-left-shift: -17.7471%; }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-2"] { --home-alpha-left-shift: -28.0553%; }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-3"] { --home-alpha-left-shift: -24.9734%; }
.home-character img[data-character="sharp"][data-outfit="default"] { --home-alpha-left-shift: -30.0781%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-1"] { --home-alpha-left-shift: -30.8594%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-10"] { --home-alpha-left-shift: -28.0273%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-11"] { --home-alpha-left-shift: -24.6094%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-12"] { --home-alpha-left-shift: -30.9570%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-13"] { --home-alpha-left-shift: -29.4922%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-14"] { --home-alpha-left-shift: -31.1523%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-15"] { --home-alpha-left-shift: -29.5898%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-16"] { --home-alpha-left-shift: -27.6367%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-2"] { --home-alpha-left-shift: -27.7344%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-3"] { --home-alpha-left-shift: -23.7305%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-4"] { --home-alpha-left-shift: -27.4414%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-5"] { --home-alpha-left-shift: -24.8047%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-6"] { --home-alpha-left-shift: -31.2500%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-7"] { --home-alpha-left-shift: -27.8320%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-8"] { --home-alpha-left-shift: -29.7852%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-9"] { --home-alpha-left-shift: -23.3398%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-rare-1"] { --home-alpha-left-shift: -15.0463%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-rare-2"] { --home-alpha-left-shift: -10.3516%; --home-wide-height-limit: calc(150.0000vw - 42.00px); }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-rare-3"] { --home-alpha-left-shift: -23.4375%; }
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-super-1"] { --home-alpha-left-shift: -22.3633%; --home-wide-height-limit: calc(149.9023vw - 41.97px); }
.home-character img[data-character="sharp"][data-outfit="sharp-mission-outfit-1"] { --home-alpha-left-shift: -28.5156%; }
.home-character img[data-character="sharp"][data-outfit="sharp-mission-outfit-2"] { --home-alpha-left-shift: -25.8789%; }
.home-character img[data-character="sharp"][data-outfit="sharp-mission-outfit-3"] { --home-alpha-left-shift: -19.4526%; --home-wide-height-limit: calc(150.2444vw - 42.07px); }
.home-character img[data-character="kaito"][data-outfit="default"] { --home-alpha-left-shift: -29.0117%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-1"] { --home-alpha-left-shift: -17.6408%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-10"] { --home-alpha-left-shift: -21.3603%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-11"] { --home-alpha-left-shift: -30.8183%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-12"] { --home-alpha-left-shift: -9.5643%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-13"] { --home-alpha-left-shift: -20.2976%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-14"] { --home-alpha-left-shift: -11.7960%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-15"] { --home-alpha-left-shift: -10.3082%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-16"] { --home-alpha-left-shift: -28.4803%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-2"] { --home-alpha-left-shift: -31.4559%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-3"] { --home-alpha-left-shift: -27.9490%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-4"] { --home-alpha-left-shift: -26.4612%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-5"] { --home-alpha-left-shift: -24.7609%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-6"] { --home-alpha-left-shift: -28.2678%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-7"] { --home-alpha-left-shift: -8.5016%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-8"] { --home-alpha-left-shift: -24.6546%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-9"] { --home-alpha-left-shift: -29.2242%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-rare-1"] { --home-alpha-left-shift: -24.8672%; }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-rare-2"] { --home-alpha-left-shift: -3.4006%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-rare-3"] { --home-alpha-left-shift: -11.0521%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-super-1"] { --home-alpha-left-shift: -22.1041%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-1"] { --home-alpha-left-shift: -23.2731%; }
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-2"] { --home-alpha-left-shift: -13.0010%; --home-wide-height-limit: calc(150.2444vw - 42.07px); }
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-3"] { --home-alpha-left-shift: -7.6514%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="mellow"][data-outfit="default"] { --home-alpha-left-shift: -19.2349%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-1"] { --home-alpha-left-shift: -27.9490%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-10"] { --home-alpha-left-shift: -23.6982%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-11"] { --home-alpha-left-shift: -10.9458%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-12"] { --home-alpha-left-shift: -25.6111%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-13"] { --home-alpha-left-shift: -29.3305%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-14"] { --home-alpha-left-shift: -16.2593%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-15"] { --home-alpha-left-shift: -18.1722%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-16"] { --home-alpha-left-shift: -19.9787%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-2"] { --home-alpha-left-shift: -23.9107%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-3"] { --home-alpha-left-shift: -22.2104%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-4"] { --home-alpha-left-shift: -24.1233%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-5"] { --home-alpha-left-shift: -27.9490%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-6"] { --home-alpha-left-shift: -24.4421%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-7"] { --home-alpha-left-shift: -32.6249%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-8"] { --home-alpha-left-shift: -26.7800%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-9"] { --home-alpha-left-shift: -24.2295%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-rare-1"] { --home-alpha-left-shift: -26.2487%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-rare-2"] { --home-alpha-left-shift: -2.6567%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-rare-3"] { --home-alpha-left-shift: -21.1477%; }
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-super-1"] { --home-alpha-left-shift: -21.9979%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="mellow"][data-outfit="mellow-mission-outfit-1"] { --home-alpha-left-shift: -16.5781%; --home-wide-height-limit: calc(177.6833vw - 49.75px); }
.home-character img[data-character="mellow"][data-outfit="mellow-mission-outfit-2"] { --home-alpha-left-shift: -20.7226%; }
.home-character img[data-character="mellow"][data-outfit="mellow-mission-outfit-3"] { --home-alpha-left-shift: -15.9405%; }
.home-character img[data-character="genji"][data-outfit="default"] { --home-alpha-left-shift: -6.5611%; --home-wide-height-limit: calc(201.2443vw - 56.35px); }
.home-character img[data-character="genji"][data-outfit="default"][src*="yura-online-100-default"] { --home-alpha-left-shift: -20.9961%; --home-wide-height-limit: 9999px; }

/*
 * Misato's 20 gacha outfits use their visible alpha bounds on the home screen.
 * Narrow poses are centered between the screen's left edge and the mode
 * buttons. Wide poses keep their full scale and place their visible left edge
 * at the screen edge. No other character or screen uses these rules.
 */
.home-character img[data-character="genji"][data-outfit="genji-gacha-normal-2"] {
  left: calc(50% + 6px);
  transform: translateX(-49.8535%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-normal-3"] {
  left: calc(50% + 6px);
  transform: translateX(-46.9238%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-normal-4"] {
  left: calc(50% + 6px);
  transform: translateX(-47.2656%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-normal-5"] {
  left: calc(50% + 6px);
  transform: translateX(-49.6094%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-normal-6"] {
  left: calc(50% + 6px);
  transform: translateX(-49.7070%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-normal-7"] {
  left: calc(50% + 6px);
  transform: translateX(-49.3164%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-normal-8"] {
  left: calc(50% + 6px);
  transform: translateX(-52.1484%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-normal-9"] {
  left: calc(50% + 6px);
  transform: translateX(-48.9746%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-rare-2"] {
  left: calc(50% + 6px);
  transform: translateX(-49.3164%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-rare-3"] {
  left: calc(50% + 6px);
  transform: translateX(-50.1465%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-rare-4"] {
  left: calc(50% + 6px);
  transform: translateX(-48.9746%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-rare-5"] {
  left: calc(50% + 6px);
  transform: translateX(-49.0234%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-rare-6"] {
  left: calc(50% + 6px);
  transform: translateX(-49.7559%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-rare-8"] {
  left: calc(50% + 6px);
  transform: translateX(-48.7793%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-normal-1"] {
  left: calc(50% + 6px);
  transform: translateX(-55.8105%);
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-normal-10"] {
  --home-alpha-left-shift: -19.6289%;
  left: -14px;
  transform: translateX(var(--home-alpha-left-shift));
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-rare-1"] {
  --home-alpha-left-shift: -25.7812%;
  left: -14px;
  transform: translateX(var(--home-alpha-left-shift));
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-rare-7"] {
  --home-alpha-left-shift: -25.0977%;
  left: -14px;
  transform: translateX(var(--home-alpha-left-shift));
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-rare-9"] {
  --home-alpha-left-shift: -17.4805%;
  left: -14px;
  transform: translateX(var(--home-alpha-left-shift));
}
.home-character img[data-character="genji"][data-outfit="genji-gacha-rare-10"] {
  --home-alpha-left-shift: -18.2617%;
  left: -14px;
  transform: translateX(var(--home-alpha-left-shift));
}

/*
 * Reima's narrower poses are visually centered in the space between the
 * screen's left edge and the mode buttons.  Each percentage is the measured
 * horizontal center of that outfit's visible alpha bounds.  Keep the existing
 * height and vertical placement unchanged.
 */
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-2"] {
  left: calc(50% + 6px);
  transform: translateX(-50.2657%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-3"] {
  left: calc(50% + 6px);
  transform: translateX(-51.3284%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-2"] {
  left: calc(50% + 6px);
  transform: translateX(-49.2561%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-3"] {
  left: calc(50% + 6px);
  transform: translateX(-53.9851%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-4"] {
  left: calc(50% + 6px);
  transform: translateX(-51.0627%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-5"] {
  left: calc(50% + 6px);
  transform: translateX(-51.9129%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-7"] {
  left: calc(50% + 6px);
  transform: translateX(-52.3911%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-9"] {
  left: calc(50% + 6px);
  transform: translateX(-52.7630%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-10"] {
  left: calc(50% + 6px);
  transform: translateX(-51.3815%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-11"] {
  left: calc(50% + 6px);
  transform: translateX(-51.2752%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-13"] {
  left: calc(50% + 6px);
  transform: translateX(-51.8597%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-14"] {
  left: calc(50% + 6px);
  transform: translateX(-48.9904%);
}
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-16"] {
  left: -6px;
  transform: translateX(var(--home-alpha-left-shift, 0px));
}

/*
 * Reima's complete wardrobe uses measured visible-alpha bounds. Every pose is
 * fitted to the same head/feet lines and centered between the screen edge and
 * the mode cards; transparent canvas margins are excluded from the alignment.
 */
.home-character img[data-character="rookie"][data-outfit="default"] { --home-portrait-height: 87.00%; --home-portrait-top: 5.70%; left: calc(50% - 22px); transform: translateX(-42.6000%); }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-1"] { --home-portrait-height: 87.16%; --home-portrait-top: 5.85%; left: calc(50% - 22px); transform: translateX(-41.8030%); }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-2"] { --home-portrait-height: 87.05%; --home-portrait-top: 5.75%; left: calc(50% - 22px); transform: translateX(-42.7063%); }
.home-character img[data-character="rookie"][data-outfit="rookie-mission-outfit-3"] { --home-portrait-height: 86.95%; --home-portrait-top: 5.60%; left: calc(50% - 22px); transform: translateX(-43.7690%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-1"] { --home-portrait-height: 87.11%; --home-portrait-top: 5.23%; left: calc(50% - 22px); transform: translateX(-41.4842%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-2"] { --home-portrait-height: 87.00%; --home-portrait-top: 5.54%; left: calc(50% - 22px); transform: translateX(-41.7498%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-3"] { --home-portrait-height: 86.26%; --home-portrait-top: 5.87%; left: calc(50% - 22px); transform: translateX(-46.4789%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-4"] { --home-portrait-height: 86.95%; --home-portrait-top: 6.48%; left: calc(50% - 22px); transform: translateX(-43.5033%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-5"] { --home-portrait-height: 86.73%; --home-portrait-top: 5.76%; left: calc(50% - 22px); transform: translateX(-44.3535%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-6"] { --home-portrait-height: 90.44%; --home-portrait-top: 4.03%; left: calc(50% - 22px); transform: translateX(-44.7785%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-7"] { --home-portrait-height: 86.31%; --home-portrait-top: 6.07%; left: calc(50% - 22px); transform: translateX(-44.8848%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-8"] { --home-portrait-height: 86.95%; --home-portrait-top: 5.91%; left: calc(50% - 22px); transform: translateX(-42.1749%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-9"] { --home-portrait-height: 89.08%; --home-portrait-top: 5.88%; left: calc(50% - 22px); transform: translateX(-45.0973%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-10"] { --home-portrait-height: 87.38%; --home-portrait-top: 5.59%; left: calc(50% - 22px); transform: translateX(-43.8221%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-11"] { --home-portrait-height: 86.89%; --home-portrait-top: 5.55%; left: calc(50% - 22px); transform: translateX(-43.7158%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-12"] { --home-portrait-height: 86.79%; --home-portrait-top: 5.75%; left: calc(50% - 22px); transform: translateX(-41.6436%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-13"] { --home-portrait-height: 86.68%; --home-portrait-top: 5.70%; left: calc(50% - 22px); transform: translateX(-44.3003%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-14"] { --home-portrait-height: 86.95%; --home-portrait-top: 5.75%; left: calc(50% - 22px); transform: translateX(-41.4842%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-15"] { --home-portrait-height: 90.32%; --home-portrait-top: 4.25%; left: calc(50% - 22px); transform: translateX(-43.4502%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-normal-16"] { --home-portrait-height: 86.95%; --home-portrait-top: 5.80%; left: calc(50% - 22px); transform: translateX(-44.5660%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-rare-1"] { --home-portrait-height: 89.24%; --home-portrait-top: 4.97%; left: calc(50% - 22px); transform: translateX(-42.4406%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-rare-2"] { --home-portrait-height: 87.92%; --home-portrait-top: 5.58%; left: calc(50% - 22px); transform: translateX(-41.6967%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-rare-3"] { --home-portrait-height: 87.48%; --home-portrait-top: 5.54%; left: calc(50% - 22px); transform: translateX(-44.0346%); }
.home-character img[data-character="rookie"][data-outfit="rookie-gacha-super-1"] { --home-portrait-height: 103.51%; --home-portrait-top: -3.27%; left: calc(50% - 22px); transform: translateX(-43.3439%); }

/*
 * Sena's narrow home poses are centered by their visible alpha bounds.
 * Wide poses that intentionally reach toward the mode buttons keep their
 * alpha-left placement.  Height and scale remain controlled by the fit rules.
 */
.home-character img[data-character="sharp"][data-outfit="default"] {
  left: calc(50% + 6px);
  transform: translateX(-50.2930%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-mission-outfit-1"] {
  left: calc(50% + 6px);
  transform: translateX(-52.4902%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-mission-outfit-2"] {
  left: calc(50% + 6px);
  transform: translateX(-49.9023%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-1"] {
  left: calc(50% + 6px);
  transform: translateX(-51.9043%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-2"] {
  left: calc(50% + 6px);
  transform: translateX(-49.6094%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-3"] {
  left: calc(50% + 6px);
  transform: translateX(-49.3652%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-4"] {
  left: calc(50% + 6px);
  transform: translateX(-49.4629%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-5"] {
  left: calc(50% + 6px);
  transform: translateX(-52.3438%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-6"] {
  left: calc(50% + 6px);
  transform: translateX(-50.3906%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-7"] {
  left: calc(50% + 6px);
  transform: translateX(-52.2461%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-8"] {
  left: calc(50% + 6px);
  transform: translateX(-50.5859%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-9"] {
  left: calc(50% + 6px);
  transform: translateX(-50.3418%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-10"] {
  left: calc(50% + 6px);
  transform: translateX(-55.1270%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-11"] {
  left: calc(50% + 6px);
  transform: translateX(-49.2188%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-12"] {
  left: calc(50% + 6px);
  transform: translateX(-50.8789%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-13"] {
  left: calc(50% + 6px);
  transform: translateX(-53.9062%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-14"] {
  left: calc(50% + 6px);
  transform: translateX(-51.5137%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-15"] {
  left: calc(50% + 6px);
  transform: translateX(-49.8535%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-normal-16"] {
  left: calc(50% + 6px);
  transform: translateX(-52.6855%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-rare-1"] {
  left: calc(50% + 6px);
  transform: translateX(-47.8009%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-rare-3"] {
  left: calc(50% + 6px);
  transform: translateX(-50.0000%);
}
.home-character img[data-character="sharp"][data-outfit="sharp-gacha-super-1"] {
  left: calc(50% + 6px);
  transform: translateX(-49.8535%);
}

/* Center Nagito's narrower home outfits by their visible alpha bounds. */
.home-character img[data-character="kaito"][data-outfit="default"] {
  left: calc(50% + 6px);
  transform: translateX(-53.4538%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-1"] {
  left: calc(50% + 6px);
  transform: translateX(-51.9650%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-mission-outfit-2"] {
  left: calc(50% + 6px);
  transform: translateX(-44.4770%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-1"] {
  left: calc(50% + 6px);
  transform: translateX(-49.5749%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-2"] {
  left: calc(50% + 6px);
  transform: translateX(-51.5940%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-3"] {
  left: calc(50% + 6px);
  transform: translateX(-52.0723%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-4"] {
  left: calc(50% + 6px);
  transform: translateX(-55.1010%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-5"] {
  left: calc(50% + 6px);
  transform: translateX(-55.3666%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-6"] {
  left: calc(50% + 6px);
  transform: translateX(-52.7630%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-8"] {
  left: calc(50% + 6px);
  transform: translateX(-50.5313%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-9"] {
  left: calc(50% + 6px);
  transform: translateX(-56.4293%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-10"] {
  left: calc(50% + 6px);
  transform: translateX(-50.8502%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-11"] {
  left: calc(50% + 6px);
  transform: translateX(-52.5505%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-13"] {
  left: calc(50% + 6px);
  transform: translateX(-49.8937%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-normal-16"] {
  left: calc(50% + 6px);
  transform: translateX(-52.9756%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-rare-1"] {
  left: calc(50% + 6px);
  transform: translateX(-48.9373%);
}
.home-character img[data-character="kaito"][data-outfit="kaito-gacha-super-1"] {
  left: calc(50% + 6px);
  transform: translateX(-51.2221%);
}

/* Center Kohaku's narrower home outfits by their visible alpha bounds. */
.home-character img[data-character="mellow"][data-outfit="default"] {
  left: calc(50% + 6px);
  transform: translateX(-48.4591%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-mission-outfit-2"] {
  left: calc(50% + 6px);
  transform: translateX(-52.2848%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-mission-outfit-3"] {
  left: calc(50% + 6px);
  transform: translateX(-47.7152%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-1"] {
  left: calc(50% + 6px);
  transform: translateX(-52.8162%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-2"] {
  left: calc(50% + 6px);
  transform: translateX(-47.7683%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-3"] {
  left: calc(50% + 6px);
  transform: translateX(-49.3092%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-4"] {
  left: calc(50% + 6px);
  transform: translateX(-45.0053%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-5"] {
  left: calc(50% + 6px);
  transform: translateX(-49.8406%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-6"] {
  left: calc(50% + 6px);
  transform: translateX(-46.9182%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-7"] {
  left: calc(50% + 6px);
  transform: translateX(-50.9564%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-8"] {
  left: calc(50% + 6px);
  transform: translateX(-49.3092%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-9"] {
  left: calc(50% + 6px);
  transform: translateX(-50.5845%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-10"] {
  left: calc(50% + 6px);
  transform: translateX(-55.1541%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-12"] {
  left: calc(50% + 6px);
  transform: translateX(-49.7343%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-13"] {
  left: calc(50% + 6px);
  transform: translateX(-52.3911%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-normal-14"] {
  left: calc(50% + 6px);
  transform: translateX(-48.7779%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-rare-1"] {
  left: calc(50% + 6px);
  transform: translateX(-50.7970%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-rare-3"] {
  left: calc(50% + 6px);
  transform: translateX(-49.5749%);
}
.home-character img[data-character="mellow"][data-outfit="mellow-gacha-super-1"] {
  left: calc(50% + 6px);
  transform: translateX(-50.4251%);
}

@media (max-height: 720px) {
  html:not(.ui-uniform-compact) .home-character img {
    max-width: min(var(--home-character-width, 138%), 142%);
  }
}

.home-mode-grid {
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  align-self: auto;
  transform: translateY(-16px);
}

.home-mode-card {
  position: relative;
  overflow: hidden;
  justify-content: center;
  height: 82px;
  min-height: 82px;
  padding: 12px 10px;
  border: 2px solid rgba(255,255,255,.82);
  background: linear-gradient(180deg, rgba(19,91,158,.94), rgba(18,54,138,.95));
  color: #fff;
  box-shadow: 0 12px 22px rgba(12,45,72,.2), inset 0 1px 0 rgba(255,255,255,.35);
  text-align: center;
}

.home-mode-card strong {
  margin: 0;
  font-size: clamp(19px, 5vw, 26px);
  line-height: 1.15;
  text-shadow: 0 2px 0 rgba(0,0,0,.28), 0 0 14px rgba(255,255,255,.24);
}

.home-profile-card {
  background: linear-gradient(180deg, rgba(19,143,87,.96), rgba(10,92,61,.98));
}

.home-utility-grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 680px);
  margin: 0 auto;
}

.home-bottom-btn {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 50px;
  padding: 7px 4px;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22,132,122,.96), rgba(9,82,94,.98));
  color: #fff;
  box-shadow: none;
  text-align: center;
}

.home-bottom-btn strong {
  color: #fff;
  font-size: clamp(13px, 3.5vw, 17px);
  line-height: 1.12;
  text-shadow: 0 2px 0 rgba(0,0,0,.3), 0 0 12px rgba(255,255,255,.2);
}

.home-ad-slot {
  border: 2px dashed rgba(14,91,80,.34);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 18px rgba(12,45,72,.08);
}

.my-page-screen {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  padding: 14px 14px 18px;
  color: #fff;
  background: transparent;
  overflow: hidden;
}

.my-page-scale-content {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  transform-origin: top left;
}

.my-page-screen::before {
  display: none;
}

.my-page-screen > * {
  position: relative;
  z-index: 1;
}

.my-page-header {
  width: min(100%, 680px);
  margin: 0 auto;
}

.my-page-title {
  margin: 0;
  padding: 14px 18px;
  border: 2px solid rgba(66, 191, 218, .72);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(231,247,241,.9));
  color: #174a3d;
  font-size: 28px;
  text-align: center;
  letter-spacing: .08em;
  text-shadow: 0 1px 0 rgba(255,255,255,.9);
  box-shadow: none;
}

.my-page-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 64px;
  padding: 0 8px;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22,132,122,.96), rgba(9,82,94,.98));
  color: #fff;
  font-size: 32px;
  font-weight: 1000;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.my-page-text-icon {
  display: block;
  width: 100%;
  font-size: clamp(18px, 4.8vw, 21px);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.my-page-rank-row[role="button"] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.my-page-rank-row[role="button"]:focus-visible {
  outline: 3px solid #1d88ac;
  outline-offset: -3px;
}

.ranking-dialog {
  width: min(calc(100% - 24px), 452px);
  height: calc(100dvh - var(--global-ad-space) - max(24px, env(safe-area-inset-top)) - 16px);
  max-height: calc(100dvh - var(--global-ad-space) - max(24px, env(safe-area-inset-top)) - 16px);
  padding: 0;
  border: 2px solid #173f33;
  border-radius: 16px;
  background: #fff;
  color: #123d30;
  box-shadow: 0 22px 60px rgba(6, 35, 26, .3);
}

dialog.ranking-dialog[open] {
  transform: translateY(calc(var(--global-ad-space) / -2));
}

.ranking-dialog::backdrop {
  background: rgba(4, 15, 11, .58);
}

.ranking-dialog-body {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  height: 100%;
  max-height: calc(100dvh - var(--global-ad-space) - max(24px, env(safe-area-inset-top)) - 20px);
  box-sizing: border-box;
  padding: 16px;
}

.ranking-dialog-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}

.ranking-dialog-header h2 {
  color: #075f40;
  font-size: clamp(28px, 7.5vw, 36px);
  text-align: center;
}

.ranking-dialog-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.ranking-eligibility-note {
  width: 100%;
  margin: -2px 0 0;
  overflow: hidden;
  color: #365d50;
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
  letter-spacing: -.04em;
}

.ranking-eligibility-note.is-play-count {
  font-size: clamp(10px, 2.95vw, 12px);
  letter-spacing: -.075em;
}

.ranking-dialog-tab {
  min-height: 48px;
  border: 2px solid #087a55;
  border-radius: 10px;
  background: #fff;
  color: #075f40;
  font-size: clamp(17px, 4.5vw, 20px);
  font-weight: 900;
}

.ranking-dialog-tab.is-active {
  background: linear-gradient(180deg, #20a168, #087a55);
  color: #fff;
}

#rankingDialogCloseBtn {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0 0 3px;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  font-family: Arial, sans-serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
  text-indent: 2px;
  transform: none;
}

.ranking-top-list {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid #c6d7d0;
  border-radius: 12px;
  background: #f8fbf9;
  scrollbar-color: #087a55 #e2e2df;
}

.ranking-scroll-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px;
  gap: 6px;
  min-height: 0;
}

.ranking-scroll-shell #rankingScrollbar {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  grid-column: 2;
  grid-row: 1;
  height: 100%;
}

.ranking-scroll-shell.is-empty {
  grid-template-columns: minmax(0, 1fr);
}

.ranking-scroll-shell.is-empty #rankingScrollbar {
  display: none;
}

.ranking-top-list.is-empty {
  padding: 4px 2px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: clamp(15px, 4vw, 18px);
  line-height: 1.5;
}

.ranking-top-row {
  display: grid;
  grid-template-columns: 48px 58px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 8px;
  grid-template-rows: auto auto;
  min-height: 110px;
  padding: 7px 10px;
  border-bottom: 1px solid #cadbd4;
  background: #fff;
}

.ranking-top-position,
.ranking-character-icon,
.ranking-player-name,
.ranking-player-rating {
  grid-row: 1;
}

.ranking-player-record {
  grid-column: 1 / 5;
  grid-row: 2;
  min-width: 0;
  overflow: hidden;
  color: #365d50;
  padding: 4px 2px 2px;
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-dialog-header h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
}

.ranking-dialog-header h2 strong {
  display: block;
  font-size: 1em;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.02em;
}

.ranking-dialog-header h2 span {
  display: block;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-1px) scaleY(0.9);
  transform-origin: center bottom;
}

.ranking-top-row.is-current-user .ranking-player-record {
  color: #fff;
}

.ranking-top-row:last-child {
  border-bottom: 0;
}

.ranking-top-row.is-current-user {
  background: #167fa2;
  color: #fff;
  box-shadow: inset 0 2px 0 #64c7e4, inset 0 -2px 0 #0c6685;
}

.ranking-top-position,
.ranking-player-rating {
  font-size: clamp(15px, 4vw, 18px);
  white-space: nowrap;
}

.ranking-character-icon {
  display: grid;
  place-items: end center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 2px solid #d2b759;
  border-radius: 9px;
  background: #fff;
}

.ranking-character-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.ranking-player-name {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(15px, 4.2vw, 19px);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-player-rating {
  color: #9a6500;
  text-align: right;
}

.ranking-top-row.is-play-count {
  grid-template-rows: auto;
  min-height: 76px;
}

.ranking-player-play-count {
  grid-column: 4;
  grid-row: 1;
  color: #9a6500;
  font-size: clamp(15px, 4vw, 18px);
  text-align: right;
  white-space: nowrap;
}

.ranking-top-row.is-current-user .ranking-player-play-count {
  color: #ffe66f;
}

.ranking-top-row.is-current-user .ranking-player-rating {
  color: #ffe66f;
}

.ranking-dialog-close {
  min-height: 50px;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  font-weight: 900;
}

.home-gacha-card {
  --gacha-burst-shape: polygon(
    50% 0%, 57% 10%, 66% 3%, 70% 15%, 80% 10%, 82% 23%,
    94% 22%, 90% 36%, 100% 50%, 90% 64%, 94% 78%, 82% 77%,
    80% 90%, 70% 85%, 66% 97%, 57% 90%, 50% 100%, 43% 90%,
    34% 97%, 30% 85%, 20% 90%, 18% 77%, 6% 78%, 10% 64%,
    0% 50%, 10% 36%, 6% 22%, 18% 23%, 20% 10%, 30% 15%,
    34% 3%, 43% 10%
  );
  position: absolute;
  left: 50%;
  bottom: 0;
  display: grid;
  place-items: center;
  justify-self: center;
  width: 96px;
  height: 62px;
  min-height: 0;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #3e3a2d;
  filter: drop-shadow(0 9px 9px rgba(83, 68, 39, .28));
  isolation: isolate;
  text-align: center;
  transform: translate(-50%, -4px);
}

.home-gacha-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  clip-path: var(--gacha-burst-shape);
}

.home-gacha-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 2px;
  background: linear-gradient(180deg, #f3e2b8 0%, #d6b46b 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.72),
    inset 0 -3px 0 rgba(151, 111, 38, .16);
  clip-path: var(--gacha-burst-shape);
}

.home-gacha-card strong {
  position: relative;
  z-index: 2;
  margin: 0;
  color: #3e3a2d;
  font-size: clamp(18px, 4.7vw, 22px);
  line-height: 1;
  letter-spacing: .05em;
  text-shadow: 0 1px 0 rgba(255,255,255,.55);
  white-space: nowrap;
}

.home-gacha-card:active {
  transform: translate(-50%, -3px) scale(.985);
}

/* The English label needs a wider safe area inside the burst points. */
html[data-language="en"] .home-gacha-card {
  width: 136px;
  height: 66px;
}

/* UI confirmation app: reversible premium gacha-button concept. */
.ui-confirmation-app .home-gacha-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: grid;
  place-items: center;
  width: min(118px, 100%);
  height: 42px;
  min-height: 0;
  padding: 6px;
  overflow: hidden;
  border: 1.5px solid #d8b65b;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 38%),
    linear-gradient(145deg, #0b2b22 0%, #041713 52%, #020c0a 100%);
  color: #f6d980;
  box-shadow:
    0 10px 16px rgba(1, 18, 14, .28),
    0 3px 0 #020a08,
    inset 0 1px 0 rgba(255, 241, 187, .22),
    inset 0 -2px 0 rgba(0, 0, 0, .38);
  filter: none;
  isolation: isolate;
  text-align: center;
  transform: translate(-50%, -4px);
}

.ui-confirmation-app .home-gacha-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 2px;
  border: 1px solid rgba(255, 222, 126, .16);
  border-radius: 19px;
  background: none;
  clip-path: none;
  pointer-events: none;
}

.ui-confirmation-app .home-gacha-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: -35%;
  bottom: -35%;
  left: -42%;
  width: 30%;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(255, 226, 137, .32), transparent);
  box-shadow: none;
  clip-path: none;
  opacity: 0;
  pointer-events: none;
  transform: skewX(-18deg);
  animation: ui-confirmation-gacha-shine 5.4s ease-in-out infinite;
}

.ui-confirmation-app .home-gacha-card strong {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  color: #f8dc84;
  font-size: clamp(16px, 4.2vw, 20px);
  line-height: 1;
  letter-spacing: .04em;
  text-shadow: 0 1px 0 #000, 0 0 10px rgba(233, 190, 79, .18);
  white-space: nowrap;
}

.ui-confirmation-app .home-gacha-card strong::before {
  content: "♛";
  display: inline-block;
  color: #e7c35f;
  font-size: .9em;
  line-height: 1;
  text-shadow: 0 1px 0 #5d4210, 0 0 8px rgba(255, 219, 116, .24);
}

.ui-confirmation-app .home-gacha-card:active {
  transform: translate(-50%, -2px) scale(.985);
  box-shadow:
    0 6px 10px rgba(1, 18, 14, .24),
    0 1px 0 #020a08,
    inset 0 1px 0 rgba(255, 241, 187, .18);
}

html[data-language="en"].ui-confirmation-app .home-gacha-card {
  width: min(126px, 100%);
  height: 36px;
  padding-block: 4px;
}

html[data-language="en"].ui-confirmation-app .home-gacha-card strong {
  gap: 6px;
  font-size: clamp(13px, 3.6vw, 17px);
  letter-spacing: .01em;
}

@keyframes ui-confirmation-gacha-shine {
  0%, 72%, 100% {
    left: -42%;
    opacity: 0;
  }
  76% {
    opacity: .1;
  }
  83% {
    opacity: .62;
  }
  90% {
    left: 112%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ui-confirmation-app .home-gacha-card::after {
    animation: none;
  }
}


.my-page-outfit-btn .my-page-text-icon {
  font-size: clamp(18px, 4.8vw, 21px);
}

.my-page-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  grid-template-areas:
    "panel"
    "note"
    "actions"
    "home";
  align-content: center;
  align-items: stretch;
  gap: 10px 12px;
  width: min(100%, 760px);
  min-height: 0;
  margin: 0 auto;
}

.my-page-action-row {
  grid-area: actions;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: 12px;
  width: 100%;
}

.my-page-home-row {
  grid-area: home;
  display: grid;
  gap: 0;
  width: 100%;
}

html.ui-confirmation-app .my-page-home-row {
  position: fixed;
  right: 0;
  bottom: calc(var(--global-ad-space) - 16px);
  left: 0;
  z-index: 39;
  height: 88px;
  border-top: 1px solid rgba(16,76,57,.12);
  background: #fff;
}

.my-page-home-btn {
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 9px 14px;
  border: 2px solid #000;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font-size: clamp(17px, 4.8vw, 21px);
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
}

.my-page-panel {
  grid-area: panel;
  position: relative;
  z-index: 2;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: auto;
  width: 100%;
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(25, 103, 76, .2);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  color: #173f33;
  box-shadow: 0 14px 30px rgba(19, 78, 58, .12);
}

.my-page-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid #111;
  border-radius: 12px;
  background: #fff;
  font-size: clamp(24px, 5.5vw, 30px);
  font-weight: 900;
}

.my-page-name > span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-page-name > button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(25, 103, 76, .28);
  border-radius: 10px;
  background: linear-gradient(135deg, #fffef9, #fff9e8);
  color: #111;
  font-size: 15px;
  font-weight: 900;
}

.my-page-section-label {
  width: fit-content;
  max-width: 100%;
  margin: 8px auto 10px;
  padding: 5px 18px 7px;
  border: 0;
  border-bottom: 3px solid #d4ad3c;
  color: #174a3d;
  font-size: clamp(20px, 5vw, 25px);
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.my-page-stat-list {
  display: grid;
  grid-template-rows: repeat(3, 58px) auto;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 0;
}

.my-page-stat-list div {
  display: grid;
  grid-template-columns: minmax(50px, 66px) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 7px 12px;
  border: 1px solid rgba(25, 103, 76, .16);
  border-left: 4px solid #2d9b6b;
  border-radius: 12px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 5px 14px rgba(22, 80, 61, .07);
}

.my-page-stat-list span,
.my-page-stat-list strong {
  font-size: clamp(20px, 5vw, 27px);
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.my-page-stat-list strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.my-page-stat-list .my-page-stat-record {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: center;
  gap: 8px;
}

.my-page-stat-list .my-page-rank-row {
  grid-template-rows: auto auto;
  min-height: 80px;
  border-left-color: #d4ad3c;
  background: linear-gradient(135deg, #fffef9, #fff9e8);
}

.my-page-stat-list .my-page-rank-row small {
  grid-column: 1 / -1;
  color: #5d675f;
  font-size: clamp(10px, 2.7vw, 12px);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.my-page-stat-list .my-page-rank-row small span {
  display: block;
  font-size: inherit;
  line-height: inherit;
  white-space: normal;
}

.my-page-online-note {
  grid-area: note;
  margin: 0 2px;
  padding-inline: 2px;
  color: #315447;
  font-size: clamp(12px, 3.45vw, 15px);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

html[data-language="ja"] .my-page-online-note {
  white-space: nowrap;
}

.my-page-stat-record strong {
  width: auto;
  text-align: right;
  font-size: clamp(19px, 4.6vw, 25px);
  white-space: nowrap;
}

.my-page-history-panel {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(2px);
}

.my-page-history-panel[hidden] {
  display: none;
}

.my-page-history-dialog {
  width: min(100%, 680px);
  max-height: min(82dvh, 760px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 18px;
  border: 2px solid #1c6c50;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffefa, #f2f7f3);
  color: #173d30;
  box-shadow: 0 28px 70px rgba(4, 24, 16, .46);
}

.my-page-history-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.my-page-history-header h3 {
  grid-column: 2;
  margin: 0;
  color: #075f40;
  font-size: clamp(25px, 6.4vw, 31px);
  line-height: 1.15;
  text-align: center;
}

.my-page-history-header .icon-btn {
  grid-column: 3;
  border: 3px solid #000;
}

.my-page-history-dialog > p {
  margin: 22px 2px 14px;
  color: #476158;
  font-size: clamp(14px, 3.7vw, 16px);
  font-weight: 900;
  line-height: 1.45;
}

.match-history-list {
  display: grid;
  gap: 8px;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 16px;
  -webkit-overflow-scrolling: touch;
}

.match-history-scroll-shell {
  min-height: 0;
}

.match-history-item {
  display: grid;
  grid-template-columns: minmax(82px, auto) minmax(110px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 94px;
  padding: 10px 12px;
  border: 1px solid #d4e2da;
  border-radius: 13px;
  background: #fff;
  color: #253c33;
  text-align: left;
  box-shadow: 0 5px 14px rgba(18, 61, 44, .09);
}

.match-history-item span,
.match-history-item small {
  min-width: 0;
  color: #526b61;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.match-history-item strong {
  min-width: 0;
  color: #075f40;
  font-size: 20px;
  font-weight: 1000;
  line-height: 1.1;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.match-history-item .match-history-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.match-history-item .match-history-mode {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: clamp(10px, 2.8vw, 13px);
}

.match-history-item .match-history-players,
.match-history-item .match-history-score {
  grid-column: 1 / -1;
}

.match-history-item .match-history-players {
  padding-top: 3px;
}

.match-history-item .match-history-score {
  color: #26323a;
  font-size: 15px;
}

@media (max-width: 360px) {
  html:not(.ui-uniform-compact) .match-history-item {
    grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
    gap: 6px;
    padding-inline: 8px;
  }

  html:not(.ui-uniform-compact) .match-history-item > span:first-child {
    font-size: 12px;
  }

  html:not(.ui-uniform-compact) .match-history-item strong {
    font-size: 18px;
  }

  html:not(.ui-uniform-compact) .match-history-item .match-history-summary {
    gap: 4px;
  }
}

.match-history-empty {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  color: #52626c;
  font-weight: 800;
  text-align: center;
}

.mode-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(21, 32, 27, .08);
  text-align: left;
}

.mode-card strong {
  display: block;
  margin: 8px 0;
  font-size: 22px;
  line-height: 1.05;
}

.profile-card strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.locked-card {
  opacity: .78;
}

.mode-kicker, .mode-card small, .section-title span, .hint {
  color: var(--muted);
  font-size: 12px;
}

.characters {
  margin-top: 18px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title h2, .setup-panel h2, .dialog-body h2 {
  font-size: 18px;
}

.character-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.character {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.character.is-locked {
  opacity: .55;
}

.character-list-wide {
  grid-template-columns: repeat(2, 1fr);
}

.character.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(22, 143, 87, .2);
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 10px auto 6px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}

.character-art {
  display: block;
  height: 176px;
  margin: 0;
  background: linear-gradient(180deg, #f8faf7, #e9eee7);
  overflow: hidden;
}

.character-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.character small {
  display: block;
  min-height: 34px;
  padding: 7px 4px 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.setup-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.character-setup-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  height: 100%;
  min-height: 0;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.character-setup-title {
  width: min(100%, 460px);
  margin: 0 auto 12px;
  padding: 0 8px;
  text-align: center;
}

.character-setup-title h2 {
  margin: 0;
  color: #fff1b8;
  font-family: "Meiryo", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  font-size: clamp(39px, 10.5vw, 52px);
  font-weight: 800;
  line-height: 1.04;
  white-space: nowrap;
  text-shadow: var(--title-outline);
  -webkit-text-stroke: 0 transparent;
}

.character-setup-title h2 {
  color: #168b55;
  background: none;
  font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Sans", sans-serif;
  -webkit-text-fill-color: #168b55;
  -webkit-text-stroke: 2.2px #111;
  paint-order: stroke fill;
  letter-spacing: .035em;
  text-shadow: none;
  filter: none;
}

.character-setup-title p {
  max-width: 390px;
  margin: 10px auto 0;
  color: #111;
  font-size: clamp(13px, 3.5vw, 17px);
  font-weight: 900;
  line-height: 1.42;
  -webkit-text-stroke: 0;
  paint-order: stroke fill;
  text-shadow: none;
}

.character-select-heading {
  font-size: clamp(15px, 3.8vw, 18px);
  text-align: center;
  margin: 0;
  color: #8a5a12;
  font-weight: 900;
  line-height: 1.35;
  text-shadow: 0 1px 0 rgba(255,255,255,.8), 0 0 12px rgba(255,222,145,.36);
}

.onboarding-title {
  margin-top: 18px;
}

.character-carousel {
  position: relative;
  display: block;
  width: min(100%, 680px);
  margin: 0 auto;
  min-height: 0;
  height: 100%;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #168f57, #0f6c43);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 10px 20px rgba(21, 32, 27, .14);
  font-size: 0;
  transform: translateY(-50%);
}

#prevCharacterBtn { left: 0; }
#nextCharacterBtn { right: 0; }

.carousel-arrow::before {
  content: "";
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}

#prevCharacterBtn::before {
  border-right: 14px solid #fff;
  transform: translate(-57%, -50%);
}

#nextCharacterBtn::before {
  border-left: 14px solid #fff;
  transform: translate(-43%, -50%);
}

.character-stage {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  box-shadow: none;
}

.character-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 16px 20px rgba(0,0,0,.18));
}

.character-profile-panel {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(21, 58, 45, .18);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  color: #173d30;
  box-shadow: 0 12px 26px rgba(22,55,38,.1);
}

.character-profile-panel h3 {
  margin: 0 0 5px;
  font-size: 21px;
  line-height: 1.1;
}

.character-profile-panel h3 ruby {
  ruby-position: over;
}

.character-profile-panel h3 rt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #60766d;
}

.character-profile-panel p {
  min-height: 0;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1.38;
  color: #40574d;
  white-space: pre-line;
}

.character-setup-panel > .primary-btn {
  min-height: 46px;
  margin-top: 0;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input[type="url"],
.field input[type="text"] {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field output {
  justify-self: end;
  color: var(--green-dark);
  font-weight: 800;
}

.switch-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.switch-row input {
  width: 48px;
  height: 28px;
  accent-color: var(--green);
}

.primary-btn, .secondary-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  border: 0;
  font-weight: 800;
}

.primary-btn {
  margin-top: 18px;
  background: var(--green);
  color: #fff;
}

.secondary-btn {
  background: #eef2ed;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.button-row .primary-btn,
.button-row .secondary-btn {
  min-height: 52px;
  margin-top: 0;
}

.status-line {
  min-height: 20px;
  margin-top: 12px;
  color: var(--green-dark);
  font-size: 13px;
}

.rate-range-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.rate-range-help {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.rated-searching-state {
  display: grid;
  gap: 12px;
}

.rated-searching-state[hidden] {
  display: none;
}

.rated-searching-state > .rated-search-note {
  margin-top: 0;
}

.rated-searching-card {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 320px;
  padding: 28px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f4f8f5);
  text-align: center;
}

.search-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border: 5px solid rgba(22, 151, 91, .16);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: rated-search-spin .8s linear infinite;
}

@keyframes rated-search-spin {
  to { transform: rotate(360deg); }
}

.rated-search-title {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.rated-opponent-stats {
  margin: -4px 0 0;
  color: #111;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.rated-opponent-stats[hidden] {
  display: none;
}

.rated-searching-card #ratedStatus {
  font-size: 15px;
}

.rated-searching-card #ratedStatus.is-match-confirmation {
  color: #111;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.range-btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.range-btn.is-selected {
  background: linear-gradient(180deg, #4b8fd4 0%, #285d9f 100%);
  color: #fff;
  border-color: #24558f;
  box-shadow: 0 5px 12px rgba(34, 79, 135, .22);
}

.rated-fallback-prompt {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.rated-fallback-prompt p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.rated-search-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(22, 143, 87, .18);
  border-radius: 8px;
  background: rgba(235, 248, 240, .72);
  color: #486057;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  text-align: left;
}

.rated-search-note strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 22px;
  padding: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.rated-penalty-note {
  border-color: rgba(201, 139, 37, .3);
  background: rgba(255, 247, 226, .86);
  color: #65512d;
}

#cancelRatedSearchBtn {
  margin-top: 2px;
}

.rated-fallback-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 143, 87, .28);
  border-radius: 10px;
  background: #fff;
  color: #173d2d;
  font-size: clamp(13px, 3.7vw, 16px);
  font-weight: 900;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.rated-fallback-toggle input {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--green);
}

#ratedHomeBtn {
  margin-top: 14px;
}

.rated-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
  padding: 22px 14px 14px;
  overflow: hidden;
}

.rated-page-title {
  width: min(100%, 680px);
  margin: 0 auto;
  min-height: 0;
  height: 100%;
  padding: 0 6px;
  text-align: center;
}

.rated-page-title h2 {
  margin: 0;
  color: #168b55;
  font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Sans", sans-serif;
  font-size: clamp(34px, 9vw, 46px);
  font-weight: 900;
  line-height: 1.08;
  -webkit-text-stroke: 2.2px #111;
  paint-order: stroke fill;
  text-shadow: none;
}

#ratedView .rated-page-title h2 {
  color: #0b6845;
  background: linear-gradient(180deg, #249b65 0%, #075f40 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0;
  paint-order: normal;
  font-weight: 950;
  letter-spacing: .025em;
  text-shadow: 2px 3px 5px rgba(7, 79, 51, .2);
}

.rated-page-title p {
  margin: 10px 0 0;
  color: #111;
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 700;
  line-height: 1.55;
}

#ratedIntro p {
  font-size: clamp(13px, 3.7vw, 15px);
}

html[data-language="ja"] #ratedIntro p span {
  white-space: nowrap;
}

.rated-page-title .rated-ai-note {
  margin-top: 6px;
  color: #486057;
  font-size: clamp(12px, 3.15vw, 14px);
  font-weight: 700;
}

.rated-panel {
  align-self: start;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  margin: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.error-line {
  min-height: 18px;
  margin-top: 8px;
  color: var(--red);
  font-size: 12px;
}

.ad-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed #b8c2b8;
  border-radius: 8px;
  background: #f5f7f3;
  color: var(--muted);
}

.ad-slot[hidden] {
  display: none;
}

.ad-slot span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #dfe6dc;
  color: #506057;
  font-size: 12px;
  font-weight: 800;
}

.stat-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.stat-list div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-list strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.shop-list {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 18px;
  min-height: 0;
  margin-top: 16px;
  padding: 0 14px 18px 0;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.shop-list::-webkit-scrollbar {
  display: none;
}

.shop-unified-card {
  overflow: hidden;
  border: 2px solid rgba(24, 90, 66, .18);
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 26px rgba(18, 58, 43, .08);
}

.shop-scrollbar {
  position: relative;
  z-index: 3;
  grid-row: 2;
  grid-column: 1;
  align-self: stretch;
  justify-self: end;
  width: 6px;
  min-height: 0;
  margin: 16px 2px 18px 0;
  border-radius: 999px;
  background: rgba(22, 143, 87, .16);
  box-shadow: inset 0 0 0 1px rgba(13, 104, 62, .08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.shop-scrollbar.is-scrollable {
  opacity: 1;
}

.shop-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 36px;
  border-radius: inherit;
  background: linear-gradient(180deg, #249b65, #075f40);
  box-shadow: 0 1px 3px rgba(7, 79, 51, .24);
}

.shop-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.shop-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.shop-heading h2 {
  width: 100%;
  margin: 0;
  font-size: clamp(30px, 8vw, 40px);
  line-height: 1.2;
}

.shop-product {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.shop-launch-campaign {
  display: none;
  gap: 14px;
  padding: 20px 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(244, 203, 83, .3), transparent 38%),
    linear-gradient(145deg, #f8fff9, #eef9f2 58%, #fffaf0);
}

html.launch-campaign-preview #shopView .shop-product {
  display: none;
}

html.launch-campaign-preview #shopView .shop-launch-campaign {
  display: grid;
}

.shop-launch-campaign-product-name {
  justify-self: start;
  color: #17211e;
  font-size: 20px;
  font-weight: 1000;
  line-height: 1.25;
}

.shop-launch-campaign-badge {
  justify-self: start;
  padding: 6px 12px;
  border: 1px solid rgba(178, 125, 0, .38);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff8d7, #ffe89e);
  color: #805500;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .04em;
}

.shop-launch-campaign-heading {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.shop-launch-campaign-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(145deg, #20a96c, #087447);
  color: #fff;
  font-size: 15px;
  font-weight: 1000;
  letter-spacing: .08em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25), 0 8px 18px rgba(8, 116, 71, .16);
}

.shop-launch-campaign-icon::after {
  content: "";
  position: absolute;
  width: 86px;
  height: 2px;
  left: -7px;
  top: 35px;
  background: rgba(255, 255, 255, .76);
  transform: rotate(45deg);
}

.shop-launch-campaign-heading strong {
  display: block;
  color: #123d2d;
  font-size: clamp(20px, 5.3vw, 27px);
  font-weight: 1000;
  line-height: 1.25;
}

.shop-launch-campaign-heading p {
  margin: 5px 0 0;
  color: #587067;
  font-size: 12px;
  font-weight: 800;
}

.shop-launch-campaign-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.shop-launch-campaign-regular-price {
  position: relative;
  display: inline-block;
  color: #111;
  font-size: clamp(20px, 5.3vw, 25px);
  font-weight: 1000;
  line-height: 1.05;
  white-space: nowrap;
}

.shop-launch-campaign-regular-price::before,
.shop-launch-campaign-regular-price::after {
  content: "";
  position: absolute;
  right: -4px;
  left: -4px;
  height: 1px;
  border-radius: 999px;
  background: #b13a2e;
}

.shop-launch-campaign-regular-price::before {
  top: 33%;
}

.shop-launch-campaign-regular-price::after {
  top: 51%;
}

.shop-launch-campaign-price-arrow {
  color: #6f7f77;
  font-size: 22px;
  font-weight: 1000;
}

.shop-launch-campaign-free-price {
  color: #07844e;
  font-size: clamp(42px, 11vw, 54px);
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.shop-launch-campaign-free-label {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff0a9;
  color: #7d5100;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 1000;
  line-height: 1.2;
  white-space: nowrap;
}

.shop-launch-campaign-benefits {
  padding: 13px 14px;
  border: 2px solid rgba(24, 143, 87, .22);
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
}

.shop-launch-campaign-benefits ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-launch-campaign-benefits li {
  position: relative;
  padding-left: 1.5em;
  color: #28483c;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.shop-launch-campaign-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #15965d;
  font-weight: 1000;
}

.shop-launch-campaign-notice {
  display: grid;
  gap: 2px;
  margin: 0;
  color: #5d6b65;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.55;
  text-align: left;
}

.shop-launch-campaign-status {
  justify-self: center;
  min-width: min(100%, 220px);
  padding: 12px 20px;
  border: 2px solid rgba(8, 105, 65, .28);
  border-radius: 999px;
  background: linear-gradient(180deg, #17965d, #0b7b4b);
  color: #fff;
  font-size: 17px;
  font-weight: 1000;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 8px 18px rgba(8, 116, 71, .16);
}

.shop-product-title {
  grid-column: 1 / -1;
  justify-self: start;
  color: #17211e;
  font-size: 20px;
  line-height: 1.25;
  white-space: nowrap;
}

.shop-product-icon {
  display: grid;
  place-items: center;
  align-self: center;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(145deg, #1ca66a, #087447);
  color: #fff;
  font-size: 22px;
  font-weight: 1000;
  letter-spacing: .06em;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.22);
}

.shop-product-icon::after {
  content: "";
  position: absolute;
  width: 86px;
  height: 2px;
  left: -7px;
  top: 35px;
  background: rgba(255,255,255,.76);
  transform: rotate(45deg);
}

.shop-product-icon {
  position: relative;
  overflow: hidden;
}

.home-character:focus-visible {
  outline: 3px solid rgba(22, 143, 87, .7);
  outline-offset: -3px;
  border-radius: 12px;
}

.shop-product-copy {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.shop-product-copy > p {
  margin: 3px 0 0;
  color: #587067;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.shop-product-benefits {
  margin-top: 7px;
  padding: 8px 10px 9px;
  border: 2px solid rgba(217, 170, 54, 0.72);
  border-radius: 12px;
  color: #5f480e;
  background: linear-gradient(135deg, #fffaf0, #fff1bd);
}

.shop-product-benefits-title {
  display: block;
  margin-bottom: 5px;
  color: #8a5a00;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.04em;
}

.shop-product-benefits ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-product-benefits li {
  position: relative;
  margin: 0;
  padding-left: 1.35em;
  color: #3e4f48;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.shop-product-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #15965d;
  font-weight: 1000;
}

.shop-product-purchase {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 44%);
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(24, 143, 87, .17);
}

.shop-product-price {
  align-self: stretch;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  color: #168f57;
  font-size: clamp(21px, 5vw, 31px);
  font-weight: 1000;
  line-height: 1.12;
  text-align: center;
  transform: translate(-0.12em, -0.06em);
}

.shop-subscription-price-line {
  display: block;
  white-space: nowrap;
}

.shop-subscription-price-line + .shop-subscription-price-line {
  margin-top: 0.2em;
}

.shop-subscription-price-line.is-introductory-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-inline: auto;
  padding: 0.28em 0.72em;
  border: 1px solid rgba(22, 143, 87, 0.55);
  border-radius: 999px;
  background: rgba(22, 143, 87, 0.09);
  font-size: clamp(11px, 2.8vw, 14px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.04em;
}

.shop-subscription-price-line.is-introductory {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28em;
  margin-top: 0.34em;
  font-size: 1em;
  line-height: 1;
}

.shop-subscription-price-line.is-introductory > span {
  font: inherit;
  line-height: inherit;
}

html[data-language="ja"] .shop-subscription-price-value {
  font-size: 1.08em;
}

.shop-subscription-price-line.is-recurring {
  font-size: 0.72em;
}

/* Keep experimental shop sizing isolated to the side-by-side UI confirmation app. */
html.ui-confirmation-app .shop-subscription-price-line.is-recurring {
  font-size: 0.9em;
}

html[data-language="en"] #shopSubscriptionPrice .shop-subscription-price-line.is-introductory-badge {
  padding: 0.26em 0.62em;
  font-size: clamp(10px, 2.45vw, 12px);
  letter-spacing: 0.025em;
}

html[data-language="en"] #shopSubscriptionPrice .shop-subscription-price-line.is-introductory {
  gap: 0.2em;
  font-size: 0.92em;
}

.shop-product-price.is-price-placeholder {
  font-size: clamp(15px, 4vw, 22px);
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.shop-product-price.is-price-placeholder.is-active-price-note {
  font-size: clamp(13px, 3.2vw, 18px);
  line-height: 1.3;
}

.shop-product-price-slash {
  margin-left: 0.08em;
  font-size: 1em;
  letter-spacing: 0;
}

.shop-product-price-unit {
  font-size: 0.8em;
  letter-spacing: 0;
  vertical-align: 0.05em;
}

.shop-product-warning {
  grid-column: 1 / -1;
  margin: 0;
  padding: 11px 12px;
  border: 2px solid rgba(24, 90, 66, .12);
  border-radius: 10px;
  background: #f5f7f5;
  color: #5d6b65;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
}

.shop-product-warning-line {
  display: block;
}

.shop-product-warning-line + .shop-product-warning-line {
  margin-top: 0.45em;
}

.shop-product-warning-line[hidden] {
  display: none;
}

.shop-subscription-manage-btn {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 46px;
  margin: 0;
  font-size: 14px;
}

.shop-purchase-btn {
  justify-self: start;
  width: calc(100% - 12px);
  min-height: 58px;
  margin: 0;
  border: 2px solid rgba(8, 105, 65, .46);
  border-radius: 999px;
  font-size: 19px;
}

.shop-subscription-action {
  display: grid;
  align-items: start;
  justify-items: stretch;
  gap: 5px;
  min-width: 0;
}

.shop-subscription-expiry {
  width: calc(100% - 12px);
  color: #5d6b65;
  font-size: clamp(10px, 2.5vw, 12px);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.shop-subscription-expiry[hidden] {
  display: none;
}

.shop-purchase-btn span {
  margin-left: 10px;
  font-size: 30px;
  line-height: 0;
}

.shop-purchase-btn:disabled {
  background: #7a9187;
  box-shadow: none;
  cursor: default;
}

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

.shop-benefits > div {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 8px;
  text-align: center;
}

.shop-benefits > div + div {
  border-left: 1px solid rgba(24, 90, 66, .13);
}

.shop-benefits span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px solid #168f57;
  border-radius: 50%;
  color: #168f57;
  font-size: 17px;
  font-weight: 1000;
}

.shop-benefit-ad {
  text-decoration: line-through;
}

.shop-benefit-rocket {
  font-size: 24px !important;
  border: 0 !important;
}

.shop-benefit-shield {
  border-radius: 45% 45% 52% 52% !important;
}

.shop-benefits strong {
  color: #173d2d;
  font-size: 12px;
  line-height: 1.35;
}

.shop-benefits small {
  color: #65786f;
  font-size: 10px;
  line-height: 1.45;
}

.shop-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 11px;
  border-radius: 12px;
  background: rgba(244, 248, 246, .94);
  color: #587067;
  font-size: 12px;
  font-weight: 800;
}

.shop-coming-soon {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px dashed rgba(22, 143, 87, .4);
  border-radius: 14px;
  background: linear-gradient(135deg, #fbfffc, #edf7f1);
}

.shop-gacha-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #168f57;
  color: #fff;
  font-size: 26px;
}

.shop-coming-soon > div:nth-child(2) {
  display: grid;
  gap: 2px;
}

.shop-coming-soon span {
  color: #168f57;
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: .08em;
}

.shop-coming-soon strong {
  color: #173d2d;
  font-size: 14px;
}

.shop-coming-soon p {
  margin: 0;
  color: #65786f;
  font-size: 10px;
}

.shop-coming-soon button {
  min-width: 66px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: #dce8e1;
  color: #6e8077;
  font-weight: 900;
}

.shop-crown-coins {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 0;
  border-top: 2px solid rgba(22, 143, 87, .2);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(237, 247, 241, .48), rgba(251, 255, 252, .2));
  box-shadow: none;
}

.shop-coin-heading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.shop-coin-heading > div:last-child { display: grid; gap: 2px; }
.shop-coin-heading span { color: #168f57; font-size: 9px; font-weight: 1000; letter-spacing: .08em; }
.shop-coin-heading strong { color: #173d2d; font-size: 20px; }
.shop-coin-heading p { margin: 0; color: #65786f; font-size: 12px; }

.shop-coin-products { display: grid; gap: 9px; }

.shop-coin-product {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(92px, 32%);
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 10px 10px 14px;
  border: 2px solid rgba(22, 143, 87, .16);
  border-radius: 14px;
  background: #fff;
}

.shop-coin-product > strong { color: #173d2d; font-size: 16px; }
.shop-coin-product > span { color: #168f57; font-size: 17px; font-weight: 1000; }
.shop-coin-product > .shop-product-regional-price.is-price-placeholder {
  max-width: 88px;
  font-size: clamp(11px, 2.8vw, 14px);
  line-height: 1.15;
  text-align: center;
}
.shop-coin-product .coin-purchase-btn { min-height: 42px; margin: 0; padding: 8px 12px; border: 2px solid rgba(8, 105, 65, .46); font-size: 14px; }

.shop-coin-note { margin: 0; color: #65786f; font-size: 10px; font-weight: 700; line-height: 1.5; }

.mission-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.mission-panel > h2 {
  font-size: clamp(34px, 9vw, 48px);
  line-height: 1.08;
  text-align: center;
}

.mission-scroll-area {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 14px;
}

.mission-list {
  display: grid;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 0 14px 2px 0;
  scrollbar-width: none;
}

.mission-list::-webkit-scrollbar {
  display: none;
}

.mission-scrollbar {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 2px;
  bottom: 2px;
  width: 6px;
  border-radius: 999px;
  background: rgba(22, 143, 87, .16);
  box-shadow: inset 0 0 0 1px rgba(13, 104, 62, .08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.mission-scrollbar.is-scrollable {
  opacity: 1;
}

.mission-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 36px;
  border-radius: inherit;
  background: linear-gradient(180deg, #249b65, #075f40);
  box-shadow: 0 1px 3px rgba(7, 79, 51, .24);
}

.mission-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 2px solid rgba(20, 72, 52, .16);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #edf5f0);
  box-shadow: 0 6px 16px rgba(17, 66, 48, .08);
}

.mission-card.is-complete {
  border-color: rgba(44, 151, 102, .55);
  background: linear-gradient(180deg, #fbfff9, #e7f7ec);
}

.mission-card.is-claimed {
  border-color: rgba(189, 151, 55, .62);
  background: linear-gradient(180deg, #fffaf0, #f3ead2);
}

.mission-card h3 {
  margin: 0;
  color: #183b2b;
  font-size: clamp(15px, 3.9vw, 19px);
  line-height: 1.25;
}

.mission-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #345146;
  font-size: 13px;
  font-weight: 900;
}

.mission-meta strong {
  color: #0f6b48;
}

.mission-card.is-claimed .mission-meta strong {
  color: #8a641d;
}

.mission-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(26, 72, 53, .14);
}

.mission-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1c8c61, #e0ba48);
}

.mission-reward {
  margin: 0;
  color: #56675f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.mission-claim-btn {
  min-height: 38px;
  border: 2px solid rgba(12, 55, 125, .38);
  border-radius: 8px;
  background: linear-gradient(180deg, #176bca, #174195);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(21, 67, 132, .2);
}

.mission-claim-btn:disabled {
  border-color: #b8c4bd;
  background: #cfd7d2;
  color: #66736d;
  box-shadow: none;
}

.mission-panel > .secondary-btn {
  flex: 0 0 auto;
  margin: 10px 0 4px;
  border-width: 2px;
}

.ad-slot p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.ad-slot p strong {
  color: #34443d;
  font-size: 13px;
}

.ad-slot p small {
  color: #748078;
  font-size: 10px;
}

.shop-item {
  width: 100%;
  min-height: 96px;
}

.shop-item[hidden] {
  display: none;
}

.settings-profile {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.settings-profile span {
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.settings-profile strong {
  color: var(--muted);
  font-size: 12px;
}

.settings-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.settings-page > h2 {
  font-size: clamp(34px, 9vw, 48px);
  text-align: center;
}

.settings-scroll-shell {
  min-height: 0;
  margin: 14px 0;
}

.settings-content-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 16px 28px 16px 16px;
  overflow-y: auto;
  border: 2px solid rgba(23, 75, 56, .12);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 75, 56, .08);
}

.settings-content-card > .field:first-child {
  margin-top: 0;
}

.has-notification-badge {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e3262e;
  box-shadow: 0 2px 5px rgba(112, 8, 12, .34);
  pointer-events: none;
}

.notification-dot[hidden] {
  display: none;
}

.settings-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 12px;
}

.settings-icon-link {
  position: relative;
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 78px;
  padding: 10px 8px;
  border: 2px solid rgba(16, 148, 94, .28);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #edf7f1);
  color: #174b38;
  box-shadow: 0 7px 14px rgba(20, 77, 53, .08);
}

.settings-icon-link strong {
  font-size: 14px;
  line-height: 1.1;
}

.settings-icon-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 1;
}

.settings-x-symbol {
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 900;
}

.settings-mail-symbol {
  color: #174b38;
  font-family: Arial, sans-serif;
  font-size: 26px;
  font-weight: 900;
}

.settings-icon-link .notification-dot {
  top: 8px;
  right: 10px;
}

.settings-home-btn {
  margin-top: 0;
  flex: 0 0 auto;
  border-width: 2px;
}

html.ui-confirmation-app .settings-home-btn {
  min-height: 54px;
  font-size: 17px;
}

html.ui-confirmation-app :is(
  #friendHomeBtn,
  #ratedHomeBtn,
  #outfitHomeBtn,
  #missionsHomeBtn,
  #gachaHomeBtn,
  #shopHomeBtn,
  #settingsHomeBtn,
  #contactHomeBtn,
  #myPageHomeBtn
) {
  width: 100%;
  min-height: 56px;
  margin: 10px 0 0;
  padding: 9px 14px;
  border: 2px solid #000;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font-size: clamp(17px, 4.8vw, 21px);
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: 0 5px 12px rgba(9,52,39,.09);
}

.settings-utility-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 72%;
  gap: 4px;
  margin: auto 0 0 auto;
  padding-top: 8px;
}

.settings-utility-link {
  width: 100%;
  min-height: 28px;
  padding: 3px 6px;
  border: 2px solid #c7ceca;
  border-radius: 7px;
  background: #f7faf8;
  color: #174b38;
  box-shadow: none;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

html[data-language="en"] .settings-utility-link {
  font-size: 8.5px;
  white-space: nowrap;
}

.data-deletion-dialog {
  width: min(calc(100% - 28px), 430px);
  max-height: min(90dvh, 760px);
  padding: 0;
  border: 3px solid #102a20;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fbf7, #e7eee9);
  color: #102a20;
  box-shadow: 0 26px 70px rgba(4, 18, 13, .42);
}

.data-deletion-dialog::backdrop {
  background: rgba(4, 9, 14, .78);
}

.data-deletion-dialog-body {
  display: grid;
  gap: 8px;
  max-height: min(90dvh, 760px);
  overflow-y: auto;
  padding: 16px;
}

.data-deletion-dialog h2,
.data-deletion-dialog p {
  margin: 0;
}

.data-deletion-dialog h2 {
  font-size: clamp(20px, 5.5vw, 26px);
  line-height: 1.25;
  text-align: center;
}

.data-deletion-dialog-body > p {
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
}

.data-deletion-dialog ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 9px 12px 9px 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
  font-weight: 800;
  line-height: 1.4;
}

.data-deletion-warning {
  color: #c51f1f;
  font-size: 15px;
  text-align: center;
}

.data-deletion-dialog small {
  color: #52626c;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.data-deletion-question {
  font-size: 16px;
}

.data-deletion-message {
  min-height: 1.4em;
  color: #b42318;
  font-size: 14px;
}

.data-deletion-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.data-deletion-actions button {
  min-height: 50px;
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

.data-deletion-countdown-dialog {
  width: min(calc(100% - 40px), 360px);
  padding: 0;
  border: 3px solid #102a20;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fbf7, #e7eee9);
  color: #102a20;
  box-shadow: 0 26px 70px rgba(4, 18, 13, .42);
}

.data-deletion-countdown-dialog::backdrop {
  background: rgba(4, 9, 14, .78);
}

.data-deletion-countdown-body {
  display: grid;
  gap: 20px;
  padding: 26px 22px 22px;
}

.data-deletion-countdown-body p {
  margin: 0;
  font-size: clamp(18px, 5vw, 23px);
  font-weight: 900;
  line-height: 1.5;
  text-align: center;
}

.data-deletion-countdown-body button {
  min-height: 52px;
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

#announcementsView {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.announcements-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(calc(100% - 24px), 520px);
  min-height: calc(100% - 28px);
  margin: 14px auto;
}

.announcements-heading {
  display: grid;
  gap: 7px;
}

.announcements-heading h2 {
  color: #174b38;
  font-size: clamp(26px, 7vw, 36px);
  line-height: 1.2;
}

.announcements-heading p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.announcements-list {
  display: grid;
  gap: 10px;
}

.announcement-card {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 82px;
  padding: 14px 42px 14px 15px;
  border: 1px solid rgba(16, 148, 94, .24);
  border-radius: 12px;
  background: #fff;
  color: #173d2d;
  text-align: left;
  box-shadow: 0 7px 16px rgba(20, 77, 53, .08);
}

.announcement-card time {
  color: #6f7d76;
  font-size: 12px;
  font-weight: 800;
}

.announcement-card strong {
  font-size: 16px;
  line-height: 1.4;
}

.announcement-card-arrow {
  position: absolute;
  top: 50%;
  right: 15px;
  color: #16945e;
  font-size: 30px;
  line-height: 1;
  transform: translateY(-50%);
}

.announcements-empty {
  padding: 28px 16px;
  border-radius: 12px;
  background: #f2f6f3;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.announcements-back-btn {
  margin-top: auto;
}

.announcement-dialog {
  width: min(90vw, 400px);
  border-radius: 16px;
}

.announcement-dialog::backdrop {
  background: rgba(7, 18, 13, .66);
}

.announcement-dialog-body {
  display: grid;
  gap: 13px;
  padding: 22px 20px 20px;
}

.announcement-dialog-body time {
  color: #6f7d76;
  font-size: 12px;
  font-weight: 800;
}

.announcement-dialog-body h2 {
  color: #173d2d;
  font-size: clamp(21px, 5.8vw, 27px);
  line-height: 1.35;
}

.announcement-dialog-body p {
  color: #344a40;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.75;
  text-align: left;
  white-space: pre-line;
}

.official-x-pending-dialog .announcement-dialog-body {
  justify-items: center;
  text-align: center;
}

.official-x-pending-dialog .announcement-dialog-body p {
  text-align: center;
}

.official-x-dialog-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 900;
}

.contact-page {
  display: grid;
  gap: 16px;
  width: min(calc(100% - 24px), 520px);
  margin: 18px auto;
  padding-bottom: 22px;
}

#contactView {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.contact-page > h2 {
  margin: 0;
  font-size: clamp(28px, 8vw, 38px);
}

.contact-lead,
.contact-form-note {
  margin: 0;
  color: #4f5d58;
  line-height: 1.7;
}

.contact-info-card,
.contact-support-card {
  padding: 18px;
  border: 1px solid rgba(15, 91, 65, .18);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(17, 73, 54, .07);
}

.contact-info-card h3,
.contact-support-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.contact-info-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.3em;
  line-height: 1.6;
}

.contact-support-card {
  display: grid;
  gap: 12px;
}

.contact-support-card div {
  display: grid;
  gap: 4px;
}

.contact-support-card span {
  color: #64736d;
  font-size: 13px;
  font-weight: 800;
}

.contact-support-card code {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.contact-form-btn {
  min-height: 60px;
  font-size: 18px;
}

.contact-form-btn:disabled {
  border-color: #ccd6d1;
  background: #e8eeeb;
  color: #71807a;
  opacity: 1;
}

.rated-range-card {
  width: 100%;
  margin: 0;
  border-width: 2px;
}

#ratedView .range-btn {
  border-width: 2px;
}

#ratedView #startRatedSearchBtn {
  border: 2px solid rgba(8, 105, 65, .46);
}

#ratedView #ratedHomeBtn {
  border-width: 2px;
}

#ratedView .rated-search-note {
  border-width: 2px;
}

.transfer-settings {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.transfer-settings > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.transfer-settings > div:first-child span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.transfer-settings p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.transfer-settings code {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 800;
}

.transfer-settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.transfer-settings-actions button {
  min-height: 34px;
  padding: 4px 6px;
  border-width: 2px;
  border-color: rgba(16, 148, 94, .55);
  font-size: 12px;
}

.transfer-data-delete-btn {
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 4px 6px;
  border-width: 2px;
  border-color: rgba(16, 148, 94, .55);
  font-size: 12px;
}

.transfer-dialog .dialog-body {
  width: min(92vw, 430px);
}

.transfer-dialog .transfer-dialog-title {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 900;
  line-height: 1.3;
}

.transfer-dialog .primary-btn + .secondary-btn {
  margin-top: 10px;
}

.transfer-dialog-description {
  display: none;
}

.transfer-dialog input[readonly] {
  background: #edf2ef;
  color: #405048;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.transfer-id-field > label {
  color: var(--muted);
  font-size: 13px;
}

.transfer-id-control {
  position: relative;
}

.transfer-id-control input[type="text"] {
  padding-right: 54px;
}

.transfer-copy-btn {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 38px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--green-dark);
  place-items: center;
  transform: translateY(-50%);
}

.transfer-copy-btn:active {
  background: rgba(18, 136, 87, 0.12);
}

.transfer-copy-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.transfer-copy-status {
  min-height: 18px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.transfer-setup-notice {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #d8b55d;
  border-radius: 8px;
  background: #fff8df;
  color: #7a4b00;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  text-align: left;
}

.transfer-setup-notice p {
  margin: 0;
}

.transfer-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.transfer-message.is-error {
  color: #b3261e;
}

.transfer-message.is-success {
  color: #087847;
}

.global-ad-slot {
  position: relative;
  z-index: 200;
  flex: 0 0 auto;
  width: 100%;
  height: calc(var(--adaptive-ad-height) + var(--bottom-ad-background-strip));
  min-height: calc(var(--adaptive-ad-height) + var(--bottom-ad-background-strip));
  max-height: calc(var(--adaptive-ad-height) + var(--bottom-ad-background-strip));
  margin: 6px 0 0;
  overflow: hidden;
  background: transparent;
}

.global-ad-slot.is-ad-free {
  border-color: transparent;
  background: #000;
  box-shadow: 0 -6px 0 #000;
}

.global-ad-slot.is-ad-free > * {
  visibility: hidden;
}

.settings-ad-slot {
  margin-top: 12px;
}

.interstitial-ad {
  position: fixed;
  z-index: 400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 18, 14, .82);
}

.interstitial-ad[hidden] {
  display: none;
}

.interstitial-ad-panel {
  display: grid;
  gap: 12px;
  width: min(100%, 360px);
  min-height: 330px;
  padding: 24px;
  align-content: center;
  border: 1px dashed rgba(255,255,255,.72);
  border-radius: 14px;
  background: #f7f9f5;
  color: #173d30;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.38);
}

.interstitial-ad-panel > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 8px;
  background: #dfe6dc;
  color: #506057;
  font-weight: 900;
}

.interstitial-ad-panel h2,
.interstitial-ad-panel p {
  margin: 0;
}

.score-strip {
  display: contents;
}

.score {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 9px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(236,242,238,.97));
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 10px 24px rgba(15, 32, 22, .18);
}

.score span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 14px;
  overflow: hidden;
}

.score span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.score.black span { background: #111; color: #fff; }
.score.white span { background: #fff; color: #111; border: 1px solid #999; }

.score.black { grid-area: black; }
.score.white { grid-area: white; }

body.human-black .score.black,
body.human-white .score.white,
body:not(.human-white):not(.human-black) .score.black {
  grid-area: player;
}

body.human-black .score.white,
body.human-white .score.black,
body:not(.human-white):not(.human-black) .score.white {
  grid-area: opponent;
}

.score-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.score-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.score em {
  color: #355044;
  font-size: clamp(13px, 3.5vw, 17px);
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
}

body.cpu-game-mode:not(.rated-game-mode) .score em {
  font-size: clamp(18px, 5.2vw, 28px);
  line-height: 1.08;
}

.score strong {
  color: #10281f;
  font-size: clamp(30px, 8.5vw, 42px);
  line-height: .92;
}

.score small {
  color: #163d30;
  font-size: clamp(18px, 5.1vw, 27px);
  font-weight: 1000;
  line-height: 1.12;
}

body.local-game-mode .score small {
  display: none;
}

body.local-game-mode .score.black {
  grid-area: opponent;
}

body.local-game-mode .score.white {
  grid-area: player;
}

body.local-game-mode .score.black,
body.local-game-mode .local-opponent-message {
  transform: rotate(180deg);
}

body.local-game-mode .score.black {
  transform-origin: center;
}

body.local-game-mode .score.white {
  transform: none;
}

body.local-game-mode #gameView {
  align-content: center;
  padding: 0 14px 12px;
}

body.local-game-mode .board {
  margin: 0 auto;
}

body.local-game-mode .score {
  min-height: 68px;
  grid-template-columns: 1fr;
  padding: 10px 14px;
}

body.local-game-mode .score span {
  display: none;
}

body.local-game-mode .score em {
  font-size: clamp(19px, 5.2vw, 27px);
  line-height: 1.08;
}

body.local-game-mode .score strong {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: clamp(24px, 6.8vw, 34px);
  line-height: 1;
}

body.local-game-mode .score.black strong {
  border: 2px solid #111;
  background: #111;
  color: #fff;
}

body.local-game-mode .score.white strong {
  border: 2px solid #777;
  background: #fff;
  color: #111;
}

body.friend-room-game-mode #gameView {
  grid-template-columns: minmax(0, 1fr) 76px;
  grid-template-areas:
    "opponent resign"
    "board board"
    "message message"
    "player player";
  grid-template-rows: auto auto auto auto;
  align-content: center;
  gap: 9px;
  padding: 8px 14px 12px;
}

body.friend-room-game-mode .score {
  min-height: 68px;
  grid-template-columns: 1fr;
  padding: 10px 14px;
}

body.friend-room-game-mode .score span,
body.friend-room-game-mode .score-rating,
body.friend-room-game-mode .local-opponent-message,
body.friend-room-game-mode .turn-pill {
  display: none !important;
}

body.friend-room-game-mode .score-main {
  align-items: center;
}

body.friend-room-game-mode .score em {
  font-size: clamp(15px, 4vw, 20px);
  line-height: 1.08;
}

body.friend-room-game-mode .score strong {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: clamp(24px, 6.8vw, 34px);
  line-height: 1;
}

body.friend-room-game-mode .score.black strong {
  border: 2px solid #111;
  background: #111;
  color: #fff;
}

body.friend-room-game-mode .score.white strong {
  border: 2px solid #777;
  background: #fff;
  color: #111;
}

body.friend-room-game-mode .board {
  margin: 0 auto;
}

body.friend-room-game-mode .resign-default-slot {
  align-self: stretch;
}

body.friend-room-game-mode .resign-btn {
  width: 76px;
  min-width: 76px;
  min-height: 68px;
  padding: 0 8px;
  font-size: 17px;
}

body.friend-room-game-mode .resign-btn.is-home-button {
  align-self: center;
  width: 68px;
  height: 68px;
  min-width: 68px;
  min-height: 68px;
  padding: 0;
  border: 3px solid #8b6410;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #fff596 0 12%, #ffd848 34%, #f5a900 72%, #c77900 100%);
  color: #5b3908;
  font-size: 37px;
  line-height: 1;
  box-shadow: 0 5px 0 #79530a, 0 10px 18px rgba(67, 43, 3, .24), inset 0 0 0 2px rgba(255, 255, 255, .7);
}

body.friend-room-game-mode #message {
  min-height: 48px;
  margin: 0;
}

body.friend-room-game-mode #message.is-friend-waiting {
  display: grid;
  place-items: center;
  min-height: 58px;
  padding: 10px 12px;
  font-size: clamp(20px, 5.7vw, 29px);
  font-weight: 1000;
  line-height: 1.2;
  white-space: nowrap;
}

body.friend-room-game-mode #message.is-alert.is-friend-disconnect {
  display: block;
  width: min(calc(100vw - 20px), 430px);
  min-height: 0;
  padding: 12px 14px;
  font-size: clamp(15px, 4.4vw, 23px);
  line-height: 1.45;
  text-align: left;
  white-space: pre-line;
  overflow-wrap: normal;
  word-break: keep-all;
}

body.rated-game-mode #message.is-alert.is-online-disconnect {
  display: block;
  text-align: left;
}

/* Keep the message row reserved while the online-style pass/disconnect popup
   is fixed over the board, so the board itself never shifts. */
body.friend-room-game-mode #gameView::after {
  content: "";
  grid-area: message;
  min-height: 48px;
  visibility: hidden;
}

body.friend-room-game-mode .score-info > small:not(.score-rating) {
  display: block;
  font-size: clamp(23px, 6.5vw, 34px);
  line-height: 1;
}

body.friend-room-game-mode .disc.is-placed,
body.friend-room-game-mode .disc.is-flipped {
  animation-duration: .14s;
}

body.cpu-game-mode.human-black .score.black small,
body.cpu-game-mode.human-white .score.white small {
  font-size: clamp(24px, 7.2vw, 38px);
  letter-spacing: 0;
}

body.cpu-game-mode.human-black .score.white small,
body.cpu-game-mode.human-white .score.black small,
.score small:empty {
  display: none;
}

.score.is-low {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(227, 91, 83, .16);
}

body.enhanced-game-mode .score {
  grid-template-columns: 158px minmax(0, 1fr);
  gap: 6px;
  min-height: 130px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.enhanced-game-mode .score-info {
  position: relative;
  align-self: center;
  align-content: center;
  min-height: 114px;
  padding: 10px 60px 10px 12px;
  border: 2px solid rgba(17,75,52,.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(236,242,238,.97));
  box-shadow: 0 10px 24px rgba(15,32,22,.16);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.ai-player-color-badge[hidden] {
  display: none !important;
}

html.ui-confirmation-app body.ai-game-mode:not(.replay-practice-game-mode) .ai-player-color-badge {
  position: absolute;
  top: -14px;
  left: 10px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 10px 4px 7px;
  border: 2px solid rgba(17,75,52,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.98);
  color: #173f33;
  box-shadow: 0 3px 8px rgba(15,32,22,.12);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

html.ui-confirmation-app body.rated-game-mode:not(.replay-practice-game-mode) .ai-player-color-badge {
  position: absolute;
  top: -21px;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: max-content;
  max-width: calc(100% - 20px);
  min-height: 29px;
  padding: 5px 11px 5px 8px;
  border: 2px solid rgba(17,75,52,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.98);
  color: #173f33;
  box-shadow: 0 3px 8px rgba(15,32,22,.12);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
}

html.ui-confirmation-app body:is(
  [data-active-view="friend"],
  [data-active-view="rated"],
  [data-active-view="outfit"],
  [data-active-view="missions"],
  [data-active-view="gacha"],
  [data-active-view="shop"],
  [data-active-view="settings"],
  [data-active-view="contact"]
) main::after {
  content: "";
  position: fixed;
  bottom: calc(var(--global-ad-space) - 16px);
  left: 50%;
  z-index: 39;
  width: min(100%, 480px);
  height: 88px;
  border-top: 1px solid rgba(16,76,57,.12);
  background: #fff;
  transform: translateX(-50%);
  pointer-events: none;
}

html.ui-confirmation-app :is(
  #friendView .friend-flow-screen,
  .rated-screen,
  .outfit-panel,
  .mission-panel,
  .gacha-screen,
  .shop-panel,
  .settings-page,
  .contact-page
) {
  padding-bottom: 88px;
}

html.ui-confirmation-app body.rated-game-mode:not(.replay-practice-game-mode) .ai-player-color-disc {
  flex-basis: 15px;
  width: 15px;
  height: 15px;
}

html.ui-confirmation-app body.replay-practice-game-mode .ai-player-color-badge {
  position: absolute;
  top: -44px;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: max-content;
  max-width: calc(100% - 20px);
  min-height: 34px;
  padding: 6px 14px;
  border: 2px solid rgba(22, 117, 83, .38);
  border-radius: 999px;
  background: rgba(255, 255, 255, .97);
  color: #173f33;
  box-shadow: 0 4px 10px rgba(15, 73, 53, .14);
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
}

html.ui-confirmation-app body.replay-practice-game-mode .ai-player-color-disc {
  flex-basis: 18px;
  width: 18px;
  height: 18px;
}

.ai-player-color-badge b {
  font: inherit;
}

.ai-player-color-disc {
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.16), 0 1px 2px rgba(0,0,0,.16);
}

.ai-player-color-badge.is-black .ai-player-color-disc {
  background: #111;
}

.ai-player-color-badge.is-white .ai-player-color-disc {
  border: 1px solid #777;
  background: #fff;
}

html.ui-confirmation-app body.ai-game-mode:not(.replay-practice-game-mode).human-black .score.black .score-main em,
html.ui-confirmation-app body.ai-game-mode:not(.replay-practice-game-mode).human-white .score.white .score-main em {
  transform: translateY(12px);
}

html.ui-confirmation-app body.ai-game-mode:not(.replay-practice-game-mode).human-black .score.black .score-main,
html.ui-confirmation-app body.ai-game-mode:not(.replay-practice-game-mode).human-white .score.white .score-main {
  overflow: visible;
}

.replay-practice-opponent-stats {
  display: grid;
  order: 2;
  gap: 3px;
  min-width: 0;
  padding-right: 6px;
  color: #111;
  font-variant-numeric: tabular-nums;
}

.replay-practice-opponent-stats[hidden] {
  display: none !important;
}

body.replay-practice-game-mode .score .replay-practice-opponent-rating,
body.replay-practice-game-mode .score .replay-practice-opponent-record,
body.replay-practice-game-mode .score .replay-practice-opponent-rate {
  display: block;
  grid-row: auto;
  place-items: initial;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  overflow: hidden;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-practice-opponent-rating,
.replay-practice-opponent-record,
.replay-practice-opponent-rate {
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 900;
}

body.replay-practice-game-mode .score-info.has-replay-practice-opponent-stats .score-main em {
  font-size: clamp(13px, 3.5vw, 16px);
  line-height: 1.15;
}

body.enhanced-game-mode.ai-game-mode .score.has-ai-robot .score-info::before {
  content: "";
  position: absolute;
  left: -174px;
  top: -18px;
  z-index: 6;
  width: 168px;
  height: 184px;
  background-position: center top;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.28));
  pointer-events: none;
}

body.enhanced-game-mode.ai-game-mode .score.ai-robot-beginner .score-info::before {
  background-image: url("assets/characters/ai-robot-level-01-10.webp?v=20260630-robot-alpha-01");
}

body.enhanced-game-mode.ai-game-mode .score.ai-robot-intermediate .score-info::before {
  background-image: url("assets/characters/ai-robot-level-11-20.webp?v=20260630-robot-alpha-01");
}

body.enhanced-game-mode.ai-game-mode .score.ai-robot-advanced .score-info::before {
  background-image: url("assets/characters/ai-robot-level-21-30.webp?v=20260630-robot-alpha-01");
}

body.enhanced-game-mode.ai-game-mode .score.ai-robot-secret .score-info::before {
  background-image: url("assets/characters/ai-robot-level-99-transparent-20260702.webp?v=20260702-robot-alpha-04");
}

body.enhanced-game-mode .score-info.is-active-turn {
  border-color: #20c978;
  background: linear-gradient(180deg, rgba(246,255,250,.99), rgba(224,248,235,.99));
  box-shadow:
    0 0 0 3px rgba(32,201,120,.2),
    0 0 22px rgba(32,201,120,.42),
    0 10px 24px rgba(15,32,22,.18);
}

body.rated-game-mode.human-black .score.black.is-low .score-info,
body.rated-game-mode.human-white .score.white.is-low .score-info {
  border-color: #ef3f3f;
  background: linear-gradient(180deg, rgba(255,249,249,.99), rgba(255,225,225,.99));
  box-shadow:
    0 0 0 3px rgba(239,63,63,.2),
    0 0 24px rgba(239,63,63,.5),
    0 10px 24px rgba(75,15,15,.2);
}

body.enhanced-game-mode .score > span {
  grid-row: 1 / span 3;
  width: 158px;
  height: 150px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.enhanced-game-mode .score.black > span,
body.enhanced-game-mode .score.white > span {
  border: 0;
  background: transparent;
}

body.enhanced-game-mode .score > span.is-ai-robot {
  position: relative;
  z-index: 2;
  overflow: visible;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

body.enhanced-game-mode .score > span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.28);
  transform-origin: center top;
}

body.enhanced-game-mode .score-main {
  display: block;
  order: 1;
  min-width: 0;
}

body.enhanced-game-mode.ai-game-mode .score em {
  display: block;
  overflow: hidden;
  font-size: clamp(18px, 4.8vw, 24px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.enhanced-game-mode.human-black .score.white .score-info,
body.enhanced-game-mode.human-white .score.black .score-info {
  transform: none;
}

body.enhanced-game-mode.human-black .score.black .score-info,
body.enhanced-game-mode.human-white .score.white .score-info {
  transform: translateY(clamp(10px, 1.6vh, 15px));
}

body.enhanced-game-mode .score strong {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  align-content: center;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 21px;
  line-height: 1;
}

body.ai-game-mode.human-black .score.white > span,
body.ai-game-mode.human-white .score.black > span {
  visibility: hidden;
}

/* What-If Matches keep the recorded online opponent's character and outfit.
   Robot opponents continue to use the existing full-size robot presentation. */
body.ai-game-mode.replay-practice-game-mode.human-black .score.white.replay-practice-character-opponent > span,
body.ai-game-mode.replay-practice-game-mode.human-white .score.black.replay-practice-character-opponent > span {
  visibility: visible;
}

body.enhanced-game-mode .score.black strong {
  border: 2px solid #111;
  background: #111;
  color: #fff;
}

body.enhanced-game-mode .score.white strong {
  border: 2px solid #777;
  background: #fff;
  color: #111;
}

body.enhanced-game-mode .score small {
  display: block !important;
  color: #245241;
  line-height: 1.2;
}

body.enhanced-game-mode .score .score-rating {
  order: 2;
  color: #0b7148;
  font-size: clamp(14px, 3.8vw, 18px) !important;
  font-weight: 1000;
}

body.enhanced-game-mode .score .score-rating:empty {
  display: none !important;
}

body.enhanced-game-mode .score-info > small:empty {
  display: none !important;
}

body.enhanced-game-mode .score-info > small:not(.score-rating) {
  order: 3;
  color: #10281f;
  font-size: clamp(20px, 5.5vw, 28px) !important;
  font-weight: 1000;
  letter-spacing: -.04em;
  white-space: nowrap;
}

body.enhanced-game-mode .score-info > small:not(.score-rating)::before {
  content: "タイマー";
  display: block;
  margin-bottom: 2px;
  color: #587067;
  font-size: 10px;
  letter-spacing: 0;
}

.score-resign-slot {
  display: none;
}

.resign-default-slot {
  grid-area: resign;
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
}

html[data-language="en"] body.enhanced-game-mode .score-info > small:not(.score-rating)::before {
  content: "Timer";
}

body.enhanced-game-mode .resign-default-slot {
  display: none;
}

body.enhanced-game-mode .score-resign-slot {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  width: 56px;
}

body.takeback-enabled .score-resign-slot {
  left: 12px;
  right: 12px;
  bottom: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: auto;
}

body.takeback-enabled.human-black .score.black .score-info,
body.takeback-enabled.human-white .score.white .score-info {
  align-content: start;
  min-height: 138px;
  padding: 12px 58px 64px 14px;
}

body.takeback-enabled.human-black .score.black .score-main,
body.takeback-enabled.human-white .score.white .score-main {
  width: 100%;
  overflow: hidden;
}

body.takeback-enabled.human-black .score.black em,
body.takeback-enabled.human-white .score.white em {
  max-width: 100%;
  font-size: clamp(17px, 4.5vw, 23px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.enhanced-game-mode .score-resign-slot:empty {
  display: none;
}

body.enhanced-game-mode .score-resign-slot .resign-btn {
  grid-area: auto;
  align-self: end;
  width: 56px;
  height: 48px;
  min-width: 56px;
  min-height: 48px;
  padding: 0 6px;
  border-radius: 12px;
  font-size: 15px;
}

.takeback-btn {
  min-width: 74px;
  min-height: 56px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 8px;
  background: linear-gradient(180deg, #3d9fe7, #1763ad);
  color: #fff;
  font-size: 16px;
  font-weight: 1000;
  box-shadow: 0 10px 22px rgba(22, 74, 126, .22), inset 0 1px 0 rgba(255,255,255,.42);
}

.takeback-btn small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  line-height: 1;
}

.takeback-btn:disabled {
  opacity: .48;
  box-shadow: none;
}

body.takeback-enabled .score-resign-slot .takeback-btn {
  align-self: end;
  width: 100%;
  height: 48px;
  min-width: 56px;
  min-height: 48px;
  padding: 0 4px;
  border-radius: 12px;
  font-size: 14px;
}

body.takeback-enabled .score-resign-slot .resign-btn {
  width: 100%;
}

body.standard-ai-no-timer #blackTimer,
body.standard-ai-no-timer #whiteTimer {
  display: none !important;
}

.rewarded-takeback-ad {
  z-index: 120;
}

#takebackConfirm .resign-actions > button,
#replayPracticeHintConfirm .resign-actions > button {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 10px 12px;
}

#takebackConfirm .resign-dialog h2 {
  width: fit-content;
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(19px, 5.8vw, 26px);
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
}

#takebackConfirm .resign-dialog h2.is-ad-supported {
  font-size: clamp(15px, 4.7vw, 22px);
}

#replayPracticeHintConfirm .resign-dialog {
  width: min(100%, 370px);
}

#replayPracticeHintConfirm .resign-dialog h2 {
  width: fit-content;
  max-width: 100%;
  margin-right: auto;
  margin-bottom: 16px;
  margin-left: auto;
  font-size: clamp(17px, 5.3vw, 23px);
  line-height: 1.4;
  text-align: center;
  white-space: pre-line;
}

#replayPracticeHintConfirm .resign-dialog h2.is-ad-supported {
  width: 100%;
  font-size: clamp(15px, 4.7vw, 23px);
  text-align: left;
}

#replayPracticeHintSubscriberNote {
  width: 100%;
  margin: -6px 0 16px;
  color: #52645d;
  font-size: clamp(11.5px, 3.5vw, 18px);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

#replayPracticeHintSubscriberNote[hidden] {
  display: none;
}

body.enhanced-game-mode #message {
  display: none;
}

body.enhanced-game-mode #message.is-alert {
  display: grid;
  min-height: 58px;
  margin: 6px 0;
  padding: 10px 16px;
  place-items: center;
  border: 1px solid rgba(17, 107, 67, .28);
  border-radius: 10px;
  background: rgba(236, 250, 242, .98);
  color: #0b7148;
  font-size: clamp(20px, 5.6vw, 30px);
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

body.enhanced-game-mode .board {
  margin-top: 0;
}

body.enhanced-game-mode #gameView {
  grid-template-rows: minmax(150px, 1fr) auto auto auto minmax(150px, 1fr) 0;
  row-gap: 0;
}

body.enhanced-game-mode .score,
body.enhanced-game-mode.human-black .score.black,
body.enhanced-game-mode.human-white .score.white {
  align-self: center;
}

.game-ad-slot {
  grid-area: ad;
}

.global-ad-slot {
  width: 100%;
  height: calc(var(--adaptive-ad-height) + var(--bottom-ad-background-strip));
  min-height: calc(var(--adaptive-ad-height) + var(--bottom-ad-background-strip));
  max-height: calc(var(--adaptive-ad-height) + var(--bottom-ad-background-strip));
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  flex: 0 0 calc(var(--adaptive-ad-height) + var(--bottom-ad-background-strip));
}

html.ui-confirmation-app .global-ad-slot {
  background: #000;
  box-shadow: 0 -6px 0 #000;
}

html.ui-confirmation-app .global-ad-slot {
  display: none !important;
}

.turn-pill {
  display: none;
  min-height: 48px;
  place-items: center;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #111, #2a2a2a);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.turn-pill.white-turn {
  background: #fff;
  color: #111;
  border: 1px solid #aaa;
}

.resign-btn {
  grid-area: resign;
  align-self: stretch;
  min-width: 74px;
  min-height: 56px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 8px;
  background: linear-gradient(180deg, #fc7b72, #b72f2c);
  color: #fff;
  font-size: 18px;
  font-weight: 1000;
  box-shadow: 0 10px 22px rgba(103, 24, 24, .22), inset 0 1px 0 rgba(255,255,255,.42);
}

body.local-game-mode .resign-btn {
  min-width: 58px;
  border-color: rgba(31, 73, 58, .2);
  background: linear-gradient(180deg, #fff, #e8f0ec);
  color: #14382b;
  font-size: 34px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(15, 32, 22, .16), inset 0 1px 0 rgba(255,255,255,.8);
}

.board {
  grid-area: board;
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 452px;
  margin: clamp(32px, 7vh, 60px) auto 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  padding: 8px;
  gap: 2px;
  border: 6px solid #13261d;
  border-radius: 10px;
  background: #0b4d32;
  box-shadow:
    0 18px 38px rgba(13, 34, 22, .32),
    0 4px 0 #071c12,
    inset 0 0 0 2px rgba(0,0,0,.18);
  touch-action: manipulation;
}

.opponent-turn-indicator {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  padding: 7px 13px 7px 9px;
  border: 1px solid rgba(242, 184, 75, .62);
  border-radius: 999px;
  background: rgba(7, 28, 18, .78);
  color: #fff;
  font-size: clamp(13px, 3.8vw, 18px);
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .24);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.opponent-turn-indicator[hidden] {
  display: none;
}

.board-room-code {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 55;
  display: grid;
  justify-items: center;
  gap: 5px;
  width: min(68%, 290px);
  padding: 16px 20px 18px;
  border: 3px solid #f2c74f;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 68, 45, .97), rgba(4, 48, 32, .98));
  color: #fff;
  box-shadow: 0 8px 0 #9f7516, 0 15px 25px rgba(0, 0, 0, .26), inset 0 0 0 2px rgba(255, 255, 255, .08);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.board-room-code span {
  font-size: clamp(15px, 4.5vw, 22px);
  font-weight: 950;
  line-height: 1.15;
}

.board-room-code strong {
  color: #ffdc62;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(45px, 14vw, 72px);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: .18em;
  text-indent: .18em;
}

.opponent-turn-crown {
  display: inline-grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #f2b84b;
  font-size: 22px;
  line-height: 1;
  transform-origin: center;
  animation: opponent-turn-crown-spin .8s linear infinite;
}

@keyframes opponent-turn-crown-spin {
  to { transform: rotate(360deg); }
}

.message {
  grid-area: message;
}

.local-turn-message {
  display: none;
  grid-area: opponent-message;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #102a20;
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  text-align: center;
  font-weight: 1000;
  box-shadow: 0 10px 24px rgba(16, 42, 32, .18);
}

body.local-game-mode .local-turn-message {
  display: grid;
  place-items: center;
}

body.local-game-mode .local-turn-message.is-alert {
  min-height: 48px;
  border: 2px solid rgba(255,255,255,.8);
  background: linear-gradient(180deg, rgba(17,67,50,.96), rgba(8,38,30,.98));
  font-size: clamp(17px, 4.8vw, 24px);
  box-shadow: 0 16px 38px rgba(0,0,0,.28);
}

.local-pass-notice {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  z-index: 40;
  display: grid;
  place-items: center;
  width: min(calc(100vw - 28px), 430px);
  min-height: 82px;
  padding: 14px 16px;
  transform: translate(-50%, -50%);
  isolation: isolate;
  color: #fff;
  font-size: clamp(24px, 7vw, 36px);
  font-weight: 1000;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0,0,0,.3);
  pointer-events: none;
}

.local-pass-notice[hidden] {
  display: none;
}

.local-pass-notice::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(17,67,50,.97), rgba(8,38,30,.98));
  box-shadow: 0 16px 38px rgba(0,0,0,.3);
}

.local-pass-notice::before {
  z-index: -1;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  border: 0;
  border-radius: 3px;
  background: #158f57;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.28),
    0 1px 1px rgba(0,0,0,.14);
  perspective: 520px;
}

.cell::before {
  content: none;
}

.cell.guide::after {
  content: "";
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(255, 211, 91, .95);
  box-shadow: 0 0 0 4px rgba(255, 211, 91, .18);
}

.disc {
  position: relative;
  width: 94%;
  height: 94%;
  border-radius: 50%;
  box-shadow: none;
  transform: scale(.96);
  transform-style: preserve-3d;
}

.disc::before {
  content: none;
}

.disc.black {
  background: radial-gradient(circle at 42% 38%, #333 0, #151515 58%, #050505 100%);
}

.disc.white {
  background: radial-gradient(circle at 42% 38%, #fff 0, #f1f3ef 62%, #cbd1cb 100%);
}

.disc.is-placed {
  animation: discPlace .22s ease-out;
}

.disc.is-flipped {
  background:
    linear-gradient(90deg,
      #f7f8f5 0 23%,
      #d2c091 37%,
      #80613d 50%,
      #1a1a1a 63%,
      #020202 100%);
  box-shadow: none;
  animation: discFlip .22s cubic-bezier(.22,.8,.22,1) both;
}

.disc.is-flipped::before,
.disc.is-flipped::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  box-shadow: none;
}

.disc.is-flipped::after {
  transform: rotateY(180deg);
}

.disc.black.is-flipped::before,
.disc.white.is-flipped::after {
  background:
    radial-gradient(circle at 32% 24%, #fff 0 15%, #eef1ed 46%, #c7cec7 100%);
}

.disc.white.is-flipped::before,
.disc.black.is-flipped::after {
  background:
    radial-gradient(circle at 32% 24%, #666 0 13%, #171717 55%, #000 100%);
}

.disc.is-flipped::before {
  outline: 1px solid rgba(0,0,0,.32);
}

.disc.is-flipped::after {
  outline: 1px solid rgba(255,255,255,.28);
}

@keyframes discPlace {
  from { transform: scale(.24); opacity: .35; }
  to { transform: scale(.96); opacity: 1; }
}

@keyframes discFlip {
  0% {
    transform: scale(.96) rotateY(0deg);
  }
  28% {
    transform: scale(.96) rotateY(54deg);
  }
  44% {
    transform: scale(.96) rotateY(82deg);
    box-shadow: 0 8px 14px rgba(0,0,0,.38);
  }
  49% {
    transform: scale(.96) rotateY(90deg);
    box-shadow:
      0 8px 14px rgba(0,0,0,.38),
      inset 0 0 0 4px rgba(126, 93, 55, .88);
  }
  54% {
    transform: scale(.96) rotateY(92deg);
    box-shadow:
      0 8px 14px rgba(0,0,0,.38),
      inset 0 0 0 4px rgba(126, 93, 55, .88);
  }
  64% {
    transform: scale(.96) rotateY(112deg);
  }
  78% {
    transform: scale(.96) rotateY(142deg);
  }
  100% {
    transform: scale(.96) rotateY(180deg);
  }
}

.game-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.match-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.match-info div {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #c8d4ca;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f2f6f1);
}

.match-info span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.match-info strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1;
}

.message {
  min-height: 42px;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #102a20;
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(16, 42, 32, .18);
}

.resign-confirm {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(8, 18, 14, .48);
  backdrop-filter: blur(3px);
}

.resign-confirm[hidden] {
  display: none;
}

.resign-dialog {
  width: min(100%, 330px);
  padding: 22px 18px 18px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(236,242,238,.98));
  color: #10281f;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
}

.resign-dialog h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 1000;
  line-height: 1.2;
}

.resign-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.yes-no-choice-btn {
  font-size: 18px !important;
}

.danger-btn {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #f06f66, #b72f2c);
  color: #fff;
  font-size: 18px;
  font-weight: 1000;
  box-shadow: 0 10px 20px rgba(130, 28, 28, .22);
}

.message.is-alert {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 40;
  min-width: min(92vw, 430px);
  min-height: 82px;
  display: grid;
  place-items: center;
  margin: 0;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,.8);
  background: linear-gradient(180deg, rgba(17,67,50,.96), rgba(8,38,30,.98));
  color: #fff;
  font-size: clamp(24px, 6.4vw, 36px);
  white-space: nowrap;
  box-shadow: 0 22px 54px rgba(0,0,0,.34);
}

/* Pass notices must stay at the viewport center on every device. */
body.game-mode #message.is-alert.is-pass-notice {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  margin: 0;
  transform: translate(-50%, -50%);
}

body.enhanced-game-mode #message.is-alert,
.message.is-alert {
  width: min(calc(100vw - 28px), 430px);
  min-width: 0;
  padding: 14px 16px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 10, 9, .76);
  backdrop-filter: blur(1.5px);
}

.my-page-outfit-btn {
  display: grid;
  place-items: center;
}

.ai-robot-avatar {
  position: relative !important;
  z-index: 3 !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center top !important;
  background: transparent !important;
  transform: scale(1.55) translateY(-2%) !important;
  transform-origin: center top !important;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.26));
}

.outfit-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.outfit-panel > h2 {
  margin-bottom: 6px;
  font-size: clamp(20px, 5.3vw, 25px);
  line-height: 1.2;
  white-space: nowrap;
}

.outfit-panel > .hint {
  margin-top: 0;
  font-size: clamp(13px, 3.45vw, 16px);
  line-height: 1.45;
}

.outfit-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  height: 100%;
  min-height: 0;
  margin-top: 0;
  padding: 10px 24px 10px 10px;
  overflow: auto;
  border: 1px solid rgba(20, 72, 52, .16);
  border-radius: 10px;
  background: rgba(239, 246, 241, .72);
}

.outfit-scroll-shell {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 12px;
}

.characters-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.characters-panel > h2,
.characters-panel > .hint {
  flex: 0 0 auto;
}

.character-list-scroll-shell {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 12px;
}

.character-list-scroll-shell .character-list {
  height: 100%;
  overflow-y: auto;
  align-content: start;
  padding-right: 16px;
}

.outfit-character-group {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 2px solid color-mix(in srgb, var(--outfit-character-color) 55%, #ffffff);
  border-left-width: 7px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--outfit-character-color) 8%, #ffffff);
}

.outfit-character-group-title {
  margin: 0;
  padding: 2px 4px 8px;
  border-bottom: 2px solid color-mix(in srgb, var(--outfit-character-color) 38%, #ffffff);
  color: #173e2e;
  font-size: 16px;
  line-height: 1.2;
}

.outfit-character-group-title .notification-dot {
  top: 1px;
  right: 4px;
}

.outfit-option .notification-dot {
  top: 7px;
  right: 8px;
}

.outfit-character-group-options {
  display: grid;
  gap: 8px;
}

.outfit-default-row {
  position: relative;
}

.outfit-default-row > .outfit-option {
  width: 100%;
  padding-right: 68px;
}

.outfit-expand-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 7px;
  transform: translateY(-50%);
  border: 2px solid color-mix(in srgb, var(--outfit-character-color) 45%, #b8c7c1);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #e8f1ed);
  color: #174d38;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.outfit-expand-toggle.is-expanded {
  padding: 7px 0 0;
  transform: translateY(-50%) rotate(180deg);
}

.outfit-character-extra-options {
  display: grid;
  gap: 8px;
}

.outfit-character-extra-options[hidden] {
  display: none;
}

.outfit-character-section {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(20, 72, 52, .16);
  border-radius: 10px;
  background: rgba(239, 246, 241, .72);
}

.outfit-character-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border: 2px solid rgba(20, 72, 52, .16);
  border-radius: 10px;
  background: #fff;
  color: #183b2b;
  text-align: left;
}

.outfit-character-row.is-selected {
  border-color: #1b9b67;
  box-shadow: 0 0 0 2px rgba(27,155,103,.18);
}

.outfit-character-section.is-locked {
  background: #eef1f0;
}

.shop-billing-note {
  margin: 12px 2px 0;
  color: #587067;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.shop-panel > .secondary-btn {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-height: 52px;
  margin: 10px 0 0;
  border: 2px solid var(--line);
  background: #eef2ed;
  color: var(--ink);
}

.outfit-character-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.outfit-character-option {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 6px;
  border: 2px solid rgba(20, 72, 52, .16);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #edf5f0);
  color: #183b2b;
}

.outfit-character-option.is-selected {
  border-color: #1b9b67;
  box-shadow: 0 0 0 2px rgba(27,155,103,.18);
}

.outfit-character-option.is-locked {
  background: #e6ebea;
  color: #65716e;
  opacity: 1;
}

.outfit-character-art {
  display: grid;
  place-items: center;
  height: 72px;
  overflow: hidden;
  border-radius: 7px;
  background: #d8e1df;
  font-size: 34px;
  font-weight: 900;
}

.outfit-character-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.outfit-character-option strong {
  overflow: hidden;
  font-size: 11px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outfit-option {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 8px 12px;
  border: 2px solid rgba(20, 72, 52, .16);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #edf5f0);
  color: #183b2b;
  text-align: left;
}

.outfit-option.is-selected {
  border-color: #1b9b67;
  outline: 3px solid #1b9b67;
  outline-offset: 2px;
  box-shadow:
    inset 0 0 0 2px rgba(27,155,103,.18),
    0 0 0 2px rgba(27,155,103,.08);
}

.outfit-option:disabled {
  opacity: .66;
}

.outfit-thumbnail {
  display: grid;
  place-items: center;
  width: 72px;
  height: 68px;
  overflow: hidden;
  border-radius: 8px;
  background: #d8e1df;
  color: #5a6865;
  font-size: 11px;
  font-weight: 900;
}

.outfit-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.outfit-option-copy {
  display: grid;
  gap: 5px;
}

.outfit-option-copy strong {
  font-size: 16px;
}

.outfit-option-copy small {
  color: #587067;
  font-size: 12px;
  font-weight: 800;
}

.outfit-option-copy .outfit-initial-choice {
  display: block;
  text-align: left;
}

.outfit-panel > .secondary-btn {
  flex: 0 0 auto;
  margin: 10px 0 4px;
}

/* UI confirmation app: mirror the simpler Daifugo Crown character picker. */
html.ui-confirmation-app .outfit-panel {
  padding-right: 0;
  padding-left: 0;
}

html.ui-confirmation-app .outfit-panel > h2 {
  display: block;
  margin: 4px 0 22px;
  width: 100%;
  padding: 0;
  color: #075f40;
  font-size: clamp(23px, 6.25vw, 29px);
  line-height: 1.15;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  text-shadow: none;
  filter: none;
}

html.ui-confirmation-app .outfit-panel > .hint {
  display: none;
}

html.ui-confirmation-app .outfit-list {
  gap: 0;
  padding: 7px 15px 7px 7px;
  border: 1px solid #b9b9b4;
  border-radius: 13px;
  background: #faf8f2;
}

html.ui-confirmation-app .outfit-character-group {
  gap: 7px;
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

html.ui-confirmation-app .outfit-character-group-title {
  margin: 0 0 6px;
  padding: 0 2px 6px;
  border-bottom: 2px solid #6f767a;
  color: #171717;
  font-size: clamp(18px, 4.8vw, 22px);
  font-weight: 900;
  line-height: 1.15;
}

html.ui-confirmation-app .outfit-default-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 96px;
  padding: 8px 10px;
  border: 2px solid #6f767a;
  border-radius: 13px;
  background: #fff;
  color: #171717;
}

html.ui-confirmation-app .outfit-default-row.has-toggle {
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: 10px;
}

html.ui-confirmation-app .outfit-default-row.is-selected {
  border-color: #087a55;
  background: #fff;
  outline: 3px solid #087a55;
  outline-offset: 2px;
}

html.ui-confirmation-app .outfit-default-row > .outfit-option {
  min-height: 76px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: 0;
  box-shadow: none;
}

html.ui-confirmation-app .outfit-option {
  width: 100%;
  min-height: 96px;
  padding: 8px 10px;
  border: 2px solid #6f767a;
  border-radius: 13px;
  background: #fff;
  color: #171717;
  box-shadow: none;
}

html.ui-confirmation-app .outfit-thumbnail {
  width: 74px;
  height: 74px;
  border: 1px solid #252525;
  border-radius: 11px;
  background: #fff;
}

html.ui-confirmation-app .outfit-option {
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
}

html.ui-confirmation-app .outfit-option-copy strong {
  color: #111;
  font-size: 18px;
  font-weight: 900;
}

html.ui-confirmation-app .outfit-expand-toggle {
  position: static;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid #6f767a;
  border-radius: 11px;
  background: #fff;
  color: transparent;
  font-size: 0;
  box-shadow: none;
  transform: none;
}

html.ui-confirmation-app .outfit-expand-toggle::before {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  border-right: 4px solid #087a55;
  border-bottom: 4px solid #087a55;
  transform: rotate(45deg);
}

html.ui-confirmation-app .outfit-expand-toggle.is-expanded {
  padding: 0;
  transform: none;
}

html.ui-confirmation-app .outfit-expand-toggle.is-expanded::before {
  transform: rotate(225deg);
}

html.ui-confirmation-app .outfit-scroll-shell .custom-scrollbar {
  right: 3px;
  width: 9px;
  background: #e2e2df;
  box-shadow: none;
}

html.ui-confirmation-app .outfit-scroll-shell .custom-scrollbar-thumb {
  min-height: 34px;
  border: 2px solid #e2e2df;
  background: #087a55;
  box-shadow: none;
}

.result-overlay.is-win {
  animation: resultBoardDim .28s ease-out both;
}

.result-overlay.is-replay-practice-transition,
.result-overlay.is-replay-practice-transition.is-win {
  background: rgba(5, 10, 9, .76);
  backdrop-filter: blur(1.5px);
  animation: none;
}

.result-overlay[hidden] {
  display: none;
}

.result-cutscene {
  position: relative;
  display: grid;
  align-content: end;
  justify-items: center;
  width: min(100%, 430px);
  min-height: min(76dvh, 690px);
  padding: 16px 14px 18px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.result-cutscene[hidden] {
  display: none;
}

.result-cutscene-stage {
  position: absolute;
  inset: 0 0 94px;
  display: grid;
  place-items: end center;
  padding-top: 12px;
  overflow: visible;
}

.result-cutscene-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: min(90%, 350px);
  height: min(114%, 700px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.result-overlay.is-win .result-cutscene-stage::before,
.result-overlay.is-lose .result-cutscene-stage::before {
  display: none;
}

.result-cutscene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-cutscene[data-sequence="video"] .result-cutscene-video {
  z-index: 2;
  object-fit: cover;
  clip-path: ellipse(41% 47% at 50% 52%);
  filter: none;
}

.result-cutscene-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 22px 28px rgba(0,0,0,.45));
}

.result-cutscene-canvas[hidden] {
  display: none;
}

.result-cutscene-image {
  position: relative;
  z-index: 2;
  width: min(86%, 330px);
  max-height: 78%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,.38));
}

.result-cutscene-image[hidden] {
  display: none;
}

.result-cutscene-fallback {
  position: absolute;
  left: 50%;
  top: 18px;
  z-index: 4;
  display: grid;
  gap: 4px;
  width: min(86%, 330px);
  padding: 10px 12px;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 8px;
  background: rgba(9, 20, 24, .74);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(7px);
}

.result-cutscene-fallback[hidden] {
  display: none;
}

.result-cutscene-fallback span {
  font-size: 15px;
  font-weight: 1000;
}

.result-cutscene-fallback small {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  opacity: .82;
}

.result-cutscene-burst {
  position: absolute;
  inset: 12% 8% 18%;
  z-index: 1;
  border-radius: 50%;
  background:
    conic-gradient(from 10deg, transparent 0 8deg, rgba(255,230,132,.5) 8deg 11deg, transparent 11deg 32deg),
    radial-gradient(circle, rgba(255,245,181,.5), transparent 54%);
  opacity: .68;
  animation: resultBurst 2.8s ease-out both;
}

.result-cutscene-copy {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  width: 100%;
  margin-top: auto;
  padding: 0 12px 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  backdrop-filter: none;
}

.result-cutscene-copy span {
  color: #fff;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: clamp(60px, 18vw, 92px);
  line-height: .88;
  font-weight: 1000;
  letter-spacing: 0;
  -webkit-text-stroke: 0;
  text-rendering: geometricPrecision;
  text-shadow:
    0 5px 0 rgba(0,0,0,.35),
    0 18px 34px rgba(0,0,0,.46);
}

.result-overlay.is-local-result {
  background: rgba(3, 10, 8, .72);
}

.result-overlay.is-local-result .result-cutscene {
  width: 100%;
  min-height: 100dvh;
  padding: 0;
  align-content: stretch;
  background: transparent;
}

.result-overlay.is-local-result .result-cutscene-stage,
.result-overlay.is-local-result .result-cutscene-burst,
.result-overlay.is-local-result .result-cutscene-image,
.result-overlay.is-local-result .result-cutscene-video,
.result-overlay.is-local-result .result-cutscene-canvas {
  display: none;
}

.result-overlay.is-local-result .result-cutscene::before {
  content: attr(data-opponent-result);
  position: fixed;
  left: 50%;
  top: 12%;
  transform: translateX(-50%) rotate(180deg);
  color: #f1f5ff;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: clamp(68px, 20vw, 112px);
  line-height: .88;
  font-weight: 1000;
  letter-spacing: 0;
  text-shadow:
    0 4px 0 rgba(11, 17, 31, .78),
    0 0 16px rgba(116, 139, 190, .42),
    0 16px 30px rgba(0,0,0,.58);
}

.result-overlay.is-local-result.local-opponent-win .result-cutscene::before {
  color: #22d782;
  text-shadow:
    0 4px 0 rgba(2, 52, 33, .72),
    0 0 18px rgba(255,255,255,.5),
    0 18px 36px rgba(0,0,0,.58);
}

.result-overlay.is-local-result .result-cutscene-copy {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 13%;
  padding: 0 18px;
}

.result-overlay.is-local-result .result-cutscene-copy span {
  font-size: clamp(68px, 20vw, 112px);
}

.result-overlay.is-local-result.is-win .result-cutscene-copy span {
  color: #22d782;
  text-shadow:
    0 4px 0 rgba(2, 52, 33, .72),
    0 0 18px rgba(255,255,255,.5),
    0 18px 36px rgba(0,0,0,.58);
}

.result-overlay.is-local-result.is-lose .result-cutscene-copy span,
.result-overlay.is-local-result.is-draw .result-cutscene-copy span {
  color: #f1f5ff;
  text-shadow:
    0 4px 0 rgba(11, 17, 31, .78),
    0 0 16px rgba(116, 139, 190, .42),
    0 16px 30px rgba(0,0,0,.58);
}

.result-overlay.is-local-result .result-cutscene-skip {
  position: fixed;
  left: 50%;
  bottom: 5%;
  width: min(calc(100% - 36px), 240px);
  transform: translateX(-50%);
  margin: 0;
}

.result-cutscene-copy strong {
  display: none;
}

.result-cutscene-copy p {
  display: none;
}

.result-overlay.is-win:not(.is-local-result) #resultCutsceneKicker {
  display: none;
}

.result-cutscene-skip {
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: 46px;
  margin: 0;
  background: rgba(255,255,255,.92);
  font-weight: 900;
}

.result-cutscene-actions {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 8px;
  width: min(100%, 240px);
  margin-top: -32px;
}

.result-cutscene-sound {
  min-height: 42px;
  border-color: rgba(34, 215, 130, .45);
  background: rgba(7, 45, 34, .94);
  color: #dffff1;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(34, 215, 130, .18);
}

.result-cutscene-sound[hidden] {
  display: none;
}

.result-overlay.is-win .result-cutscene {
  background: transparent;
}

.result-overlay.is-win .result-cutscene[data-keyed="true"],
.result-overlay.is-lose .result-cutscene[data-keyed="true"] {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.result-overlay.is-lose .result-cutscene[data-keyed="true"] {
  border-color: rgba(186, 199, 221, .44);
  background: transparent;
  box-shadow: none;
}

.result-overlay.is-win .result-cutscene-stage::before,
.result-overlay.is-win .result-cutscene[data-keyed="true"] .result-cutscene-stage::before {
  background: #fff;
  box-shadow:
    0 20px 54px rgba(16, 88, 61, .12),
    inset 0 0 0 1px rgba(19, 148, 94, .08);
}

.result-overlay.is-win .result-cutscene[data-sequence="true"] .result-cutscene-stage::before {
  top: 52%;
  width: min(86%, 340px);
  height: min(124%, 760px);
}

.result-overlay.is-lose .result-cutscene-stage::before,
.result-overlay.is-lose .result-cutscene[data-keyed="true"] .result-cutscene-stage::before {
  background: #1b2234;
}

.result-overlay.is-win .result-cutscene[data-keyed="true"] .result-cutscene-video,
.result-overlay.is-lose .result-cutscene[data-keyed="true"] .result-cutscene-video {
  opacity: 0;
}

.result-overlay.is-win .result-cutscene[data-keyed="true"] .result-cutscene-burst,
.result-overlay.is-lose .result-cutscene[data-keyed="true"] .result-cutscene-burst {
  z-index: 1;
  opacity: .36;
}

.result-overlay.is-win .result-cutscene[data-keyed="true"] .result-cutscene-burst {
  display: none;
}

.result-overlay.is-win .result-cutscene[data-keyed="true"] .result-cutscene-copy,
.result-overlay.is-lose .result-cutscene[data-keyed="true"] .result-cutscene-copy {
  background: transparent;
  box-shadow: none;
}

.result-overlay.is-lose .result-cutscene[data-keyed="true"] .result-cutscene-copy {
  background: transparent;
}

.result-overlay.is-win .result-cutscene-copy span {
  color: #22d782;
  -webkit-text-stroke: 0;
  text-shadow:
    0 4px 0 rgba(2, 52, 33, .72),
    0 0 18px rgba(255,255,255,.5),
    0 18px 36px rgba(0,0,0,.58);
}

.result-overlay.is-win .result-cutscene-skip {
  border: 1px solid rgba(16, 148, 94, .18);
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 28px rgba(16, 88, 61, .12);
}

.result-overlay.is-lose .result-cutscene-copy span {
  color: #f1f5ff;
  -webkit-text-stroke: 0;
  text-shadow:
    0 4px 0 rgba(11, 17, 31, .78),
    0 0 16px rgba(116, 139, 190, .42),
    0 16px 30px rgba(0,0,0,.58);
}

.result-overlay.is-win .result-cutscene-image {
  width: min(88%, 340px);
  max-height: 88%;
  animation: resultCharacterWinStill .36s ease-out both;
  filter: brightness(1.08) drop-shadow(0 22px 26px rgba(0,0,0,.56));
}

.result-overlay.is-win .result-cutscene[data-presentation="wide-victory"] {
  width: 100%;
  min-height: min(82dvh, 720px);
}

.result-overlay.is-win .result-cutscene[data-presentation="wide-victory"] .result-cutscene-stage {
  inset: 50% auto auto 50%;
  width: min(calc(175vw - 49px), 790px);
  height: min(calc(100vw - 28px), 452px);
  max-height: min(62dvh, 452px);
  transform: translate(-50%, -62%);
  overflow: hidden;
}

.result-overlay.is-win .result-cutscene[data-presentation="wide-victory"] .result-cutscene-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
  filter: brightness(1.04) saturate(1.05) drop-shadow(0 24px 36px rgba(0,0,0,.54));
  animation: resultRookieVictorySlide .56s cubic-bezier(.16,.86,.24,1.08) both;
}

.result-overlay.is-win .result-cutscene[data-presentation="wide-victory"] .result-cutscene-burst {
  opacity: .32;
  mix-blend-mode: screen;
}

.result-overlay.is-win .result-cutscene[data-presentation="wide-victory"] .result-cutscene-copy {
  padding-bottom: 70px;
}

.result-overlay.is-lose .result-cutscene {
  background: transparent;
}

.result-overlay.is-lose .result-cutscene-burst {
  display: none;
}

.result-overlay.is-lose .result-cutscene-fallback {
  display: none !important;
}

.result-overlay.is-lose .result-cutscene-image {
  width: min(78%, 302px);
  max-height: 86%;
  animation: resultCharacterLoseStill .36s ease-out both;
  filter: grayscale(.1) brightness(.96) drop-shadow(0 22px 26px rgba(0,0,0,.56));
}

.result-overlay.is-draw .result-cutscene-image {
  animation: resultCharacterDraw 2.1s ease-in-out both;
}

.result-cutscene[data-asset="fallback"] .result-cutscene-image {
  opacity: .52;
  animation: resultFallbackStill .5s ease-out both;
}

.result-cutscene[data-asset="fallback"] .result-cutscene-burst {
  opacity: .18;
  animation: none;
}

@keyframes resultCharacterWinStill {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes resultBoardDim {
  from { background: rgba(5, 10, 9, 0); backdrop-filter: blur(0); }
  to { background: rgba(3, 8, 8, .82); backdrop-filter: blur(1.5px); }
}

@keyframes resultRookieVictorySlide {
  0% { opacity: 0; transform: translateX(105%) skewX(-4deg) scale(1.025); }
  72% { opacity: 1; transform: translateX(-2.5%) skewX(0) scale(1); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .result-overlay.is-win,
  .result-overlay.is-win .result-cutscene[data-presentation="wide-victory"] .result-cutscene-image {
    animation-duration: .01ms;
  }
}

@keyframes resultCharacterLoseStill {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes resultCharacterDraw {
  0% { transform: translateY(20px) scale(.92); opacity: 0; }
  34% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes resultBurst {
  0% { transform: scale(.5) rotate(0deg); opacity: 0; }
  35% { opacity: .72; }
  100% { transform: scale(1.28) rotate(38deg); opacity: .08; }
}

@keyframes resultFallbackStill {
  from { opacity: 0; transform: scale(.98); }
  to { opacity: .52; transform: scale(1); }
}

.result-panel {
  --result-drag-x: 0px;
  --result-drag-y: 0px;
  position: relative;
  width: min(100%, 420px);
  padding: 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f4f8f2);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  text-align: center;
  touch-action: none;
  cursor: grab;
  transform: translate(var(--result-drag-x), var(--result-drag-y));
  will-change: transform;
}

.result-panel.is-dragging {
  cursor: grabbing;
}

.result-drag-hint {
  display: none;
  position: absolute;
  z-index: 4;
  top: 8px;
  right: auto;
  left: 10px;
  width: 42px;
  height: 50px;
  color: rgba(17, 67, 50, .94);
  pointer-events: none;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.92))
    drop-shadow(0 0 9px rgba(255,255,255,.84));
}

.result-overlay .result-drag-hint {
  display: grid;
  place-items: start center;
}

.result-overlay .result-panel.has-been-dragged .result-drag-hint {
  display: none;
}

.result-drag-hint::before {
  content: "";
  position: absolute;
  top: 0;
  left: 27%;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translateX(-50%);
  animation: resultDragTouchPulse 2.25s ease-in-out infinite;
}

.result-drag-hint-hand {
  display: block;
  width: 44px;
  height: 48px;
  margin-top: 1px;
  overflow: visible;
  animation: resultDragHandSlide 2.25s ease-in-out infinite;
}

.result-drag-hand-shape {
  fill: rgba(255,255,255,.82);
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-drag-hand-detail {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes resultDragHandSlide {
  0%, 12%, 100% {
    opacity: .38;
    transform: translateY(5px);
  }
  24% {
    opacity: 1;
    transform: translateY(5px) scale(.94);
  }
  58% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }
  76% {
    opacity: .28;
    transform: translateY(-10px);
  }
  82% {
    opacity: 0;
    transform: translateY(5px);
  }
}

@keyframes resultDragTouchPulse {
  0%, 10%, 100% {
    opacity: 0;
    transform: translateX(-50%) scale(.55);
  }
  22% {
    opacity: .72;
    transform: translateX(-50%) scale(.72);
  }
  42% {
    opacity: 0;
    transform: translateX(-50%) scale(1.35);
  }
}

.result-panel button {
  touch-action: manipulation;
  cursor: pointer;
}

.result-overlay.is-lose:not(.is-local-result) .result-cutscene-copy,
.result-overlay.is-draw:not(.is-local-result) .result-cutscene-copy {
  position: fixed;
  inset: 50% 0 auto;
  width: 100%;
  margin: 0;
  padding: 0 18px;
  transform: translateY(-50%);
}

.result-overlay.is-draw:not(.is-local-result) .result-cutscene-stage,
.result-overlay.is-draw:not(.is-local-result) .result-cutscene-burst {
  display: none;
}

#myPageRank .ranking-position-1 {
  color: #c99712;
}

#myPageRank .ranking-position-2 {
  color: #8b949e;
}

#myPageRank .ranking-position-3 {
  color: #a86532;
}

#myPageRank .ranking-position-4,
#myPageRank .ranking-total {
  color: #111;
}

.result-panel img {
  width: 118px;
  height: 118px;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.result-panel h2 {
  margin-top: 10px;
  font-size: clamp(40px, 11vw, 52px);
  line-height: 1.05;
}

.result-panel p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

#resultSummary {
  color: #3d4943;
  font-size: clamp(18px, 5.2vw, 24px);
  font-weight: 750;
  line-height: 1.35;
}

.result-panel .button-row .primary-btn,
.result-panel .button-row .secondary-btn {
  min-width: 0;
  min-height: 66px;
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: clamp(14px, 4.2vw, 18px);
  white-space: nowrap;
}

html[data-language="en"] .result-panel .button-row #resultAgainBtn {
  padding-inline: 8px;
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.15;
  white-space: normal;
}

.result-rating {
  display: grid;
  gap: 4px;
  margin: 14px auto 0;
  width: min(100%, 230px);
  padding: 10px;
  border-radius: 8px;
  background: #102a20;
  color: #fff;
}

.result-rating[hidden] {
  display: none;
}

.result-rating span {
  font-size: 11px;
  opacity: .75;
}

.result-rating strong {
  font-size: 24px;
  line-height: 1;
}

.result-rating small {
  color: #ffe07a;
  font-size: 16px;
  font-weight: 1000;
}

.result-record-summary {
  margin-top: 10px !important;
  color: #183b2b !important;
  font-weight: 900;
}

.result-replay-btn {
  width: 100%;
  min-height: 48px;
  margin: 14px 0 10px;
  font-weight: 900;
}

.replay-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(4, 9, 14, .78);
}

.replay-overlay[hidden] {
  display: none;
}

.device-revoked-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(248, 246, 242, .98);
}

.device-revoked-overlay strong {
  width: min(100%, 420px);
  padding: 24px 18px;
  border: 2px solid #168f57;
  border-radius: 14px;
  background: #fff;
  color: #10281f;
  font-size: 21px;
  line-height: 1.6;
  text-align: center;
}

.replay-panel {
  width: min(100%, 430px);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 12px;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbf7, #edf3ec);
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
}

.replay-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.replay-kicker {
  display: block;
  color: #0c6b51;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.replay-header h2 {
  margin: 2px 0 0;
  color: #102a20;
  font-size: clamp(19px, 5vw, 26px);
  line-height: 1.1;
}

.replay-board {
  width: min(100%, 398px);
  margin: 0 auto;
  border-width: 5px;
}

.replay-board .cell {
  pointer-events: none;
}

.replay-board .replay-last-move::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 3px solid rgba(255, 216, 88, .96);
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(255, 216, 88, .34);
}

.replay-info {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #102a20;
  color: #fff;
}

.replay-info strong {
  font-size: clamp(16px, 4.3vw, 20px);
  line-height: 1.2;
}

.replay-info span {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.replay-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.replay-controls button {
  min-height: 46px;
  height: 46px;
  margin: 0;
  border: 2px solid #000;
  padding: 8px 4px;
  font-size: 14px;
  font-weight: 900;
}

.replay-controls button:disabled {
  opacity: .45;
}

.replay-practice-btn {
  width: 100%;
  min-height: 50px;
  margin: 10px 0 0;
  border: 2px solid #000;
  font-size: clamp(16px, 4.4vw, 19px);
  font-weight: 900;
}

.replay-practice-btn:disabled {
  opacity: .5;
}

.replay-report-btn {
  width: 88px;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  border-color: rgba(155, 47, 47, .55);
  color: #8b2525;
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 900;
  white-space: nowrap;
}

.replay-report-btn:disabled {
  opacity: .58;
}

.replay-home-btn {
  width: 100%;
  min-height: 50px;
  margin: 10px 0 0;
  border: 2px solid #000;
  color: #102a20;
  font-size: clamp(16px, 4.4vw, 19px);
  font-weight: 900;
}

.opponent-report-dialog {
  width: min(calc(100% - 28px), 430px);
  padding: 0;
  border: 2px solid rgba(22, 96, 63, .42);
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fbf7, #edf3ec);
  color: #102a20;
}

.opponent-report-dialog::backdrop {
  background: rgba(4, 9, 14, .76);
}

.opponent-report-dialog-body {
  display: grid;
  gap: 14px;
  padding: 20px 18px;
}

.opponent-report-dialog h2,
.opponent-report-dialog p {
  margin: 0;
}

.opponent-report-dialog h2 {
  font-size: clamp(22px, 6vw, 28px);
  text-align: center;
}

.opponent-report-target {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.opponent-report-reasons {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(22, 96, 63, .28);
  border-radius: 10px;
  background: rgba(255,255,255,.72);
}

.opponent-report-reasons legend {
  padding: 0 5px;
  font-weight: 900;
}

.opponent-report-reasons label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  font-weight: 800;
}

.opponent-report-reasons input {
  width: 20px;
  height: 20px;
  accent-color: #168f57;
}

.opponent-report-details textarea {
  width: 100%;
  resize: vertical;
  min-height: 92px;
}

.opponent-report-note,
.opponent-report-message {
  font-size: 13px;
  line-height: 1.5;
}

.opponent-report-note {
  color: #53645d;
}

.opponent-report-message {
  min-height: 1.5em;
  color: #a12d2d;
  font-weight: 800;
}

.opponent-report-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.opponent-report-actions button {
  min-height: 48px;
  margin: 0;
}

body.enhanced-game-mode .score .score-info > .replay-practice-best-btn {
  position: absolute;
  left: 12px;
  bottom: 8px;
  z-index: 2;
  order: 3;
  grid-row: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: max-content;
  min-width: 0;
  max-width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid rgba(213, 172, 50, .92);
  border-radius: 12px;
  background: #102a20;
  color: #ffe16a;
  font-size: clamp(13px, 3.6vw, 17px);
  font-weight: 1000;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
}

body.enhanced-game-mode .score .score-info > .replay-practice-best-btn:disabled {
  opacity: .62;
  filter: grayscale(.45) brightness(.58);
  box-shadow: none;
  pointer-events: none;
  touch-action: none;
}

body.enhanced-game-mode .score .score-info > .replay-practice-best-btn[hidden] {
  display: none !important;
}

html.ui-confirmation-app body.replay-practice-game-mode {
  --replay-practice-action-width: 76px;
}

html[data-language="en"].ui-confirmation-app body.replay-practice-game-mode {
  --replay-practice-action-width: 94px;
}

html.ui-confirmation-app body.replay-practice-game-mode .score-resign-slot {
  width: var(--replay-practice-action-width);
}

html.ui-confirmation-app body.replay-practice-game-mode .score-resign-slot .resign-btn,
html.ui-confirmation-app body.replay-practice-game-mode .score .score-info > .replay-practice-best-btn {
  width: var(--replay-practice-action-width);
  min-width: var(--replay-practice-action-width);
}

html.ui-confirmation-app body.replay-practice-game-mode .score-resign-slot .resign-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

body.replay-practice-game-mode.human-black .score.black .score-main em,
body.replay-practice-game-mode.human-white .score.white .score-main em {
  transform: translateY(-22px);
}

.replay-practice-dialog {
  width: min(calc(100% - 28px), 420px);
  border: 2px solid rgba(213, 172, 50, .88);
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fbf7, #edf3ec);
}

.replay-practice-dialog::backdrop {
  background: rgba(4, 9, 14, .76);
}

.replay-practice-dialog-body {
  display: grid;
  gap: 14px;
  padding: 20px 18px;
  color: #102a20;
}

.replay-practice-dialog h2,
.replay-practice-dialog p {
  margin: 0;
}

.replay-practice-dialog h2 {
  font-size: clamp(22px, 6vw, 28px);
  line-height: 1.25;
  text-align: center;
}

.replay-practice-dialog-body > p {
  line-height: 1.55;
}

#replayPracticePosition {
  font-size: clamp(16px, 4.15vw, 18px);
  font-weight: 800;
  line-height: 1.5;
}

html[data-language="en"] #replayPracticePosition {
  font-size: clamp(14px, 3.7vw, 17px);
  line-height: 1.45;
}

html[data-language="en"] .replay-practice-note {
  font-size: clamp(12px, 3.25vw, 14px);
}

.replay-practice-opponent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #cfdcd3;
  border-radius: 10px;
  background: #fff;
}

.replay-practice-opponent strong {
  color: #0c6b51;
  font-size: 19px;
}

.replay-practice-note {
  padding: 12px 14px;
  border: 1px solid rgba(213, 172, 50, .48);
  border-radius: 8px;
  background: #fff3bd;
  color: #58450a;
  font-size: clamp(13px, 3.55vw, 15px);
  font-weight: 800;
  line-height: 1.5;
  text-align: left;
}

.replay-practice-actions {
  display: grid;
  gap: 10px;
}

.replay-practice-actions button {
  width: 100%;
  min-height: 50px;
  margin: 0;
  border: 1px solid #111;
}

.cell.replay-practice-evaluation .replay-practice-evaluation-value {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: transparent;
  color: #fff4b8;
  font-size: clamp(13px, 4vw, 20px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.95), 0 0 3px rgba(0,0,0,.8);
}

.cell.replay-practice-evaluation.guide::after {
  display: none;
}

.cell.replay-practice-evaluation .replay-practice-evaluation-value.is-best {
  width: 94%;
  height: 94%;
  color: #fff7cb;
  font-size: clamp(12px, 3.7vw, 19px);
  isolation: isolate;
}

.cell.replay-practice-evaluation .replay-practice-evaluation-value.is-best::before,
.cell.replay-practice-evaluation .replay-practice-evaluation-value.is-best::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 61.8% 35.1%, 98.6% 35.1%, 68.8% 56.7%, 80.2% 91.8%, 50% 70.1%, 19.8% 91.8%, 31.2% 56.7%, 1.4% 35.1%, 38.2% 35.1%);
}

.cell.replay-practice-evaluation .replay-practice-evaluation-value.is-best::before {
  z-index: -2;
  background: #ffe16a;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
}

.cell.replay-practice-evaluation .replay-practice-evaluation-value.is-best::after {
  z-index: -1;
  inset: 7%;
  background: #123b2f;
}

.replay-practice-hint-ad {
  z-index: 430;
}

.replay-practice-hint-ad .interstitial-ad-panel {
  min-height: 300px;
}

.replay-practice-hint-ad small {
  color: #5b6e64;
  font-size: 14px;
  font-weight: 800;
}

.replay-practice-hint-ad button {
  width: 100%;
  min-height: 50px;
  margin: 4px 0 0;
}

.replay-practice-hint-thinking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #173d30;
  font-size: 16px;
}

.replay-practice-hint-thinking[hidden],
.replay-practice-best-move-loading[hidden] {
  display: none !important;
}

.replay-practice-best-move-loading {
  position: fixed;
  z-index: 420;
  inset: 0 0 var(--global-ad-space);
  display: grid;
  place-items: center;
  pointer-events: auto;
  touch-action: none;
  cursor: wait;
}

.replay-practice-best-move-loading.is-input-shield {
  background: transparent;
  cursor: default;
}

.replay-practice-best-move-loading.is-input-shield > * {
  display: none !important;
}

.replay-practice-best-move-loading > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid rgba(213, 172, 50, .9);
  border-radius: 999px;
  background: rgba(255, 249, 218, .97);
  color: #493a0a;
  font-size: clamp(16px, 4.6vw, 20px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .28);
}

.replay-practice-spinner {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border: 4px solid rgba(22, 143, 87, .22);
  border-top-color: #168f57;
  border-radius: 50%;
  animation: replay-practice-spin .72s linear infinite;
}

@keyframes replay-practice-spin {
  to { transform: rotate(360deg); }
}

.replay-practice-result-flash {
  position: fixed;
  z-index: 360;
  inset: 0;
  display: grid;
  place-items: center;
  background: transparent;
  pointer-events: none;
}

.replay-practice-result-flash > span {
  color: #20c978;
  font-size: clamp(68px, 22vw, 126px);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: .04em;
  text-shadow: 0 4px 0 #075b3b, 0 10px 30px rgba(0, 0, 0, .55);
  animation: replay-practice-win-in .32s ease-out both;
}

.replay-practice-result-flash[hidden] {
  display: none;
}

@keyframes replay-practice-win-in {
  from { opacity: 0; transform: scale(.72); }
  to { opacity: 1; transform: scale(1); }
}

dialog {
  width: min(92vw, 420px);
  max-height: calc(100dvh - var(--global-ad-space) - 24px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.friend-flow-screen {
  display: grid;
  align-content: center;
  gap: 18px;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: calc(24px + env(safe-area-inset-top)) 16px 24px;
  background: transparent;
}

#friendView .friend-flow-screen {
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  padding-right: 16px;
  padding-bottom: 16px;
  padding-left: 16px;
}

#friendView .friend-flow-main {
  display: grid;
  align-self: center;
  gap: 22px;
  width: 100%;
}

#friendView .friend-choice-list {
  gap: 20px;
}

#onlineView .friend-choice-list {
  gap: 24px;
}

/* Every full-screen UI-confirmation view remains reachable on short phones.
   The bar is only painted by the browser when the view actually overflows. */
html.ui-confirmation-app main > .view.view-active:not(#titleView):not(#menuView):not(#gameView):not(#practiceProblemsView) {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: auto;
  scrollbar-color: #087a55 #e2e2df;
}

html.ui-confirmation-app main > .view.view-active:not(#titleView):not(#menuView):not(#gameView):not(#practiceProblemsView)::-webkit-scrollbar {
  width: 9px;
}

html.ui-confirmation-app main > .view.view-active:not(#titleView):not(#menuView):not(#gameView):not(#practiceProblemsView)::-webkit-scrollbar-track {
  background: #e2e2df;
  border-radius: 999px;
}

html.ui-confirmation-app main > .view.view-active:not(#titleView):not(#menuView):not(#gameView):not(#practiceProblemsView)::-webkit-scrollbar-thumb {
  min-height: 36px;
  border: 2px solid #e2e2df;
  border-radius: 999px;
  background: #087a55;
}

html.ui-confirmation-app #friendView .friend-flow-back {
  align-self: end;
  margin-top: 0;
}

html.ui-confirmation-app :is(#friendRemoteBackBtn, #roomJoinBackBtn) {
  border: 2px solid #000;
  background: #fff;
  color: #000;
}

/* Match the training footer exactly on every full-screen home return button.
   Dialog/result buttons deliberately keep their own in-panel placement. */
html.ui-confirmation-app :is(
  #friendHomeBtn,
  #ratedHomeBtn,
  #outfitHomeBtn,
  #missionsHomeBtn,
  #gachaHomeBtn,
  #shopHomeBtn,
  #settingsHomeBtn,
  #contactHomeBtn,
  #myPageHomeBtn
) {
  position: fixed;
  right: auto;
  bottom: var(--global-ad-space);
  left: 50%;
  z-index: 40;
  width: min(calc(100% - 32px), 448px);
  height: 56px;
  min-height: 56px;
  margin: 0;
  transform: translateX(-50%);
}

.friend-flow-heading {
  text-align: center;
}

.friend-flow-heading h2 {
  margin: 0;
  color: #158a54;
  font-size: clamp(30px, 8.5vw, 44px);
  font-weight: 1000;
  line-height: 1.1;
  -webkit-text-stroke: 1.5px #10271e;
  paint-order: stroke fill;
}

#friendView .friend-flow-heading h2,
#onlineView .friend-flow-heading h2,
#roomCreateView .friend-flow-heading h2,
#roomJoinView .friend-flow-heading h2 {
  color: #0b6845;
  background: linear-gradient(180deg, #249b65 0%, #075f40 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0;
  paint-order: normal;
  font-weight: 950;
  letter-spacing: .025em;
  text-shadow: 2px 3px 5px rgba(7, 79, 51, .2);
}

.friend-flow-heading p {
  margin: 10px 0 0;
  color: #3c5c50;
  font-size: clamp(14px, 3.8vw, 18px);
  font-weight: 800;
}

#friendView .friend-flow-heading,
#onlineView .friend-flow-heading {
  margin-bottom: 2px;
}

.friend-choice-list {
  display: grid;
  gap: 12px;
}

.friend-choice-card {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 108px;
  padding: 18px 16px;
  border: 2px solid rgba(20, 132, 82, .28);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(235,247,240,.97));
  color: #153d2f;
  text-align: left;
  box-shadow: 0 12px 24px rgba(16, 61, 43, .12), inset 0 1px 0 #fff;
}

.friend-choice-card strong {
  font-size: clamp(20px, 5.5vw, 27px);
  line-height: 1.2;
}

.friend-choice-card span {
  color: #526b62;
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 700;
  line-height: 1.45;
}

.friend-flow-back {
  min-height: 52px;
  margin-top: 2px;
}

.friend-privacy-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(20, 132, 82, .2);
  border-radius: 12px;
  background: rgba(236, 248, 241, .94);
  color: #315346;
  font-size: clamp(12px, 3.1vw, 14px);
  font-weight: 800;
  line-height: 1.55;
}

.friend-room-method-note {
  border-color: #e1bd58;
  background: #fff5ce;
  color: #5a4617;
  box-shadow: 0 8px 18px rgba(139, 103, 22, .1);
}

.room-code-screen {
  gap: 16px;
}

.room-code-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 18px 14px;
  border: 2px solid #15905a;
  border-radius: 18px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 14px 28px rgba(15, 89, 57, .16);
}

.room-code-card span {
  color: #526b62;
  font-size: 13px;
  font-weight: 900;
}

.room-code-card strong {
  color: #123f2d;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(44px, 13vw, 64px);
  line-height: 1;
  letter-spacing: .13em;
}

.room-waiting-box {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 14px;
  color: #315346;
  text-align: center;
}

.room-waiting-box strong {
  font-size: clamp(17px, 4.7vw, 22px);
}

.room-waiting-box small {
  font-size: 12px;
  font-weight: 700;
}

.room-waiting-box .room-expiry-warning {
  display: block;
  width: 100%;
  color: #c43832;
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 900;
  line-height: 1.55;
  text-align: left;
}

.room-create-back {
  transform: translateY(42px);
}

.room-waiting-spinner {
  width: 34px;
  height: 34px;
  border: 5px solid rgba(21, 144, 90, .18);
  border-top-color: #15905a;
  border-radius: 50%;
  animation: roomWaitingSpin .9s linear infinite;
}

@keyframes roomWaitingSpin {
  to { transform: rotate(360deg); }
}

.room-code-input-field {
  display: grid;
  gap: 9px;
}

.room-code-input-field span {
  color: #315346;
  font-size: 14px;
  font-weight: 900;
}

.room-code-input-field input {
  width: 100%;
  height: 68px;
  padding: 0 14px;
  border: 2px solid #15905a;
  border-radius: 14px;
  background: rgba(255,255,255,.98);
  color: #123f2d;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(30px, 8.5vw, 42px);
  font-weight: 1000;
  letter-spacing: .14em;
  text-align: center;
}

.room-join-btn {
  min-height: 58px;
  margin-top: 0;
}

.room-status-line {
  min-height: 22px;
  margin: -6px 0 0;
  color: #a43a32;
  font-weight: 900;
  text-align: center;
}

dialog[open] {
  transform: translateY(calc(var(--global-ad-space) / -2));
}

.dialog-body { padding: 16px; }

.name-change-warning {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(184, 82, 48, .32);
  border-radius: 8px;
  background: #fff3ec;
  color: #9b3f25;
  font-weight: 900;
  text-align: center;
}

.character-confirm-warning {
  font-size: clamp(14px, 4vw, 17px);
  line-height: 1.65;
}

.character-confirm-warning span {
  display: block;
}

.character-confirm-note {
  margin: 10px 0 0;
  color: #68746f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
  text-align: left;
}

.name-change-dialog [hidden] {
  display: none !important;
}

.name-change-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.name-change-actions > .primary-btn,
.name-change-actions > .secondary-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 0;
  padding: 0 12px;
}

.name-change-actions > button:only-child {
  grid-column: 1 / -1;
}

.name-change-final-value {
  margin: 14px 0 4px;
  color: var(--green-dark);
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 1000;
  text-align: center;
  overflow-wrap: anywhere;
}

.character-profile-dialog {
  width: min(92vw, 410px);
  height: min(620px, calc(100dvh - var(--global-ad-space) - 24px));
  max-height: calc(100dvh - var(--global-ad-space) - 24px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
}

.character-profile-dialog::backdrop {
  background: rgba(7, 18, 13, .68);
}

html.ui-uniform-compact .character-profile-dialog[open] {
  position: fixed;
  inset: auto;
  top: calc((100dvh - var(--global-ad-space)) / 2);
  left: 50%;
  width: 374px;
  height: 620px;
  max-width: none;
  max-height: none;
  margin: 0;
  translate: -50% -50%;
  transform: scale(var(--compact-ui-scale, 1));
  transform-origin: center center;
}

.character-profile-dialog-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  height: 100%;
  min-height: 0;
  padding: 22px 20px 20px;
}

.character-profile-dialog-body h2 {
  color: #173d2d;
  font-size: clamp(22px, 6vw, 28px);
  line-height: 1.35;
  text-align: center;
}

#myPageNameDialog .name-change-warning {
  border: 2px solid #000;
  background: #fff;
  color: #d00000;
  line-height: 1.6;
  text-align: left;
}

#missionRewardDialog .name-change-warning {
  text-align: left;
}

.transient-notice {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2000;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(15, 54, 40, .96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  color: #fff;
  font-size: clamp(15px, 4.2vw, 18px);
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.96);
  transition: opacity .12s ease, transform .12s ease;
  pointer-events: none;
}

.transient-notice.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.character-profile-details {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  height: 100%;
  margin: 0 14px 0 0;
  overflow-y: auto;
  border: 1px solid #d5e0d8;
  border-radius: 12px;
  background: #fbfdfb;
}

.character-profile-scroll-shell {
  min-height: 0;
}

.character-profile-details dt,
.character-profile-details dd {
  min-width: 0;
  margin: 0;
  padding: 9px 11px;
  border-bottom: 1px solid #e1e8e3;
  font-size: clamp(13px, 3.7vw, 16px);
  line-height: 1.45;
}

.character-profile-details dt {
  background: #edf6f0;
  color: #286047;
  font-weight: 900;
}

.character-profile-details dd {
  color: #1c2c24;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.character-profile-details dt:last-of-type,
.character-profile-details dd:last-of-type {
  min-height: 42px;
  border-bottom: 0;
}

.character-profile-dialog-body > .secondary-btn {
  min-height: 56px;
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

body.left-hand .topbar {
  grid-template-columns: 48px 1fr 48px;
  direction: rtl;
}

body.left-hand .topbar > * { direction: ltr; }

body.menu-mode #adSlot {
  display: flex;
}

body.menu-mode .home-mode-grid {
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

.result-overlay.is-friend-room-result {
  background: rgba(3, 10, 8, .78);
}

.result-overlay.is-friend-room-result .result-cutscene {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100dvh;
  padding: 20px;
  background: transparent;
}

.result-overlay.is-friend-room-result .result-cutscene[hidden] {
  display: none !important;
}

.result-overlay.is-friend-room-result .result-cutscene-stage,
.result-overlay.is-friend-room-result .result-cutscene-burst,
.result-overlay.is-friend-room-result .result-cutscene-image,
.result-overlay.is-friend-room-result .result-cutscene-video,
.result-overlay.is-friend-room-result .result-cutscene-canvas {
  display: none !important;
}

.result-overlay.is-friend-room-result .result-cutscene-copy {
  position: fixed !important;
  inset: 50% 0 auto !important;
  width: 100%;
  margin: 0;
  padding: 0 18px;
  transform: translateY(-50%) !important;
  text-align: center;
}

.result-overlay.is-friend-room-result #resultCutsceneKicker {
  display: block;
  color: #f1f5ff;
  font-size: clamp(76px, 23vw, 126px);
  text-shadow:
    0 5px 0 rgba(11, 17, 31, .72),
    0 0 18px rgba(255,255,255,.28),
    0 20px 38px rgba(0,0,0,.56);
}

.result-overlay.is-friend-room-result.is-win #resultCutsceneKicker {
  display: block;
  color: #22d782;
  text-shadow:
    0 5px 0 rgba(2, 52, 33, .72),
    0 0 20px rgba(255,255,255,.42),
    0 20px 38px rgba(0,0,0,.56);
}

.result-overlay.is-friend-room-result .result-cutscene-actions {
  display: none;
}

.result-overlay.is-friend-room-result .result-panel img,
.result-overlay.is-friend-room-result #resultAgainBtn {
  display: none;
}

.result-overlay.is-friend-room-result .result-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(calc(100% - 36px), 420px);
  transform: translate(
    calc(-50% + var(--result-drag-x)),
    calc(-50% + var(--result-drag-y))
  );
}

.result-overlay.is-friend-room-result .result-panel .button-row {
  grid-template-columns: minmax(0, 260px);
  justify-content: center;
}

.result-overlay.is-friend-room-result #resultHomeBtn {
  width: 100%;
}

.result-overlay {
  transition: background-color .15s ease-out, backdrop-filter .15s ease-out;
}

.result-overlay.is-result-drag-revealed,
.result-overlay.is-replay-practice-transition.is-result-drag-revealed {
  animation: none;
  background: rgba(3, 10, 8, 0);
  backdrop-filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .result-drag-hint::before,
  .result-drag-hint-hand {
    animation: none;
  }

  .result-drag-hint::before {
    opacity: .45;
    transform: translateX(-50%) scale(.82);
  }

  .result-drag-hint-hand {
    opacity: .78;
    transform: translateY(-3px);
  }
}

body.menu-mode .home-utility-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 auto;
}

body.menu-mode .home-mode-card {
  justify-content: center;
  height: 82px;
  min-height: 82px;
  padding: 12px 10px;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20,104,184,.96), rgba(17,64,151,.98));
  color: #fff;
  box-shadow: 0 12px 22px rgba(12,45,72,.24), inset 0 1px 0 rgba(255,255,255,.4);
  text-align: center;
}

body.menu-mode .home-mode-card strong {
  margin: 0;
  color: #fff;
  font-size: clamp(19px, 5vw, 26px);
  line-height: 1.15;
  text-shadow: 0 2px 0 rgba(0,0,0,.32), 0 0 14px rgba(255,255,255,.24);
}

body.menu-mode .home-mode-card .home-online-label {
  display: grid;
  place-items: center;
  gap: 2px;
  width: 100%;
  text-align: center;
}

body.menu-mode .home-mode-card .home-online-label span {
  display: block;
}

body.menu-mode .home-bottom-btn {
  min-height: 50px;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 8px;
  color: #fff;
  text-align: center;
}

body.menu-mode .home-bottom-btn strong {
  color: #fff;
  font-size: clamp(13px, 3.5vw, 17px);
  line-height: 1.12;
  text-shadow: 0 2px 0 rgba(0,0,0,.3), 0 0 12px rgba(255,255,255,.2);
}

@media (max-height: 720px) {
  html:not(.ui-uniform-compact) .home-mode-grid,
  html:not(.ui-uniform-compact) body.menu-mode .home-mode-grid {
    gap: 7px;
    transform: translateY(-14px);
  }

  html:not(.ui-uniform-compact) .home-screen .home-right-column {
    gap: 12px;
  }

  html:not(.ui-uniform-compact) .home-mode-card,
  html:not(.ui-uniform-compact) body.menu-mode .home-mode-card {
    height: 68px;
    min-height: 68px;
    padding: 9px;
  }

  html:not(.ui-uniform-compact) .home-gacha-card {
    width: 84px;
    height: 54px;
    min-height: 0;
    transform: translate(-50%, -3px);
  }

  html[data-language="en"]:not(.ui-uniform-compact) .home-gacha-card {
    width: 122px;
    height: 58px;
  }
}

@media (min-width: 760px) {
  .app {
    margin-top: 24px;
    margin-bottom: 24px;
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    min-height: calc(100vh - 48px);
    border-radius: 16px;
    overflow: hidden;
  }
}

/* Desktop game layout: keep both players, clocks, board and resign control visible. */
@media (min-width: 900px) and (pointer: fine) {
  body.game-mode .app {
    width: min(calc(100vw - 32px), 1180px);
    max-width: none;
  }

  body.game-mode #gameView {
    grid-template-columns:
      minmax(210px, 1fr)
      min(54vw, calc(100dvh - 104px), 620px)
      minmax(210px, 1fr);
    grid-template-areas:
      "opponent board player"
      "message message message";
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(12px, 2vw, 28px);
    row-gap: 8px;
    padding: 14px clamp(14px, 2vw, 24px);
  }

  body.game-mode #gameView .board {
    align-self: center;
    width: min(54vw, calc(100dvh - 104px), 620px);
    max-width: none;
    margin: 0;
  }

  body.game-mode.enhanced-game-mode .score {
    align-self: center;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(180px, 32vh) auto;
    gap: 4px;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
  }

  body.game-mode.enhanced-game-mode .score > span {
    grid-row: auto;
    width: 100%;
    height: min(32vh, 250px);
  }

  body.game-mode.enhanced-game-mode .score > span img {
    object-fit: contain;
    transform: none;
  }

  body.game-mode.ai-game-mode.human-black .score.white > span,
  body.game-mode.ai-game-mode.human-white .score.black > span {
    visibility: visible;
  }

  body.game-mode.enhanced-game-mode .score-info {
    width: 100%;
    min-height: 150px;
    padding: 14px 62px 14px 14px;
    transform: none !important;
  }

  body.game-mode.enhanced-game-mode .score em,
  body.game-mode.enhanced-game-mode.ai-game-mode .score em {
    font-size: clamp(18px, 1.8vw, 25px);
  }

  body.game-mode.enhanced-game-mode .score .score-rating {
    font-size: clamp(14px, 1.25vw, 18px) !important;
  }

  body.game-mode.enhanced-game-mode .score-info > small:not(.score-rating) {
    font-size: clamp(17px, 1.6vw, 23px) !important;
  }

  body.game-mode.enhanced-game-mode.ai-game-mode .score.has-ai-robot .score-info::before {
    display: none;
  }

  body.game-mode .game-ad-slot {
    display: none;
  }

  body.game-mode.enhanced-game-mode #message.is-alert {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 30;
    width: min(72%, 760px);
    margin: 0;
    transform: translateX(-50%);
  }

  body.game-mode.enhanced-game-mode #message.is-alert.is-pass-notice,
  body.game-mode.enhanced-game-mode #message.is-alert.is-friend-disconnect,
  body.game-mode.enhanced-game-mode #message.is-alert.is-online-disconnect {
    position: fixed;
    top: 50%;
    right: auto;
    bottom: auto;
    width: min(calc(100vw - 28px), 430px);
    margin: 0;
    transform: translate(-50%, -50%);
  }
}

/*
 * Compact phones
 * Keep the regular 393px+ layout unchanged while making 320x568/360x640
 * usable above the permanently reserved adaptive-banner area.
 */
@media (max-height: 650px) and (orientation: portrait) {
  html:not(.ui-confirmation-app) .my-page-screen {
    gap: 6px;
    padding: 8px 8px 6px;
  }

  html:not(.ui-confirmation-app) .my-page-title {
    padding: 7px 6px;
    font-size: 21px;
  }

html:not(.ui-confirmation-app) .my-page-main {
    grid-template-rows: minmax(0, 1fr) auto auto auto;
    gap: 5px;
  }

  html:not(.ui-confirmation-app) .my-page-panel {
    align-self: stretch;
    height: auto;
    padding: 5px;
  }

  html:not(.ui-confirmation-app) .my-page-name {
    min-height: 38px;
    padding: 5px 7px;
    font-size: 16px;
  }

  html:not(.ui-confirmation-app) .my-page-name > button {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 11px;
  }

  html:not(.ui-confirmation-app) .my-page-section-label {
    margin: 4px auto 5px;
    padding: 4px 9px;
    font-size: 16px;
  }

  html:not(.ui-confirmation-app) .my-page-stat-list {
    gap: 4px;
  }

  html:not(.ui-confirmation-app) .my-page-stat-list div {
    min-height: 34px;
    padding: 4px 7px;
  }

  html:not(.ui-confirmation-app) .my-page-stat-list span,
  html:not(.ui-confirmation-app) .my-page-stat-list strong,
  html:not(.ui-confirmation-app) .my-page-stat-record strong {
    font-size: 14px;
  }

  html:not(.ui-confirmation-app) .my-page-rank-row small {
    font-size: 8px;
  }

  html:not(.ui-confirmation-app) .my-page-online-note {
    margin: 4px 0 1px;
    font-size: 10px;
  }

  html:not(.ui-confirmation-app) .my-page-action-row {
    gap: 8px;
  }

  html:not(.ui-confirmation-app) .my-page-icon-btn {
    width: 100%;
    height: 48px;
    padding-inline: 5px;
    font-size: 25px;
  }

  html:not(.ui-confirmation-app) .my-page-text-icon,
  html:not(.ui-confirmation-app) .my-page-outfit-btn .my-page-text-icon {
    font-size: 13px;
  }

  html:not(.ui-uniform-compact) body.game-mode #gameView {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "opponent"
      "opponent-message"
      "board"
      "message"
      "player";
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 2px;
    padding: 3px 8px 4px;
  }

  html:not(.ui-uniform-compact) body.game-mode #gameView .board {
    align-self: center;
    width: min(100%, calc(100dvh - var(--global-ad-space) - 184px));
    max-width: 310px;
    margin: 0 auto;
    padding: 5px;
    border-width: 4px;
  }

  html:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score {
    grid-template-columns: minmax(0, 1fr);
    min-height: 76px;
    padding: 0;
  }

  html:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score > span {
    display: none;
  }

  html:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score-info {
    min-height: 72px;
    padding: 7px 50px 7px 9px;
    border-radius: 9px;
  }

  html:not(.ui-uniform-compact) body.game-mode.takeback-enabled.human-black .score.black .score-info,
  html:not(.ui-uniform-compact) body.game-mode.takeback-enabled.human-white .score.white .score-info {
    min-height: 94px;
    padding: 7px 48px 48px 9px;
  }

  html:not(.ui-uniform-compact) body.game-mode.takeback-enabled .score-resign-slot {
    left: 8px;
    right: 8px;
    bottom: 5px;
    gap: 6px;
  }

  html:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score-resign-slot .resign-btn,
  html:not(.ui-uniform-compact) body.game-mode.takeback-enabled .score-resign-slot .takeback-btn {
    height: 40px;
    min-height: 40px;
  }

  html:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score .score-info > .replay-practice-best-btn {
    left: 8px;
    bottom: 5px;
    height: 40px;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 13px;
  }

  html:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score-info > small:not(.score-rating) {
    font-size: 16px !important;
  }

  html:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score strong {
    top: 6px;
    right: 6px;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  /* The generic compact-game grid does not include the friend-room resign
     column. Restore the dedicated areas so the implicit column cannot shrink
     the board or make adjacent rows overlap on 320x568 and 360x640 phones. */
  html:not(.ui-uniform-compact) body.game-mode.friend-room-game-mode #gameView {
    grid-template-columns: minmax(0, 1fr) 64px;
    grid-template-areas:
      "opponent resign"
      "board board"
      "message message"
      "player player";
    grid-template-rows: auto auto auto auto;
    align-content: center;
    column-gap: 6px;
    row-gap: 4px;
    padding: 4px 8px;
  }

  html:not(.ui-uniform-compact) body.game-mode.friend-room-game-mode #gameView .board {
    width: min(100%, calc(100dvh - var(--global-ad-space) - 216px));
    max-width: 344px;
  }

  html:not(.ui-uniform-compact) body.game-mode.friend-room-game-mode .score {
    min-height: 0;
    padding: 6px 9px;
  }

  html:not(.ui-uniform-compact) body.game-mode.friend-room-game-mode .score-info {
    gap: 4px;
  }

  html:not(.ui-uniform-compact) body.game-mode.friend-room-game-mode .score strong {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  html:not(.ui-uniform-compact) body.game-mode.friend-room-game-mode .score-info > small:not(.score-rating) {
    font-size: 21px;
  }

  html:not(.ui-uniform-compact) body.game-mode.friend-room-game-mode .resign-btn {
    width: 64px;
    min-width: 64px;
    min-height: 64px;
    font-size: 15px;
  }

  html:not(.ui-uniform-compact) body.game-mode.friend-room-game-mode #message,
  html:not(.ui-uniform-compact) body.game-mode.friend-room-game-mode #gameView::after {
    min-height: 40px;
  }
}

@media (min-width: 341px) and (max-width: 520px) {
  html:not(.ui-uniform-compact) .shop-product-purchase {
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 8px;
  }

  html:not(.ui-uniform-compact) .shop-product-price {
    justify-self: center;
    margin-right: 0;
    font-size: clamp(19px, 6vw, 25px);
  }

  html:not(.ui-uniform-compact) .shop-purchase-btn {
    justify-self: stretch;
    width: 100%;
    font-size: 17px;
  }

  html:not(.ui-uniform-compact) .shop-subscription-expiry {
    width: 100%;
  }
}

@media (max-width: 340px) {
  html:not(.ui-uniform-compact) .shop-product {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px;
    padding: 12px 10px;
  }

  html:not(.ui-uniform-compact) .shop-product-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 18px;
  }

  html:not(.ui-uniform-compact) .shop-product-icon::after {
    width: 68px;
    top: 26px;
  }

  html:not(.ui-uniform-compact) .shop-product-title {
    font-size: 16px;
    line-height: 1.2;
    word-break: keep-all;
  }

  .shop-product-copy > p {
    font-size: 11px;
    line-height: 1.4;
  }

  .shop-product-benefits {
    padding: 7px 8px 8px;
  }

  .shop-product-benefits-title,
  .shop-product-benefits li {
    font-size: 10px;
  }

  .shop-product-purchase {
    grid-template-columns: minmax(0, 1fr) minmax(126px, 48%);
    gap: 8px;
    padding-top: 11px;
  }

  .shop-product-price {
    margin-right: 2px;
    font-size: 21px;
  }

  .shop-purchase-btn {
    width: calc(100% - 8px);
  }

  html[data-language="en"] .shop-product-purchase {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-language="en"] .shop-product-price {
    justify-self: center;
    margin-right: 0;
    font-size: 20px;
  }

  html[data-language="en"] .shop-purchase-btn {
    width: 100%;
  }

  html[data-language="en"] .shop-subscription-expiry {
    width: 100%;
  }

  html[data-language="en"] .shop-coin-product {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  html[data-language="en"] .shop-coin-product .coin-purchase-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  html[data-language="en"] .my-page-text-icon,
  html[data-language="en"] .my-page-outfit-btn .my-page-text-icon {
    font-size: 12px;
  }
}

/* The Android wrapper will also lock portrait; this keeps browser previews safe. */

/* Character outfit gacha */
#gachaView.view-active {
  overflow: hidden;
}

.gacha-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 760px);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 8px 10px 10px;
  color: #153f32;
}

.gacha-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.gacha-topbar h2 {
  margin: 0;
  font-size: clamp(36px, 10vw, 48px);
  line-height: 1;
}

#gachaView.is-detail .gacha-topbar {
  justify-content: flex-end;
}

#gachaView.is-detail .gacha-topbar h2 {
  display: none;
}

.gacha-kicker {
  display: none;
}

.crown-coin-balance {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 104px;
  padding: 8px 12px;
  border: 2px solid #d8ad4d;
  border-radius: 999px;
  background: linear-gradient(145deg, #fffdf5, #fff1bd);
  box-shadow: 0 5px 14px rgba(103, 73, 18, .13);
  color: #704b0b;
}

.crown-coin-balance strong {
  margin-left: auto;
  font-size: 18px;
}

.crown-coin-icon {
  color: #bc8219;
  font-weight: 900;
}

.gacha-lead {
  margin: 0 0 6px;
  color: #111;
  font-size: clamp(12px, 3.55vw, 15px);
  font-weight: 700;
  text-align: center;
}

html[data-language="ja"] .gacha-lead {
  white-space: nowrap;
}

.gacha-list-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding-right: 16px;
}

.gacha-scroll-shell {
  min-height: 0;
}

.gacha-banner-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 122px;
  min-height: 0;
  gap: 8px;
}

.gacha-banner {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 122px;
  overflow: hidden;
  padding: 12px 8px 9px 13px;
  border: 2px solid color-mix(in srgb, var(--gacha-character-color) 44%, #fff);
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 20%, rgba(255,255,255,.95) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 68%, rgba(255,255,255,.72) 0 2px, transparent 3px),
    linear-gradient(120deg, #fff 0 44%, color-mix(in srgb, var(--gacha-character-color) 18%, #fff) 100%);
  box-shadow: 0 8px 20px rgba(25, 73, 57, .12);
  color: #173f33;
  text-align: left;
}

.gacha-banner::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--gacha-character-color);
}

.gacha-banner.is-character-gacha {
  --gacha-character-color: #b58a2d;
  border-color: #d8b65b;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 239, 178, .85) 0 3px, transparent 4px),
    linear-gradient(120deg, #fffdf6 0 44%, #f4e5b4 100%);
  box-shadow: 0 9px 22px rgba(116, 79, 10, .18);
}

.gacha-banner.is-character-gacha::before {
  background: linear-gradient(#d9ad3f, #8f6818);
}

.gacha-banner.is-character-gacha .gacha-banner-copy {
  width: calc(100% - 24px);
}

.gacha-banner.is-secret {
  display: grid;
  place-items: center;
  border-color: #aebbb6;
  background: linear-gradient(135deg, #42524c, #1e2b27);
  color: #fff;
  cursor: default;
}

.gacha-banner.is-secret::before {
  width: 100%;
  background:
    radial-gradient(circle at 22% 25%, rgba(255,255,255,.13) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 70%, rgba(255,255,255,.09) 0 3px, transparent 4px);
}

.gacha-banner.is-secret:disabled {
  opacity: 1;
}

.gacha-banner-secret {
  position: relative;
  z-index: 2;
  font-size: clamp(26px, 7vw, 36px);
  font-weight: 900;
  letter-spacing: .16em;
}

.gacha-banner.is-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(20, 29, 26, .52);
}

.gacha-banner-lock {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 4;
  width: calc(100% - 34px);
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 10px;
  background: rgba(25, 36, 32, .82);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
  transform: translate(-50%, -50%);
}

.gacha-banner-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 2px;
  width: 58%;
  height: 100%;
}

.gacha-banner-copy small {
  color: var(--gacha-character-color);
  font-size: 9px;
  font-weight: 900;
}

.gacha-banner-copy strong {
  font-size: clamp(20px, 5.5vw, 28px);
  line-height: 1.15;
}

.gacha-banner-copy em {
  width: max-content;
  margin-top: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #60756d;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.gacha-banner img {
  position: absolute;
  top: -6px;
  right: -18px;
  width: 48%;
  height: 300px;
  object-fit: contain;
  object-position: center top;
  transform: scale(1.2);
  transform-origin: center top;
  filter: drop-shadow(0 5px 5px rgba(24, 48, 39, .2));
}

.gacha-banner-arrow {
  position: absolute;
  right: 7px;
  bottom: 4px;
  z-index: 3;
  font-size: 24px;
  font-weight: 700;
}

.gacha-detail-panel {
  display: grid;
  grid-template-rows: 160px max-content auto auto;
  height: 100%;
  min-height: 0;
  gap: 9px;
  overflow-y: auto;
  padding-right: 16px;
}

.gacha-detail-panel.is-locked {
  grid-template-rows: max-content 160px max-content auto auto;
}

.gacha-detail-panel.is-character-gacha-detail {
  grid-template-rows: 126px max-content max-content auto;
}

.gacha-detail-panel.is-character-gacha-detail .gacha-hero {
  grid-template-columns: 1fr;
}

.gacha-detail-panel.is-character-gacha-detail .gacha-hero-copy {
  grid-column: 1;
  width: 100%;
  padding-right: 15px;
}

.gacha-detail-panel.is-character-gacha-detail .gacha-hero img,
.gacha-detail-panel.is-character-gacha-detail .gacha-rates {
  display: none;
}

.gacha-detail-panel[hidden],
.gacha-list-panel[hidden] {
  display: none;
}

.gacha-locked-notice {
  margin: 0;
  padding: 3px 10px;
  border: 1px solid #b78980;
  border-radius: 12px;
  background: #f8e9e5;
  color: #77392e;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}

.gacha-locked-notice[hidden] {
  display: none;
}

.gacha-detail-panel.is-locked > :not(.gacha-locked-notice) {
  filter: grayscale(.7) brightness(.58);
  opacity: .7;
}

.gacha-hero {
  position: relative;
  display: grid;
  grid-template-columns: 56% 44%;
  min-height: 0;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--gacha-character-color) 42%, #fff);
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.95) 0 4px, transparent 5px),
    linear-gradient(135deg, #fff 0 38%, color-mix(in srgb, var(--gacha-character-color) 24%, #fff) 100%);
  box-shadow: 0 10px 28px rgba(30, 75, 60, .14);
}

.gacha-hero::after {
  content: "";
  position: absolute;
  inset: auto -25px -48px auto;
  width: 180px;
  height: 180px;
  border: 22px solid rgba(255,255,255,.38);
  border-radius: 50%;
}

.gacha-hero-copy {
  position: relative;
  z-index: 2;
  grid-column: 1;
  align-self: center;
  width: auto;
  padding: 12px 4px 12px 15px;
}

.gacha-hero-copy > span {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--gacha-character-color);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.gacha-hero-copy h3 {
  margin: 7px 0 5px;
  font-size: clamp(24px, 6.2vw, 32px);
  line-height: 1.08;
}

.gacha-hero-copy p {
  margin: 0;
  color: #526e64;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.gacha-hero img {
  position: absolute;
  top: 4px;
  right: 0;
  z-index: 1;
  width: 48%;
  height: 300px;
  object-fit: contain;
  object-position: center top;
  transform: scale(1.18);
  transform-origin: center top;
  filter: drop-shadow(0 8px 8px rgba(24, 48, 39, .22));
}

.gacha-progress-card,
.gacha-rates {
  padding: 12px 14px;
  border: 1px solid #dce9e3;
  border-radius: 17px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 5px 16px rgba(29, 71, 57, .08);
}

.character-gacha-info {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e1c979;
  border-radius: 17px;
  background: linear-gradient(145deg, #fffdf7, #fff5d7);
  box-shadow: 0 5px 16px rgba(116, 79, 10, .1);
}

.character-gacha-info[hidden] {
  display: none;
}

.character-gacha-info > p {
  margin: 0;
  color: #4b3b1d;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.character-gacha-teaser-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.character-gacha-teaser-grid > div {
  position: relative;
  height: 104px;
  overflow: hidden;
  border: 1px solid rgba(181, 138, 45, .32);
  border-radius: 12px;
  background: linear-gradient(145deg, #fff, #f7ecd0);
}

.character-gacha-teaser-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: drop-shadow(0 4px 5px rgba(30, 60, 49, .18));
}

.character-gacha-teaser-grid > div > span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(181, 138, 45, .32);
  border-radius: 8px;
  color: #173f34;
  background: rgba(255, 252, 242, .92);
  box-shadow: 0 2px 7px rgba(52, 39, 14, .12);
  line-height: 1;
}

.character-gacha-teaser-grid > div > span strong {
  font-size: 12px;
}

.character-gacha-teaser-grid > div > span small {
  color: #8a6416;
  font-size: 10px;
  font-weight: 900;
}

.gacha-progress-card > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 800;
}

.gacha-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efe9;
}

.gacha-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c58b21, #f1c75b);
  transition: width .35s ease;
}

.gacha-base-rates {
  display: grid;
  gap: 7px;
  margin-bottom: 11px;
  padding: 10px;
  border: 2px solid rgba(197, 139, 33, .52);
  border-radius: 12px;
  background: #fff8e5;
}

.gacha-base-rates > strong {
  color: #75500d;
  font-size: 15px;
  text-align: center;
}

.gacha-base-rates > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.gacha-base-rates > div > span {
  display: grid;
  gap: 2px;
  padding: 7px 5px;
  border-radius: 9px;
  background: #fff;
  color: #183f31;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.gacha-base-rates > div strong {
  color: #8b5b05;
  font-size: 23px;
  line-height: 1.1;
}

.gacha-base-rates > small {
  color: #705a32;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.gacha-rates h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

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

.gacha-rate-grid.is-two-tier {
  grid-template-columns: repeat(2, 1fr);
}

#gachaSuperRateRow[hidden] {
  display: none;
}

.gacha-rate-grid div {
  display: grid;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 10px;
  background: #f3f7f5;
  font-size: 15px;
  text-align: center;
}

.gacha-rate-grid div small {
  color: #5a6962;
  font-size: clamp(10px, 2.55vw, 12px);
  font-weight: 800;
}

.gacha-rate-grid strong { font-size: 21px; }
.gacha-rates > small { display: block; margin-top: 8px; color: #9a6a16; font-size: 15px; font-weight: 800; }

.gacha-draw-btn {
  display: flex;
  align-items: center;
  align-self: start;
  justify-content: space-between;
  width: calc(100% - 24px);
  margin: 0 12px 24px;
  min-height: 54px;
  height: auto;
  padding: 9px 18px;
  border: 2px solid #855b10;
  border-radius: 18px;
  background: linear-gradient(145deg, #f8d66e, #d99825);
  box-shadow: 0 7px 0 #865510, 0 12px 20px rgba(95, 60, 8, .2);
  color: #3e2b07;
  font-size: 22px;
  font-weight: 900;
}

.gacha-draw-btn strong {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  font-size: 18px;
}

.gacha-draw-btn:disabled {
  border-color: #9ca7a2;
  background: #cbd2ce;
  box-shadow: none;
  color: #66716c;
}

.gacha-draw-btn.is-complete {
  justify-content: center;
}

.gacha-page-footer {
  margin-top: 11px;
  padding-top: 0;
  background: transparent;
}

.gacha-page-footer .secondary-btn {
  width: 100%;
  min-height: 52px;
  padding: 9px 14px;
  font-size: 16px;
}

.gacha-confirm-dialog .dialog-body { max-width: 390px; text-align: center; }
.gacha-confirm-dialog h2 { font-size: 21px; }
.gacha-confirm-question { color: #275b48; font-size: 17px; font-weight: 900; }

.gacha-reveal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eeeae4;
  color: #2a2020;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.gacha-reveal[hidden] { display: none; }

.gacha-reveal-stage {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: min(100vw, 760px);
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  /* Keep the result controls visibly separated from the native AdMob banner. */
  padding: 16px 12px calc(var(--adaptive-ad-height) + 30px + env(safe-area-inset-bottom));
  background: linear-gradient(135deg, #fff 0%, #f7f2eb 49%, #eee9f3 100%);
  text-align: center;
}

.gacha-reveal-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(117deg, transparent 0 24%, rgba(192,150,87,.14) 24.2%, transparent 24.7%),
    linear-gradient(68deg, transparent 0 67%, rgba(136,98,171,.11) 67.2%, transparent 67.8%),
    repeating-linear-gradient(145deg, transparent 0 88px, rgba(192,150,87,.07) 89px, transparent 91px);
}

.gacha-reveal-arena {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

.gacha-reveal-arena::before {
  content: "";
  position: absolute;
  inset: 9% 8% 6%;
  opacity: 0;
  pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 9%, color-mix(in srgb, var(--fx), transparent 22%) 11%, transparent 17% 31%, color-mix(in srgb, var(--fx), transparent 36%) 34%, transparent 42% 63%, color-mix(in srgb, var(--fx), transparent 22%) 66%, transparent 73%);
  filter: blur(2px);
}

.gacha-reveal-ball {
  position: relative;
  z-index: 2;
  width: min(238px, 62vw);
  aspect-ratio: 1;
  border: 5px solid #e4d19e;
  border-radius: 50%;
  background: radial-gradient(circle at 29% 22%, #fff 0 4%, #edf2f3 10%, #a9b7bf 27%, #566875 56%, #192936 100%);
  box-shadow: 0 0 0 3px #54636d, 0 18px 48px rgba(34,45,55,.34), inset -18px -20px 28px rgba(8,17,27,.6), inset 12px 10px 18px rgba(255,255,255,.82);
  animation: gachaIdleBall 3.8s ease-in-out infinite;
}

.gacha-reveal-ball::before {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, rgba(255,255,255,.78), transparent 18%), conic-gradient(from 30deg, rgba(255,255,255,.3), transparent 24%, rgba(255,255,255,.16) 48%, transparent 66%, rgba(255,255,255,.23));
  box-shadow: inset 0 0 18px rgba(255,255,255,.35);
}

.gacha-reveal-ball::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% - 8px);
  height: 5px;
  transform: translate(-50%, -50%) rotate(-8deg);
  border-radius: 50%;
  background: #e8d39d;
  box-shadow: 0 0 0 2px #52616c, 0 0 12px rgba(255,236,164,.5);
}

.gacha-reveal-character {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

.gacha-reveal-character img {
  width: auto;
  max-width: 100%;
  height: min(72svh, 640px);
  object-fit: contain;
  filter: none;
}

.gacha-reveal-result {
  display: grid;
  place-items: center;
  height: 88px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s, transform .35s;
}

.gacha-reveal-rarity {
  display: inline-block;
  padding: 9px clamp(14px, 5vw, 30px);
  border: 3px solid var(--badge);
  border-radius: 999px;
  background: linear-gradient(105deg, #eee5d6, #fff 45%, #e6d9c7 70%, #fff);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--badge), 0 8px 28px rgba(116,76,38,.22);
  color: var(--result);
  font-size: clamp(15px, 4.7vw, 23px);
  font-weight: 700;
  letter-spacing: .14em;
  text-shadow: 0 1px 0 #fff;
  white-space: nowrap;
}

.gacha-reveal-home {
  display: none;
  width: max-content;
  margin: 0 auto;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6c967, #d98d2e);
  box-shadow: 0 6px 18px rgba(70,42,24,.24);
  color: #24152c;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.gacha-reveal-stage.is-spinning .gacha-reveal-ball {
  animation: gachaSpinBall 1.8s cubic-bezier(.2,.7,.2,1) both;
  box-shadow: 0 0 0 3px #54636d, 0 18px 48px rgba(34,45,55,.34), 0 0 48px var(--fx), inset -18px -20px 28px rgba(8,17,27,.6);
}

.gacha-reveal-stage.is-spinning .gacha-reveal-arena::before {
  opacity: .92;
  animation: gachaFxSweep 1.8s ease-out both;
}

.gacha-reveal-stage.is-opening .gacha-reveal-ball {
  opacity: 0;
  transform: scale(.55);
  transition: opacity .22s, transform .22s;
}

.gacha-reveal-stage.is-result .gacha-reveal-character {
  opacity: 1;
  animation: gachaCharacterIn .8s cubic-bezier(.16,1,.3,1) both;
}

.gacha-reveal-stage.is-result .gacha-reveal-ball { display: none; }
.gacha-reveal-stage.is-result .gacha-reveal-result { opacity: 1; transform: none; }
.gacha-reveal-stage.is-result .gacha-reveal-home { display: inline-block; }

@keyframes gachaIdleBall { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes gachaSpinBall { 0% { transform: scale(.92) rotate(0); } 25% { transform: scale(1.03) rotate(100deg); } 55% { transform: scale(.98) rotate(290deg); filter: brightness(1.18); } 80% { transform: scale(1.1) rotate(520deg); filter: brightness(1.5); } 100% { transform: scale(1.03) rotate(720deg); filter: none; } }
@keyframes gachaFxSweep { 0% { transform: rotate(0) scale(.65); opacity: 0; } 32% { opacity: .9; } 100% { transform: rotate(430deg) scale(1.25); opacity: 0; } }
@keyframes gachaCharacterIn { 0% { opacity: 0; transform: scale(.78) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

@media (max-width: 520px) {
  html:not(.ui-uniform-compact) .gacha-reveal-stage { padding-top: 12px; }
  html:not(.ui-uniform-compact) .gacha-reveal-character img { height: min(72svh, 620px); }
  html:not(.ui-uniform-compact) .gacha-reveal-result { height: 78px; }
  html:not(.ui-uniform-compact) .gacha-reveal-ball { width: min(220px, 62vw); }
}

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

/* Language selection and locale-only layout safeguards. */
.language-setup-screen {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  background: transparent;
}

.language-setup-logo {
  display: block;
  width: min(88vw, 430px);
  height: auto;
}

.language-setup-panel,
.language-dialog .dialog-body {
  width: min(100%, 410px);
  padding: 22px;
  border: 2px solid #c9a94e;
  border-radius: 22px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 40px rgba(25, 56, 43, .2);
  color: #173d2d;
  text-align: center;
}

.language-setup-panel h2,
.language-dialog h2 {
  margin: 0;
  font-size: clamp(22px, 6vw, 29px);
}

.language-setup-panel > p {
  margin: 4px 0 16px;
  color: #65786f;
  font-weight: 800;
}

.language-setup-panel > small {
  display: block;
  margin: 14px 0 4px;
  line-height: 1.55;
}

.language-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.language-choice {
  min-width: 0;
  min-height: 72px;
  padding: 10px 8px;
  border: 2px solid #b9c8c0;
  border-radius: 14px;
  background: #fff;
  color: #173d2d;
}

.language-choice strong,
.language-choice span {
  display: block;
}

.language-choice strong { font-size: clamp(17px, 4.8vw, 21px); }
.language-choice span { margin-top: 3px; color: #65786f; font-size: 12px; font-weight: 800; }

.language-choice.is-selected {
  border-color: #168f57;
  box-shadow: 0 0 0 3px rgba(22, 143, 87, .16);
  background: #f6fff9;
}

.title-language-btn {
  position: absolute;
  z-index: 4;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(201, 169, 78, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: #173d2d;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(25, 56, 43, .18);
}

html.ui-confirmation-app .title-language-btn {
  display: none !important;
}

.settings-language-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 2px solid rgba(23, 75, 56, .12);
  text-align: left;
}

.settings-language-row strong {
  color: #168f57;
  white-space: nowrap;
}

.settings-language-row > span:first-child,
.settings-content-card > .switch-row > span {
  color: #174b38;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
}

.language-dialog {
  width: min(92vw, 430px);
  max-width: 430px;
  padding: 0;
  border: 0;
  background: transparent;
}

.language-dialog::backdrop { background: rgba(8, 24, 17, .58); }

.language-dialog #languageApplyBtn + #languageCancelBtn {
  margin-top: 10px;
}

html[data-language="en"] :is(button, h1, h2, h3, h4, p, span, strong, small, label) {
  overflow-wrap: normal;
}

html[data-language="en"] :is(.primary-btn, .secondary-btn, .danger-btn, .mode-card, .home-bottom-btn, .settings-icon-link) {
  min-width: 0;
  white-space: normal;
  line-height: 1.2;
}

html[data-language="en"] :is(.rated-search-note, .shop-product-warning, .transfer-setup-notice, .contact-info-card, .announcement-dialog-body p) {
  overflow-wrap: anywhere;
}

html[data-language="en"] .home-online-label { font-size: clamp(14px, 3.7vw, 18px); }
html[data-language="en"] .shop-product-copy { min-width: 0; }
html[data-language="en"] .shop-product-benefit { line-height: 1.25; }
html[data-language="en"] .result-panel { max-width: calc(100vw - 24px); }

@media (max-width: 340px) {
  html:not(.ui-uniform-compact) .language-setup-panel { padding: 18px 14px; }
  html:not(.ui-uniform-compact) .language-choice-grid { gap: 7px; }
  html:not(.ui-uniform-compact) .language-choice { min-height: 64px; padding-inline: 5px; }
  html:not(.ui-uniform-compact) .title-language-btn { right: 8px; bottom: max(10px, env(safe-area-inset-bottom)); }
  html[data-language="en"]:not(.ui-uniform-compact) .home-bottom-btn { font-size: 12px; }
  html[data-language="en"]:not(.ui-uniform-compact) .settings-language-row { font-size: 13px; }
}

@media (max-height: 650px) and (orientation: portrait) {
  html:not(.ui-uniform-compact) .language-setup-screen { gap: 10px; padding-block: 12px; }
  html:not(.ui-uniform-compact) .language-setup-logo { width: min(72vw, 320px); }
  html:not(.ui-uniform-compact) .language-setup-panel { padding-block: 14px; }
  html:not(.ui-uniform-compact) .language-choice-grid { margin-block: 10px; }
}

@media (max-height: 700px) and (orientation: portrait) {
  html:not(.ui-uniform-compact) .gacha-screen { padding: 5px 8px 6px; }
  html:not(.ui-uniform-compact) .gacha-topbar { margin-bottom: 4px; }
  html:not(.ui-uniform-compact) .gacha-topbar h2 { font-size: 32px; }
  html:not(.ui-uniform-compact) .crown-coin-balance { min-width: 94px; padding: 5px 9px; }
  html:not(.ui-uniform-compact) .crown-coin-balance strong { font-size: 15px; }
  html:not(.ui-uniform-compact) .gacha-lead { margin-bottom: 4px; }
  html:not(.ui-uniform-compact) .gacha-banner-list { gap: 5px; }
  html:not(.ui-uniform-compact) .gacha-banner { padding: 8px 6px 7px 10px; border-radius: 16px; }
  html:not(.ui-uniform-compact) .gacha-banner img { top: -4px; right: -16px; height: 300px; }
  html:not(.ui-uniform-compact) .gacha-banner-copy strong { font-size: clamp(15px, 4vw, 20px); }
  html:not(.ui-uniform-compact) .gacha-detail-panel { grid-template-rows: 154px max-content auto auto; gap: 5px; }
  html:not(.ui-uniform-compact) .gacha-detail-panel.is-locked { grid-template-rows: max-content 154px max-content auto auto; }
  html:not(.ui-uniform-compact) .gacha-detail-panel.is-character-gacha-detail { grid-template-rows: 118px max-content max-content auto; }
  html:not(.ui-uniform-compact) .gacha-hero { border-radius: 18px; }
  html:not(.ui-uniform-compact) .gacha-hero img { top: 4px; right: 0; width: 48%; height: 250px; object-fit: contain; object-position: center top; transform: scale(1.15); transform-origin: center top; }
  html:not(.ui-uniform-compact) .gacha-hero-copy { padding: 10px 0 8px 12px; }
  html:not(.ui-uniform-compact) .gacha-hero-copy h3 { margin: 5px 0 3px; font-size: 24px; }
  html:not(.ui-uniform-compact) .gacha-progress-card,
  html:not(.ui-uniform-compact) .gacha-rates { padding: 8px 10px; }
  html:not(.ui-uniform-compact) .character-gacha-info { gap: 7px; padding: 8px 10px; }
  html:not(.ui-uniform-compact) .character-gacha-info > p { font-size: 12px; }
  html:not(.ui-uniform-compact) .character-gacha-teaser-grid > div { height: 82px; }
  html:not(.ui-uniform-compact) .gacha-rate-grid div { padding: 5px 3px; }
  html:not(.ui-uniform-compact) .gacha-draw-btn { min-height: 54px; box-shadow: 0 4px 0 #865510, 0 7px 12px rgba(95, 60, 8, .17); }
  html:not(.ui-uniform-compact) .gacha-page-footer { margin-top: 8px; padding-top: 0; background: transparent; }
  html:not(.ui-uniform-compact) .gacha-page-footer .secondary-btn { min-height: 42px; padding: 6px 12px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .app::before {
    content: "縦向きでご利用ください";
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #fbfcf9;
    color: #173d30;
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 900;
    text-align: center;
  }

  html[data-language="en"] .app::before {
    content: "Please use portrait mode";
  }
}

/* Super-rare outfits only: keep the complete figure inside the player card. */
body.game-mode.enhanced-game-mode .score > span.is-super-rare-outfit {
  overflow: hidden !important;
}

body.game-mode.enhanced-game-mode .score > span.is-super-rare-outfit img.super-rare-battle-avatar {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center bottom !important;
  transform: none !important;
  transform-origin: center bottom !important;
}

/* UI confirmation app: keep character art in its own column, but crop toward
   the upper body so every outfit has a stronger presence beside the card. */
html.ui-confirmation-app body.game-mode.enhanced-game-mode .score > span:not(.is-ai-robot) {
  align-self: center;
  width: 158px;
  height: clamp(184px, 22.5dvh, 198px);
}

/* Keep the complete portrait crop clear of the board on both sides. The
   player's portrait moves down and the opponent's portrait moves up. */
html.ui-confirmation-app body.game-mode.enhanced-game-mode.human-black .score.black > span:not(.is-ai-robot),
html.ui-confirmation-app body.game-mode.enhanced-game-mode.human-white .score.white > span:not(.is-ai-robot) {
  translate: 0 8px;
}

html.ui-confirmation-app body.game-mode.enhanced-game-mode.human-black .score.white > span:not(.is-ai-robot),
html.ui-confirmation-app body.game-mode.enhanced-game-mode.human-white .score.black > span:not(.is-ai-robot) {
  translate: 0 -8px;
}

html.ui-confirmation-app body.game-mode.enhanced-game-mode .score > span:not(.is-ai-robot) img:not(.super-rare-battle-avatar) {
  --battle-avatar-scale: 1.9;
  --battle-avatar-x: 0%;
  --battle-avatar-y: -6%;
  object-position: center top;
  transform: translate(var(--battle-avatar-x), var(--battle-avatar-y)) scale(var(--battle-avatar-scale));
  transform-origin: center top;
}

html.ui-confirmation-app body.game-mode.enhanced-game-mode .score > span.is-super-rare-outfit img.super-rare-battle-avatar {
  --battle-avatar-scale: 1.65;
  --battle-avatar-x: 0%;
  --battle-avatar-y: 0%;
  object-fit: cover !important;
  object-position: center top !important;
  transform: translate(var(--battle-avatar-x), var(--battle-avatar-y)) scale(var(--battle-avatar-scale)) !important;
  transform-origin: center top !important;
}

/* Individually reviewed battle crops. Upright outfits use the portrait default
   above; dynamic poses move the face and torso back toward the frame centre. */
html.ui-confirmation-app img[data-character="genji"][data-outfit="default"] {
  --battle-avatar-scale: 1.82 !important;
  --battle-avatar-y: -4% !important;
}

html.ui-confirmation-app img[data-outfit="rookie-gacha-normal-4"] { --battle-avatar-x: 3%; --battle-avatar-y: -2%; }
html.ui-confirmation-app img[data-outfit="rookie-gacha-normal-6"] { --battle-avatar-scale: 1.84; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="rookie-gacha-normal-11"] { --battle-avatar-x: -4%; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="rookie-gacha-normal-15"] { --battle-avatar-scale: 1.84; --battle-avatar-y: -2%; }
html.ui-confirmation-app img[data-outfit="rookie-gacha-rare-1"] { --battle-avatar-scale: 1.96; --battle-avatar-x: -14%; --battle-avatar-y: -7%; }
html.ui-confirmation-app img[data-outfit="rookie-gacha-rare-2"] { --battle-avatar-scale: 1.82; --battle-avatar-y: -4%; }
html.ui-confirmation-app img[data-outfit="rookie-gacha-rare-3"] { --battle-avatar-scale: 1.88; --battle-avatar-x: 5%; --battle-avatar-y: -5%; }
html.ui-confirmation-app img[data-outfit="rookie-gacha-super-1"] { --battle-avatar-scale: 1.58 !important; --battle-avatar-y: 1% !important; }

html.ui-confirmation-app img[data-outfit="sharp-gacha-normal-4"] { --battle-avatar-x: 3%; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="sharp-gacha-normal-9"] { --battle-avatar-x: 4%; --battle-avatar-y: -4%; }
html.ui-confirmation-app img[data-outfit="sharp-gacha-normal-11"] { --battle-avatar-x: -4%; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="sharp-gacha-rare-1"] { --battle-avatar-scale: 1.82; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="sharp-gacha-rare-3"] { --battle-avatar-scale: 1.82; --battle-avatar-y: -2%; }
html.ui-confirmation-app img[data-outfit="sharp-gacha-super-1"] { --battle-avatar-scale: 1.56 !important; --battle-avatar-y: 1% !important; }

html.ui-confirmation-app img[data-outfit="kaito-gacha-normal-1"] { --battle-avatar-x: -3%; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="kaito-gacha-normal-10"] { --battle-avatar-x: 3%; --battle-avatar-y: -2%; }
html.ui-confirmation-app img[data-outfit="kaito-gacha-normal-12"] { --battle-avatar-x: -4%; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="kaito-gacha-normal-14"] { --battle-avatar-scale: 1.84; --battle-avatar-x: -3%; --battle-avatar-y: -2%; }
html.ui-confirmation-app img[data-outfit="kaito-gacha-normal-15"] { --battle-avatar-scale: 1.84; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="kaito-gacha-normal-16"] { --battle-avatar-scale: 1.84; --battle-avatar-x: 2%; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="kaito-gacha-rare-1"] { --battle-avatar-scale: 1.88; --battle-avatar-y: -5%; }
html.ui-confirmation-app img[data-outfit="kaito-gacha-rare-2"] { --battle-avatar-scale: 1.94; --battle-avatar-x: -12%; --battle-avatar-y: -6%; }
html.ui-confirmation-app img[data-outfit="kaito-gacha-rare-3"] { --battle-avatar-scale: 1.94; --battle-avatar-x: -8%; --battle-avatar-y: -4%; }
html.ui-confirmation-app img[data-outfit="kaito-gacha-super-1"] { --battle-avatar-scale: 1.56 !important; --battle-avatar-y: 1% !important; }

html.ui-confirmation-app img[data-character="mellow"][data-outfit="default"] { --battle-avatar-scale: 1.82; --battle-avatar-x: -3%; --battle-avatar-y: 0%; }
html.ui-confirmation-app img[data-outfit="mellow-gacha-normal-1"] { --battle-avatar-scale: 1.82; --battle-avatar-x: 3%; --battle-avatar-y: -1%; }
html.ui-confirmation-app img[data-outfit="mellow-gacha-normal-11"] { --battle-avatar-x: -4%; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="mellow-gacha-normal-13"] { --battle-avatar-scale: 1.84; --battle-avatar-x: 3%; --battle-avatar-y: -3%; }
html.ui-confirmation-app img[data-outfit="mellow-gacha-normal-15"] { --battle-avatar-scale: 1.86; --battle-avatar-x: -3%; --battle-avatar-y: -2%; }
html.ui-confirmation-app img[data-outfit="mellow-gacha-normal-16"] { --battle-avatar-scale: 1.98; --battle-avatar-x: -6%; --battle-avatar-y: -6%; }
html.ui-confirmation-app img[data-outfit="mellow-gacha-rare-1"] { --battle-avatar-scale: 1.76; --battle-avatar-x: -4%; --battle-avatar-y: 0%; }
html.ui-confirmation-app img[data-outfit="mellow-gacha-rare-2"] { --battle-avatar-scale: 2.12; --battle-avatar-x: -29%; --battle-avatar-y: -7%; }
html.ui-confirmation-app img[data-outfit="mellow-gacha-rare-3"] { --battle-avatar-scale: 1.88; --battle-avatar-x: 4%; --battle-avatar-y: -4%; }
html.ui-confirmation-app img[data-outfit="mellow-mission-outfit-2"] { --battle-avatar-scale: 2.12; --battle-avatar-x: -29%; --battle-avatar-y: -7%; }
html.ui-confirmation-app img[data-outfit="mellow-gacha-super-1"] { --battle-avatar-scale: 1.56 !important; --battle-avatar-y: 1% !important; }

/* Every selectable human portrait must keep the top of the artwork inside its
   crop. Horizontal overflow is intentional, but negative vertical offsets can
   clip hair, hats, raised hands, or other topmost details. Keep the reviewed
   per-outfit scale and horizontal focus while reserving a small top inset for
   all characters and outfits on both sides of the board. */
html.ui-confirmation-app body.game-mode.enhanced-game-mode .score > span:not(.is-ai-robot) img {
  --battle-avatar-y: 2% !important;
}

html.ui-confirmation-app body.game-mode.enhanced-game-mode.ai-game-mode .score.has-ai-robot .score-info::before {
  top: -34px;
  height: 180px;
}

@media (max-height: 650px) and (orientation: portrait) {
  html.ui-confirmation-app:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score {
    grid-template-columns: clamp(68px, 22vw, 84px) minmax(0, 1fr);
    gap: 5px;
  }

  html.ui-confirmation-app:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score > span:not(.is-ai-robot) {
    position: static;
    display: grid !important;
    width: clamp(68px, 22vw, 84px);
    height: 76px;
    margin: 0;
  }

  html.ui-confirmation-app:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score > span:not(.is-ai-robot) img:not(.super-rare-battle-avatar) {
    transform: scale(1.42);
  }

  html.ui-confirmation-app:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score > span.is-super-rare-outfit img.super-rare-battle-avatar {
    transform: scale(1.42) !important;
  }

  html.ui-confirmation-app:not(.ui-uniform-compact) body.game-mode.enhanced-game-mode .score:has(> span:not(.is-ai-robot)) .score-info {
    padding-left: 9px;
  }

  body.game-mode.enhanced-game-mode .score:has(> span.is-super-rare-outfit) {
    position: relative;
  }

  html:not(.ui-confirmation-app) body.game-mode.enhanced-game-mode .score > span.is-super-rare-outfit {
    position: absolute;
    left: 3px;
    bottom: 3px;
    z-index: 3;
    display: grid !important;
    width: 52px;
    height: 70px;
  }

  html:not(.ui-confirmation-app) body.game-mode.enhanced-game-mode .score:has(> span.is-super-rare-outfit) .score-info {
    padding-left: 58px;
  }
}

.crown-coin-balance {
  font: inherit;
  cursor: pointer;
}

.crown-coin-balance:active {
  transform: scale(.97);
}

.coin-history-dialog {
  width: min(calc(100vw - 28px), 430px);
  max-height: min(78dvh, 680px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #f7faf7;
  color: #173d30;
  box-shadow: 0 26px 70px rgba(7, 30, 21, .34);
}

.coin-history-dialog::backdrop {
  background: rgba(5, 18, 13, .58);
  backdrop-filter: blur(3px);
}

.coin-history-dialog-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(78dvh, 680px);
  padding: 18px;
}

.coin-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid #d8e4dc;
}

.coin-history-header small {
  color: #b27a18;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: .12em;
}

.coin-history-header h2 {
  margin: 2px 0 0;
  font-size: 23px;
}

.coin-history-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 120px;
  overflow-y: auto;
  padding-top: 12px;
}

.coin-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid #d9e5dd;
  border-radius: 13px;
  background: #fff;
}

.coin-history-item > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.coin-history-item strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coin-history-item small {
  color: #72837b;
  font-size: 10px;
}

.coin-history-item b {
  font-size: 20px;
}

.coin-history-item.is-credit b { color: #168f57; }
.coin-history-item.is-debit b { color: #b95745; }
.coin-history-empty { margin: auto; color: #72837b; text-align: center; }

.battle-coin-reward,
.daily-coin-reward {
  pointer-events: none;
  opacity: 0;
}

.battle-coin-reward {
  position: absolute;
  top: 24px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border: 1px solid rgba(216, 173, 77, .8);
  border-radius: 999px;
  background: rgba(255, 249, 222, .96);
  color: #7a520d;
  box-shadow: 0 10px 26px rgba(25, 18, 5, .25);
  transform: translateY(-18px) scale(.8);
}

.battle-coin-reward strong { font-size: 19px; }

.daily-coin-reward {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border: 2px solid rgba(216, 173, 77, .82);
  border-radius: 999px;
  background: rgba(255, 251, 231, .97);
  color: #64440c;
  box-shadow: 0 18px 42px rgba(27, 20, 7, .24);
  font-size: 15px;
  font-weight: 900;
  transform: translate(-50%, -42%) scale(.82);
  white-space: nowrap;
}

.daily-coin-reward strong { font-size: 22px; }

.battle-coin-reward.is-visible {
  animation: battleCoinRewardPop 2.4s ease both;
}

.daily-coin-reward.is-visible {
  animation: dailyCoinRewardPop 2.2s ease both;
}

@keyframes battleCoinRewardPop {
  0% { opacity: 0; transform: translateY(-18px) scale(.8); }
  18%, 72% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-10px) scale(.94); }
}

@keyframes dailyCoinRewardPop {
  0% { opacity: 0; transform: translate(-50%, -38%) scale(.82); }
  18%, 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(.94); }
}

@media (prefers-reduced-motion: reduce) {
  .battle-coin-reward.is-visible,
  .daily-coin-reward.is-visible {
    animation-duration: .8s;
  }
}
/* UI confirmation app: shared full-screen page transition. */
html.ui-confirmation-app .screen-transition-overlay {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 150ms ease;
}

html.ui-confirmation-app .screen-transition-overlay[hidden] {
  display: none;
}

html.ui-confirmation-app .screen-transition-overlay.is-dark {
  opacity: 1;
}

html.ui-confirmation-app .screen-transition-status {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(280px, 82vw);
  color: rgba(255, 255, 255, .94);
  text-align: center;
}

html.ui-confirmation-app .screen-transition-loading,
html.ui-confirmation-app .screen-transition-error,
html.ui-confirmation-app .screen-transition-actions {
  display: none;
}

html.ui-confirmation-app .screen-transition-overlay.show-loading .screen-transition-loading {
  display: block;
  font-size: clamp(24px, 6.4vw, 32px);
  font-weight: 700;
  letter-spacing: .04em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}

html.ui-confirmation-app .screen-transition-overlay.is-error .screen-transition-error,
html.ui-confirmation-app .screen-transition-overlay.is-error .screen-transition-actions {
  display: flex;
}

html.ui-confirmation-app .screen-transition-error {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

html.ui-confirmation-app .screen-transition-actions {
  justify-content: center;
  gap: 10px;
  width: 100%;
}

html.ui-confirmation-app .screen-transition-actions button {
  min-width: 112px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid rgba(231, 195, 95, .76);
  border-radius: 14px;
  background: linear-gradient(180deg, #176e54, #0d4838);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .28);
}

html.ui-confirmation-app .screen-transition-back {
  background: rgba(255, 255, 255, .1) !important;
}

/* Optional UI-confirmation full-body layout. The former upper-body crop and
   every reviewed per-outfit offset remain above and can be restored by
   disabling the battle-avatar-full-body class in app.js. */
html.ui-confirmation-app.battle-avatar-full-body body.game-mode.enhanced-game-mode .score > span:not(.is-ai-robot) {
  box-sizing: border-box;
  display: block !important;
  position: relative;
  height: clamp(158px, 19dvh, 172px);
  padding: 4px;
  z-index: 5;
  overflow: visible !important;
}

html.ui-confirmation-app.battle-avatar-full-body body.game-mode.enhanced-game-mode .score-info {
  z-index: 20;
  grid-column: 2;
}

html.ui-confirmation-app.battle-avatar-full-body body.game-mode.enhanced-game-mode .board {
  z-index: 10;
}

/* The earlier portrait layout used a taller frame shifted eight pixels away
   from the board. In the full-body layout that frame could extend below the
   playable app area and clip feet. A shorter frame plus a smaller symmetric
   offset keeps a visible board gap while leaving room below the entire image. */
html.ui-confirmation-app.battle-avatar-full-body body.game-mode.enhanced-game-mode.human-black .score.black > span:not(.is-ai-robot),
html.ui-confirmation-app.battle-avatar-full-body body.game-mode.enhanced-game-mode.human-white .score.white > span:not(.is-ai-robot) {
  translate: 0 4px;
}

html.ui-confirmation-app.battle-avatar-full-body body.game-mode.enhanced-game-mode.human-black .score.white > span:not(.is-ai-robot),
html.ui-confirmation-app.battle-avatar-full-body body.game-mode.enhanced-game-mode.human-white .score.black > span:not(.is-ai-robot) {
  translate: 0 -4px;
}

html.ui-confirmation-app.battle-avatar-full-body body.game-mode.enhanced-game-mode .score > span:not(.is-ai-robot) img {
  display: block !important;
  transform: none !important;
  transform-origin: center center !important;
}

/* On the uniformly scaled minimum-phone battle canvas, keep the visible body
   (not the transparent PNG margin) wholly inside each player row. The board
   and information cards remain above the artwork through their existing
   z-indexes. */
html.ui-confirmation-app.ui-uniform-compact.battle-avatar-full-body body.game-mode.enhanced-game-mode .score > span:not(.is-ai-robot) {
  width: 154px;
  height: 180px;
  padding: 3px;
  translate: none;
}

/* A minimum-height phone needs room for both complete character figures and
   the player controls. Reduce the board itself instead of hiding or cropping
   either player row; the entire game view is still uniformly scaled. */
html.ui-confirmation-app.ui-uniform-compact body.game-mode.enhanced-game-mode #gameView .board {
  width: min(100%, 365px);
  max-width: 365px;
  justify-self: center;
}

/* Fallback preview: show every unused area around the proportionally scaled
   active screen as a black letterbox. */
html.ui-confirmation-app.ui-uniform-compact.ui-compact-black-letterbox main > .view.view-active {
  outline: 100vmax solid #000;
}

/* Stretch one screen-specific background across the whole device canvas while
   the foreground view remains proportionally scaled. Full-screen child
   backgrounds are made transparent so the image is never tiled or pasted at a
   second size, which prevents a visible seam at the scaled view boundary. */
html.ui-confirmation-app.ui-stretched-background .app {
  background-size: 100% 100%, 100% 100%;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

html.ui-confirmation-app.ui-stretched-background
  body[data-active-view="title"] .app {
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.02) 52%, rgba(255,255,255,.18)),
    url("assets/title/title-bg-soft-green-20260630.webp?v=20260630-title-bg-01") center / 100% 100% no-repeat;
}

html.ui-confirmation-app.ui-stretched-background
  body:is(
    [data-active-view="nameSetup"],
    [data-active-view="stats"],
    [data-active-view="myPage"],
    [data-active-view="outfit"],
    [data-active-view="characters"],
    [data-active-view="missions"],
    [data-active-view="shop"],
    [data-active-view="settings"],
    [data-active-view="announcements"],
    [data-active-view="contact"]
  ) .app {
  background: linear-gradient(155deg, #fff 0%, #fffdf8 48%, #f8f3e8 100%);
}

html.ui-confirmation-app.ui-stretched-background
  :is(
    .title-screen,
    .language-setup-screen,
    .character-setup-panel,
    .ai-setup-screen,
    .friend-flow-screen,
    #gameView
  ) {
  background: transparent;
}

html.ui-confirmation-app.ui-stretched-background .my-page-screen {
  background: transparent;
}

/* The AI robot is drawn by the score-card pseudo element rather than the
   avatar image. Fit it into the same compact opponent row with a small board
   gap so its feet never cover the board. */
html.ui-confirmation-app.ui-uniform-compact body.game-mode.enhanced-game-mode.ai-game-mode .score.has-ai-robot .score-info::before {
  top: -26px;
  height: 172px;
  background-position: center center;
}

/* 320 CSS-pixel phones use real responsive reflow. Keep controls at their
   normal tap size and move overflowing content instead of scaling the screen. */
@media (max-width: 340px) {
  html.ui-confirmation-app body.menu-mode .home-screen {
    gap: 4px;
    padding-inline: 6px;
  }

  html.ui-confirmation-app body.menu-mode .home-title {
    width: min(92%, 300px);
    margin-bottom: -4px;
  }

  html.ui-confirmation-app body.menu-mode .home-main {
    grid-template-columns: minmax(0, 1.12fr) minmax(132px, .88fr);
    gap: 5px;
    padding-bottom: 2px;
  }

  html.ui-confirmation-app body.menu-mode .home-screen .home-right-column {
    align-content: center;
    gap: 5px;
  }

  html.ui-confirmation-app body.menu-mode .home-mode-grid {
    gap: 5px;
    transform: none;
  }

  html.ui-confirmation-app body.menu-mode .home-mode-card {
    height: 56px;
    min-height: 56px;
    padding: 5px 3px;
  }

  html.ui-confirmation-app body.menu-mode .home-mode-card strong {
    font-size: 17px;
    line-height: 1.08;
  }

  html.ui-confirmation-app body.menu-mode .home-gacha-card,
  html[data-language="en"].ui-confirmation-app body.menu-mode .home-gacha-card {
    position: relative;
    bottom: auto;
    left: auto;
    width: min(112px, 100%);
    height: 40px;
    justify-self: center;
    transform: none;
  }

  html.ui-confirmation-app body.menu-mode .home-gacha-card:active {
    transform: translateY(2px) scale(.985);
  }

  html.ui-confirmation-app body.menu-mode .home-utility-grid {
    gap: 4px;
    width: 100%;
  }

  html.ui-confirmation-app body.menu-mode .home-bottom-btn {
    min-width: 0;
    min-height: 48px;
    padding-inline: 1px;
  }

  html[data-language="ja"].ui-confirmation-app body.menu-mode .home-bottom-btn strong {
    font-size: 11px;
    line-height: 1;
    letter-spacing: -.04em;
    white-space: nowrap;
  }

  html.ui-confirmation-app .my-page-screen {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px 8px 96px;
    overscroll-behavior-y: contain;
  }

  html.ui-confirmation-app .my-page-scale-content {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100%;
  }

  html.ui-confirmation-app .my-page-main {
    align-content: start;
    gap: 7px;
  }

  html.ui-confirmation-app .my-page-panel {
    width: 100%;
  }

  html.ui-confirmation-app .my-page-home-row {
    height: 80px;
    padding: 8px;
  }
}

/* Online close-win finisher: winner-side only, one narrow blue-white bolt. */
.online-final-move-lightning {
  --strike-x: 50vw;
  --strike-y: 60vh;
  position: fixed;
  z-index: 470;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
}

.online-final-move-lightning[hidden] { display: none; }

.online-final-move-lightning-sky,
.online-final-move-lightning-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.online-final-move-lightning-sky {
  background:
    radial-gradient(circle at var(--strike-x) calc(var(--strike-y) - 24vh), rgba(82, 169, 255, .58), transparent 34%),
    linear-gradient(rgba(0, 10, 34, .64), rgba(0, 22, 56, .3));
}

.online-final-move-lightning-flash {
  z-index: 4;
  background: rgba(196, 235, 255, .98);
  mix-blend-mode: screen;
}

.online-final-move-lightning-bolt {
  position: absolute;
  z-index: 5;
  top: -2vh;
  left: calc(var(--strike-x) - 29px);
  width: 58px;
  height: calc(var(--strike-y) + 2vh);
  overflow: visible;
  opacity: 0;
  filter:
    drop-shadow(0 0 4px #fff)
    drop-shadow(0 0 8px #50c8ff)
    drop-shadow(0 0 16px #087cff)
    drop-shadow(0 0 30px rgba(0, 86, 255, .98));
}

.online-final-move-lightning-bolt path {
  fill: #f4fcff;
  stroke: #43c7ff;
  stroke-width: 3.4;
  vector-effect: non-scaling-stroke;
}

.online-final-move-lightning-impact {
  position: absolute;
  z-index: 6;
  left: var(--strike-x);
  top: var(--strike-y);
  width: 0;
  height: 0;
}

.online-final-move-lightning-impact .impact-core,
.online-final-move-lightning-impact .impact-ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.15);
}

.online-final-move-lightning-impact .impact-core {
  width: 54px;
  height: 54px;
  background: radial-gradient(circle, #fff 0 16%, #bfeaff 30%, rgba(62, 157, 255, .44) 58%, transparent 75%);
  filter: drop-shadow(0 0 18px #8bd5ff);
}

.online-final-move-lightning-impact .impact-ring {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(207, 242, 255, .95);
  box-shadow: 0 0 12px #7ecbff, inset 0 0 12px #7ecbff;
}

.online-final-move-lightning-impact i {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 4px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(#fff, #81cfff 58%, transparent);
  opacity: 0;
  transform: rotate(var(--spark-angle)) translateY(-10px) scaleY(.2);
  transform-origin: 50% 100%;
  box-shadow: 0 0 7px #8ed8ff;
}

.online-final-move-lightning.is-active .online-final-move-lightning-sky {
  animation: online-final-lightning-sky 1050ms ease-out both;
}

.online-final-move-lightning.is-active .online-final-move-lightning-flash {
  animation: online-final-lightning-flash 820ms steps(1, end) both;
}

.online-final-move-lightning.is-active .online-final-move-lightning-bolt {
  animation: online-final-lightning-bolt 900ms ease-out both;
}

.online-final-move-lightning.is-active .impact-core {
  animation: online-final-lightning-core 720ms 120ms ease-out both;
}

.online-final-move-lightning.is-active .impact-ring {
  animation: online-final-lightning-ring 820ms 105ms ease-out both;
}

.online-final-move-lightning.is-active .online-final-move-lightning-impact i {
  animation: online-final-lightning-spark 610ms 125ms ease-out both;
}

.board.is-online-lightning-struck {
  animation: online-final-lightning-board-shake 420ms 100ms ease-out both;
}

.board .cell.is-online-lightning-target {
  z-index: 2;
  animation: online-final-lightning-cell 920ms ease-out both;
}

@keyframes online-final-lightning-sky {
  0% { opacity: 0; }
  8% { opacity: 1; }
  42% { opacity: .72; }
  100% { opacity: 0; }
}

@keyframes online-final-lightning-flash {
  0%, 7%, 18%, 28%, 100% { opacity: 0; }
  8%, 19% { opacity: .9; }
  20% { opacity: .32; }
}

@keyframes online-final-lightning-bolt {
  0%, 3%, 86%, 100% { opacity: 0; }
  7%, 24% { opacity: 1; }
  31% { opacity: .58; }
  38%, 66% { opacity: 1; }
}

@keyframes online-final-lightning-core {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.15); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.35); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.15); }
}

@keyframes online-final-lightning-ring {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3.5); }
}

@keyframes online-final-lightning-spark {
  0% { opacity: 0; transform: rotate(var(--spark-angle)) translateY(-8px) scaleY(.15); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--spark-angle)) translateY(-62px) scaleY(1); }
}

@keyframes online-final-lightning-board-shake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-5px, 3px); }
  30% { transform: translate(5px, -3px); }
  46% { transform: translate(-3px, -2px); }
  64% { transform: translate(3px, 2px); }
  82% { transform: translate(-1px, 1px); }
}

@keyframes online-final-lightning-cell {
  0%, 100% { filter: none; }
  10% { filter: brightness(2.9) drop-shadow(0 0 13px #8bd8ff); }
  48% { filter: brightness(1.55) drop-shadow(0 0 8px #2e9cff); }
}
