/* Every decorative figure has one home; only the footer companion repeats. */
#hoster-diagnostics {
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
#hoster-diagnostics summary {
  cursor: pointer;
}
#hoster-diagnostics ul {
  padding-left: 18px;
  margin-top: 8px;
}
/* A full portrait belongs to portrait cards; wide art keeps its native ratio. */
.poster-box > img,
.trending-image > img {
  object-fit: contain;
  object-position: center;
}
.poster-box,
.trending-image {
  isolation: isolate;
}
.poster-box > .poster-fallback,
.trending-image > .poster-fallback {
  z-index: -1;
}
.detail-poster .poster-box {
  aspect-ratio: 2 / 3;
}
.continue-card:not(.has-landscape) .poster-box {
  aspect-ratio: 2 / 3;
  height: auto;
  align-self: center;
}
.view-list .continue-card:not(.has-landscape) .poster-box {
  width: 58px;
  height: 87px;
}
/* Continue watching shows the whole cover beside readable episode details. */
.continue-grid,
.view-grid .continue-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.continue-card:not(.has-landscape) > a {
  gap: 18px;
  padding: 14px;
}
.continue-card:not(.has-landscape) .poster-box {
  width: 104px;
  border-radius: 8px;
  overflow: hidden;
}
.continue-info h3 {
  white-space: normal;
  line-height: 1.4;
  font-size: 15px;
}
.continue-info p,
.continue-time {
  font-size: 11px;
}
.view-list .continue-card:not(.has-landscape) .poster-box {
  width: 68px;
  height: 102px;
}
.view-list .continue-grid {
  grid-template-columns: 1fr;
}
@media (max-width: 700px) {
  .continue-grid,
  .view-grid .continue-grid {
    grid-template-columns: 1fr;
  }
  .continue-card:not(.has-landscape) > a {
    gap: 14px;
    padding: 12px;
  }
  .continue-card:not(.has-landscape) .poster-box {
    width: 90px;
  }
  .view-list .continue-card:not(.has-landscape) .poster-box {
    width: 58px;
    height: 87px;
  }
}
@media (max-width: 600px) {
  .detail-hero {
    padding: 22px 20px;
    gap: 22px;
  }
  .detail-poster {
    width: min(165px, 48vw);
    margin-inline: auto;
  }
  .detail-info {
    min-width: 0;
  }
}
.scene-sprite {
  background-image: var(--character-scenes);
  aspect-ratio: var(--scene-ratio, 1);
}
.scene-sprite.pose-seat {
  background-position-x: 0%;
}
.scene-sprite.pose-discover {
  background-position-x: 50%;
}
.scene-sprite.pose-library {
  background-position-x: 100%;
}
.hero-quote {
  margin-top: 6px;
}
.hero {
  min-height: 570px;
  height: clamp(570px, 42vw, 660px);
}
.hero .hero-art {
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: right top;
}
.character-choice .character-sprite {
  height: 128px;
  width: calc(var(--sprite-ratio, 1) * 128px);
  max-height: none;
}
html[data-character="luffy"] .user-avatar {
  background-size: 390% auto;
  background-position: 94.83% 50%;
}
.watch-layout {
  padding-top: 0;
  max-width: 1180px;
  margin-inline: auto;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
}
.watch-page .back-row {
  margin-bottom: 4px;
  max-width: 1180px;
  margin-inline: auto;
}
.watch-page .breadcrumbs {
  max-width: 1180px;
  margin-inline: auto;
  padding: 10px 0 16px;
}
.watch-heading {
  padding-right: 105px;
  min-height: 60px;
  margin-bottom: 18px;
}
.watch-heading h1 {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.5px;
}
.watch-heading h1 a:hover {
  color: var(--accent);
}
.watch-heading p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.watch-sidebar {
  margin-top: 78px;
}
.watch-page .watch-detail {
  max-width: 1180px;
  margin-inline: auto;
}
.watch-detail h2 {
  font-size: 24px;
  line-height: 1.3;
  margin: 10px 0;
}
.watch-page .server-panel {
  flex-direction: column;
}
.watch-page .server-notice {
  width: 100%;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  padding: 9px 16px;
  text-align: left;
}
.watch-page .server-notice > span {
  display: none;
}
.watch-page .server-options {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
}
.watch-page .language-tabs,
.watch-page .hoster-buttons,
.watch-page #hoster-diagnostics {
  grid-column: 1 / -1;
  margin: 0;
}
.watch-page .hoster-buttons {
  align-items: flex-start;
}
.watch-page #hoster-recheck {
  grid-column: 2;
  grid-row: 3;
  min-height: 30px;
  padding: 5px 0;
}
.watch-page #server-status {
  grid-column: 1;
  grid-row: 3;
  align-self: center;
  margin: 0;
}
.hoster-buttons button.active[data-health="available"] .hoster-status {
  color: var(--button-ink);
}
.hoster-choice {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hoster-open {
  font-size: 10px;
  color: var(--accent);
  padding: 3px 0;
}
.hoster-open:hover {
  text-decoration: underline;
}
@media (max-width: 1050px) and (min-width: 801px) {
  .watch-layout {
    grid-template-columns: minmax(0, 1fr) 225px;
    gap: 16px;
  }
}
@media (max-width: 800px) {
  .hero {
    height: auto;
    min-height: 0;
    padding-top: calc(100% * 2 / 3 - 24px);
  }
  .hero .hero-art {
    height: auto;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: contain;
  }
  .hero .hero-signature {
    top: calc(100vw * 2 / 3 - 85px);
    bottom: auto;
    max-width: 48%;
  }
  .hero-signature > span {
    font-size: clamp(18px, 3vw, 23px);
  }
  .watch-sidebar {
    margin-top: 18px;
  }
  .watch-heading {
    min-height: 56px;
    padding-right: 84px;
  }
}
@media (max-width: 560px) {
  .watch-heading {
    padding-left: 20px;
  }
  .watch-page .hoster-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hoster-choice > button {
    width: 100%;
  }
  .watch-page #hoster-recheck {
    min-height: 42px;
  }
}
.player-stage {
  position: relative;
}
.player-rim {
  position: relative;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(110deg, var(--accent-soft), var(--panel) 46%);
  pointer-events: none;
}
.player-mascot {
  position: absolute;
  height: 122px;
  width: calc(var(--scene-ratio, 1) * 122px);
  right: 34px;
  top: 0;
  transform: translateY(calc(-1 * var(--seat-y, 74%)));
  z-index: 2;
  filter: drop-shadow(0 4px 5px #00000018);
}
.player-rim-signature {
  position: absolute;
  bottom: 11px;
  left: 17px;
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--accent);
  opacity: 0.65;
}
.player-stage > .video-container {
  border-radius: 0 0 12px 12px;
}
.player-stage > .video-container:fullscreen,
.player-stage > .video-container:-webkit-full-screen {
  border-radius: 0;
}
.player-stage > .video-container.mini-player {
  border-radius: 10px;
}
.watch-sidebar .episode-row {
  gap: 0;
}
.watch-sidebar .watch-episode {
  width: 100%;
}
.world-edge {
  position: fixed;
  width: 17px;
  top: 100px;
  bottom: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent,
    var(--accent-soft) 45%,
    transparent
  );
}
.world-edge-left {
  left: 0;
  border-left: 1px solid var(--accent-soft);
}
.world-edge-right {
  right: 0;
  border-right: 1px solid var(--accent-soft);
}
.world-edge > span {
  position: absolute;
  top: 34%;
  font-size: 10px;
  font-weight: 700;
  writing-mode: vertical-rl;
  letter-spacing: 6px;
  color: var(--accent);
  opacity: 0.24;
}
.world-edge-left > span {
  left: 3px;
}
.world-edge-right > span {
  right: 3px;
}
.site-footer {
  border-top-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}
@media (max-width: 800px) {
  .controls-right #player-quality {
    width: 68px;
    max-width: 68px;
    padding-inline: 3px;
  }
  .controls-right #player-speed {
    width: 47px;
    max-width: 47px;
    padding-inline: 3px;
  }
  .character-choice .character-sprite {
    height: 94px;
    width: calc(var(--sprite-ratio, 1) * 94px);
  }
  .watch-layout {
    padding-top: 0;
  }
  .player-rim {
    height: 31px;
  }
  .player-mascot {
    height: 100px;
    width: calc(var(--scene-ratio, 1) * 100px);
    right: 17px;
  }
  .player-rim-signature {
    font-size: 10px;
    bottom: 8px;
    left: 12px;
  }
  .world-edge {
    width: 3px;
    top: 122px;
    bottom: calc(62px + env(safe-area-inset-bottom));
  }
  .world-edge > span {
    display: none;
  }
}

body { font-size: 15px; }
.main-nav a, .header-search input, .anime-card h3, .continue-card h3,
.toolbar-button, .watch-episode strong, .episode-item h3, .tag,
.text-link, .btn, .watch-detail p { font-size: 0.82rem; }

/* One language per row; all sources stay visible during a refresh. */
.watch-page .server-options { grid-template-columns: minmax(0,1fr); gap:8px; }
.server-matrix { min-width:0; }
.server-language-row { display:grid; grid-template-columns:104px minmax(0,1fr) 124px; gap:10px; align-items:center; padding:6px 0; border-bottom:1px solid var(--line); }
.server-language-row:last-child { border-bottom:0; }
.language-choice { color:var(--muted); background:transparent; text-align:left; padding:10px 8px; border-radius:8px; font-size:12px; min-height:44px; }
.language-choice.active { color:var(--accent); background:var(--accent-soft); font-weight:700; }
.language-choice:disabled { opacity:.55; cursor:default; }
.language-empty { font-size:11px; color:var(--muted); }
.watch-page .server-language-row .hoster-buttons { display:grid; grid-template-columns:repeat(4,minmax(0,96px)); justify-content:start; grid-column:auto; gap:6px; }
.server-language-row .hoster-buttons button { padding:3px 4px; min-width:0; min-height:36px; height:36px; font-size:11px; line-height:1.1; width:100%; color:var(--ink); gap:2px; align-items:center; text-align:center; align-self:stretch; }
.watch-page .server-language-row .hoster-buttons button.active {
  background:var(--accent-fill,var(--accent));
  color:var(--selection-ink,var(--button-ink));
}
.watch-page .server-language-row .hoster-buttons button.active .hoster-status {
  color:inherit;
  opacity:1;
}
.server-language-row .hoster-status { display:block; font-size:9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.35; width:100%; flex-shrink:0; text-align:center; margin-top:auto; }
.server-language-row .hoster-status::before { display:inline-block; margin-right:4px; vertical-align:middle; }
.server-download { min-width:0; display:flex; flex-direction:column; justify-content:center; gap:3px; padding:0 0 0 10px; border-left:1px solid var(--line); }
.server-download .btn { font-size:11px; min-height:34px; padding:5px 8px; white-space:normal; }
.server-download .btn::before { content:''; width:17px; height:17px; flex-shrink:0; background:currentColor; mask:url('/static/icons/download.svg') center/contain no-repeat; }
.server-download p { color:var(--muted); font-size:9px; line-height:1.3; text-align:center; overflow-wrap:anywhere; }
.server-footer { grid-column:1/-1; border-top:1px solid var(--line); padding-top:4px; }
.watch-page .server-footer #hoster-recheck { grid-column:auto; grid-row:auto; min-height:40px; background:transparent; color:var(--accent); padding:8px 0; }
.episode-section .episode-row { gap:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--panel); }
.episode-section .episode-row > .episode-item { border:0; border-radius:0; background:transparent; }
.episode-section .episode-row .episode-download { align-self:stretch; width:48px; border-radius:0; background:transparent; border-left:1px solid var(--line); }
.episode-section .episode-row .episode-download:hover { background:var(--accent-soft); }
@media(max-width:900px) { .server-language-row { grid-template-columns:104px minmax(0,1fr); gap:6px 10px; } .server-download { grid-column:2; width:124px; border-left:0; padding:0; } }
/* Phone: language and download form the header; servers get the full row. */
@media(max-width:560px) {
  .watch-page .server-options { padding:14px 12px 8px; }
  .server-matrix { display:grid; gap:10px; }
  .server-language-row, .server-language-row:last-child {
    grid-template-columns:minmax(0,1fr) 124px;
    grid-template-areas:"language download" "servers servers";
    gap:10px 8px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--panel);
    align-items:start;
  }
  .server-language-row .language-choice {
    grid-area:language;
    min-height:34px;
    padding:8px;
    font-size:12px;
    align-self:start;
  }
  .watch-page .server-language-row .hoster-buttons {
    grid-area:servers;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }
  .server-language-row .hoster-buttons button { font-size:12px; }
  .server-language-row .hoster-status { font-size:10px; }
  .server-language-row .server-download {
    grid-area:download;
    width:auto;
    padding:0;
    border:0;
  }
  .server-language-row .server-download .btn { white-space:nowrap; }
}
.watch-sidebar #episode-list, .episode-section .episode-list { display:flex; flex-direction:column; gap:4px; }
.watch-sidebar .episode-row { flex-shrink:0; }
/* C.C. uses the original bright green for every character accent in both modes. */
html[data-theme="light"][data-character="cc"] {
  --accent:var(--character-accent);
  --accent-fill:var(--character-accent);
  --green:var(--character-accent);
  --button-ink:#17171d;
  --selection-ink:#17171d;
}
html[data-character="cc"] .text-link,
html[data-character="cc"] .hoster-buttons button[data-health="available"]:not(.active) .hoster-status {
  color:var(--character-accent);
}
html[data-theme="light"][data-character="cc"] .btn-primary,
html[data-theme="light"][data-character="cc"] .server-notice,
html[data-theme="light"][data-character="cc"] .alphabet button.active,
html[data-theme="light"][data-character="cc"] .pagination button.active,
html[data-theme="light"][data-character="cc"] .section-tabs button.active {
  background:var(--accent-fill);
  color:var(--selection-ink);
}
.player-idle {
  background:radial-gradient(ellipse at 50% 40%,var(--accent-soft),transparent 72%),var(--panel);
}
.player-idle .player-logo { color:var(--ink); }
.video-container:has(.player-idle:not([hidden])) .video-loader,
.video-container:has(.player-idle:not([hidden])) .video-controls { visibility:hidden; }
.player-ready-start {
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  z-index:6;
  display:grid;
  place-items:center;
  width:64px;
  height:64px;
  border-radius:50%;
  color:var(--selection-ink,var(--button-ink));
  background:var(--accent-fill,var(--accent));
  box-shadow:0 4px 22px #0005;
}
.player-ready-start .icon { width:28px; height:28px; margin-left:3px; }
@media(max-width:560px) { .player-ready-start { width:48px; height:48px; } }
.episode-item .ep-title {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.episode-item .ep-title h3 { min-width:0; }
.episode-item .ep-title > span {
  margin-top:0;
  flex-shrink:0;
  white-space:nowrap;
}
.watch-episode-title {
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  flex:1;
}
.watch-episode-title strong {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.watch-episode-title .episode-status {
  display:inline-flex;
  align-items:center;
  gap:4px;
  flex-shrink:0;
  white-space:nowrap;
  font-size:9px;
  font-weight:400;
}
.watch-episode-title .episode-status .icon { width:10px; height:10px; }
.episode-download-ready { color:var(--accent); }
.episode-download-ready[hidden] { display:none!important; }
@media(min-width:901px),(max-width:360px) {
  .watch-sidebar .episode-ready-label { display:none; }
  .watch-sidebar .episode-download-ready {
    padding:4px;
    border:1px solid var(--accent);
    border-radius:5px;
  }
}
.server-download .btn.download-ready,
.episode-section .episode-row .episode-download.download-ready {
  background:var(--accent-fill,var(--accent));
  color:var(--selection-ink,var(--button-ink));
  border-color:var(--accent);
}
.server-download .btn.download-ready::before { mask-image:url('/static/icons/check.svg'); }
.server-download .btn.download-ready { font-size:10px; }
.character-sprite.mascot-trigger {
  padding:0;
  border:0;
  background-color:transparent;
  pointer-events:auto;
  cursor:pointer;
  touch-action:manipulation;
  outline-offset:4px;
}
.mascot-trigger:focus-visible { outline:2px solid var(--accent); }
.mascot-awake { animation:mascot-aura .85s ease-out; }
.mascot-burst {
  position:fixed;
  width:0;
  height:0;
  z-index:1200;
  pointer-events:none;
  color:var(--accent);
}
.mascot-burst span {
  position:absolute;
  width:5px;
  height:5px;
  border-radius:50%;
  background:currentColor;
  box-shadow:0 0 9px currentColor;
  animation:mascot-spark .85s ease-out forwards;
}
.mascot-message {
  position:fixed;
  z-index:1200;
  bottom:calc(84px + env(safe-area-inset-bottom));
  left:50%;
  transform:translateX(-50%);
  width:max-content;
  max-width:min(360px,calc(100% - 32px));
  border:1px solid var(--accent);
  border-radius:14px;
  padding:12px 16px;
  background:var(--panel);
  color:var(--ink);
  font-size:13px;
  line-height:1.5;
  box-shadow:0 8px 30px #0003;
  pointer-events:none;
}
@media(min-width:801px) { .mascot-message { bottom:28px; } }
@keyframes mascot-aura {
  0%,100% { filter:none; }
  40% { filter:drop-shadow(0 0 12px var(--accent)) drop-shadow(0 0 22px var(--accent)); }
}
@keyframes mascot-spark {
  from { opacity:1; transform:rotate(var(--spark-angle)) translateX(8px) scale(1); }
  to { opacity:0; transform:rotate(var(--spark-angle)) translateX(42px) scale(.3); }
}
@media(prefers-reduced-motion:reduce) {
  .mascot-awake,.mascot-burst span { animation:none; }
  .mascot-burst { display:none; }
}
@media(max-width:560px) {
  .watch-page .player-stage,
  .watch-page .watch-toolbar,
  .watch-page .server-panel { margin-inline:10px; }
  .watch-page .watch-toolbar {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:6px;
    padding:10px 12px;
  }
  .watch-page .watch-toolbar > div {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;
  }
  .watch-page .watch-toolbar .toolbar-button,
  .watch-page .watch-toolbar .toggle-control {
    min-width:0;
    min-height:38px;
    padding:6px 8px;
    justify-content:center;
    font-size:11px;
    line-height:1.2;
    color:var(--ink);
    background:var(--panel-light);
    border:1px solid var(--line);
    border-radius:8px;
  }
  .watch-page .watch-toolbar .switch { flex-shrink:0; }
  .watch-page .episode-navigation #next-episode { grid-column:2; }
  .watch-page .episode-navigation:empty { display:none; }
}
