/* ==========================================================================
   網球咖 · TC — v3.0 Grand Slam Editorial Design System
   對齊規範：4px/5px/8px/12px 銳利圓角 · 雜誌襯線+iOS無襯線 · 82%/92%防尷尬玻璃
   ========================================================================== */

:root {
  /* Closed Mobile Type Scale */
  --text-hero-time: 3.125rem;   /* 50px — 精選時刻 Serif 主視覺 */
  --text-large-title: 2rem;     /* 32px — 一級頁大標題 */
  --text-display: 1.625rem;     /* 26px — 詳情 / 結案標題 */
  --text-h2: 1.3125rem;         /* 21px — 卡片 / 抽屜大標 */
  --text-h3: 1.0625rem;         /* 17px — 頂列 / 小卡標題 */
  --text-body: 0.9375rem;       /* 15px — 正文 / 表單 / 對話 */
  --text-sub: 0.875rem;         /* 14px — 次要說明 */
  --text-cap: 0.8125rem;        /* 13px — 輔助標籤（禁止 <12px 擁擠小字） */

  --font-serif: "Instrument Serif", "Noto Serif TC", "Songti TC", Georgia, serif;
  --font-tc-serif: "Noto Serif TC", "Songti TC", Georgia, serif;
  --font-sans: "PingFang TC", "SF Pro TC", "Noto Sans TC", "DM Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  /* 8pt / 4pt 空間節奏 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* 銳利建築微圓角（嚴格對齊定案總綱） */
  --radius-badge: 4px;
  --radius-control: 5px;
  --radius-card: 8px;
  --radius-panel: 12px;
  --radius-pill: 999px;

  /* 觸控安全熱區 */
  --touch-target: 44px;
  --dock-safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock-bottom-offset: calc(var(--dock-safe-bottom) + var(--space-2));

  /* 動態節奏 */
  --dur-fast: 150ms;
  --dur-spring: 280ms;
  --dur-sheet: 300ms;
  --ease-snappy: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-decel: cubic-bezier(0.16, 1, 0.3, 1);

  /* 預設地圖顏色（方案 C Grand Slam 純向量訂製地圖，隨皮膚切換） */
  --bg-map: #eeebe2;
  --bg-map-water: #d2e2ea;
  --bg-map-park: #d6e4d5;
  --bg-map-road: #ffffff;
  --bg-map-road-minor: #f7f5f0;
  --bg-map-grid: rgba(22, 58, 42, 0.055);
  --bg-map-label: rgba(22, 58, 42, 0.46);
  --map-radar-accent: #E2F03B;
  --map-radius-edge: var(--accent-solid);
  --map-radius-fill: var(--map-radius-edge);
}

/* --------------------------------------------------------------------------
   Skin A（日間預設）：經典球場 · 法網紅土 × 溫布頓墨綠
   -------------------------------------------------------------------------- */
:root,
html[data-theme="club-classic"] {
  --brand-pine: #163A2A;
  --brand-clay: #9E3B1D;
  --brand-cream: #F6F2EA;
  --brand-lime: #E2F03B;
  --accent-solid: #163A2A;
  --crest-bg: #163A2A;
  --accent-tint: rgba(22, 58, 42, 0.12);
  --bg-reading-surface: #F6F2EA;
  --bg-wheel-options: #E4E9DF;
  --overlay-rgb: 18 42 32;
  --text-on-overlay: #FFFDF2;

  --shell-bg: radial-gradient(circle at 22% 18%, #214E39 0%, #10281E 60%, #091610 100%);
  --bg-surface: rgba(246, 242, 234, 0.84);
  --bg-surface-strong: rgba(248, 245, 239, 0.94);
  --bg-subtle: rgba(22, 58, 42, 0.08);
  --bg-nav: rgba(246, 242, 234, 0.9);
  --bg-chip-glass: rgba(9, 24, 17, 0.72);

  --text-primary: #11261C;
  --text-secondary: #2F4B3D;
  --text-muted: #566E62;
  --text-on-canvas: #F6F2EA;
  --text-on-canvas-muted: rgba(246, 242, 234, 0.78);
  --text-on-accent: #F6F2EA;

  --cta-bg: linear-gradient(135deg, #184A35 0%, #0F3122 100%);
  --cta-bg-hover: linear-gradient(135deg, rgba(28, 72, 52, 0.96) 0%, rgba(18, 52, 37, 0.84) 100%);
  --cta-specular: rgba(255, 255, 255, 0.34);
  --cta-shadow: 0 10px 24px rgba(10, 28, 19, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);

  --border-hairline: rgba(22, 58, 42, 0.16);
  --border-strong: rgba(22, 58, 42, 0.32);
  --border-glass: rgba(255, 255, 255, 0.62);
  --backdrop-tint: rgba(8, 18, 13, 0.56);

  --badge-ok-bg: rgba(22, 58, 42, 0.12);
  --badge-ok-fg: #163A2A;
  --badge-warn-bg: rgba(158, 59, 29, 0.14);
  --badge-warn-fg: #8B2F13;
  --badge-info-bg: rgba(22, 58, 42, 0.1);
  --badge-info-fg: #1E4D36;
  --badge-danger-bg: rgba(169, 44, 34, 0.14);
  --badge-danger-fg: #8E1F17;

  --shadow-card: 0 8px 24px rgba(8, 22, 16, 0.16);
  --shadow-float: 0 16px 38px rgba(8, 22, 16, 0.28);
  --scrim-normal: linear-gradient(180deg, rgba(8, 18, 13, 0.56) 0%, rgba(10, 20, 15, 0.34) 34%, rgba(8, 14, 11, 0.78) 100%);
  --scrim-guard: linear-gradient(180deg, rgba(10, 18, 14, 0.72) 0%, rgba(6, 12, 9, 0.88) 100%);
  --wheel-lens-bg: rgba(255, 255, 255, 0.92);
}

/* --------------------------------------------------------------------------
   Skin B（特別皮膚）：澳網硬地 · Melbourne Sapphire Blue
   -------------------------------------------------------------------------- */
html[data-theme="aus-blue"] {
  --brand-pine: #15548A;
  --brand-clay: #0F3B63;
  --brand-cream: #FFFFFF;
  --brand-lime: #E2F03B;
  --accent-solid: #15548A;
  --crest-bg: #15548A;
  --accent-tint: rgba(21, 84, 138, 0.12);
  --bg-reading-surface: #FFFFFF;
  --bg-wheel-options: #E6EDF5;
  --overlay-rgb: 16 40 68;

  --shell-bg: radial-gradient(circle at 20% 18%, #1C69AA 0%, #10406C 58%, #09243E 100%);
  --bg-surface: rgba(255, 255, 255, 0.86);
  --bg-surface-strong: rgba(255, 255, 255, 0.95);
  --bg-subtle: rgba(21, 84, 138, 0.08);
  --bg-nav: rgba(255, 255, 255, 0.92);
  --bg-chip-glass: rgba(10, 34, 58, 0.74);

  --text-primary: #0F2740;
  --text-secondary: #284B6E;
  --text-muted: #52708E;
  --text-on-canvas: #FFFFFF;
  --text-on-canvas-muted: rgba(255, 255, 255, 0.82);
  --text-on-accent: #FFFFFF;

  --cta-bg: linear-gradient(135deg, #1762A1 0%, #0F426E 100%);
  --cta-bg-hover: linear-gradient(135deg, rgba(25, 98, 160, 0.97) 0%, rgba(16, 66, 110, 0.85) 100%);
  --cta-specular: rgba(255, 255, 255, 0.42);
  --cta-shadow: 0 10px 24px rgba(9, 36, 62, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.34);

  --border-hairline: rgba(15, 39, 64, 0.14);
  --border-strong: rgba(21, 84, 138, 0.34);
  --border-glass: rgba(255, 255, 255, 0.72);
  --backdrop-tint: rgba(7, 25, 44, 0.56);

  --badge-ok-bg: rgba(21, 84, 138, 0.12);
  --badge-ok-fg: #15548A;
  --badge-warn-bg: rgba(176, 82, 16, 0.14);
  --badge-warn-fg: #8C3D07;
  --badge-info-bg: rgba(21, 84, 138, 0.11);
  --badge-info-fg: #15548A;
  --badge-danger-bg: rgba(178, 39, 39, 0.13);
  --badge-danger-fg: #991B1B;

  --bg-map: #e7eef6;
  --bg-map-water: #c5def4;
  --bg-map-park: #d2e5db;
  --bg-map-road: #ffffff;
  --bg-map-road-minor: #f2f7fc;
  --bg-map-grid: rgba(21, 84, 138, 0.06);
  --bg-map-label: rgba(21, 84, 138, 0.48);

  --shadow-card: 0 8px 24px rgba(8, 30, 54, 0.16);
  --shadow-float: 0 16px 38px rgba(8, 30, 54, 0.28);
  --scrim-normal: linear-gradient(180deg, rgba(7, 24, 44, 0.56) 0%, rgba(9, 28, 48, 0.32) 34%, rgba(6, 20, 36, 0.76) 100%);
  --scrim-guard: linear-gradient(180deg, rgba(9, 28, 48, 0.70) 0%, rgba(6, 20, 36, 0.88) 100%);
  --wheel-lens-bg: rgba(255, 255, 255, 0.94);
}

/* --------------------------------------------------------------------------
   Skin C（夜間預設）：夜場森林 · Dark Editorial × Restrained Tennis Yellow
   -------------------------------------------------------------------------- */
html[data-theme="club-night"] {
  --brand-pine: #E2F03B;
  --brand-clay: #E07A57;
  --brand-cream: #F3EFE6;
  --brand-lime: #E2F03B;
  --accent-solid: #E2F03B;
  --map-radius-edge: #536317;
  --map-radius-fill: #A1B831;
  --crest-bg: #162E24;
  --accent-tint: rgba(226, 240, 59, 0.14);
  --bg-reading-surface: #142C22;
  --bg-wheel-options: #243C32;
  --overlay-rgb: 12 34 24;

  --shell-bg: radial-gradient(circle at 22% 18%, #132C21 0%, #091711 60%, #040B08 100%);
  --bg-surface: rgba(20, 44, 34, 0.84);
  --bg-surface-strong: rgba(15, 34, 26, 0.94);
  --bg-subtle: rgba(243, 239, 230, 0.09);
  --bg-nav: rgba(14, 33, 25, 0.92);
  --bg-chip-glass: rgba(9, 22, 16, 0.76);

  --text-primary: #F3EFE6;
  --text-secondary: #C8D7CE;
  --text-muted: #93ABA0;
  --text-on-canvas: #F3EFE6;
  --text-on-canvas-muted: rgba(243, 239, 230, 0.72);
  --text-on-accent: #0D1F17;

  --cta-bg: linear-gradient(135deg, rgba(226, 240, 59, 0.94) 0%, rgba(196, 214, 34, 0.78) 100%);
  --cta-bg-hover: linear-gradient(135deg, rgba(235, 247, 86, 0.97) 0%, rgba(210, 226, 48, 0.85) 100%);
  --cta-specular: rgba(255, 255, 255, 0.56);
  --cta-shadow: 0 10px 26px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.48);

  --border-hairline: rgba(243, 239, 230, 0.14);
  --border-strong: rgba(226, 240, 59, 0.36);
  --border-glass: rgba(243, 239, 230, 0.18);
  --backdrop-tint: rgba(2, 8, 5, 0.72);

  --badge-ok-bg: rgba(226, 240, 59, 0.16);
  --badge-ok-fg: #E2F03B;
  --badge-warn-bg: rgba(240, 152, 92, 0.18);
  --badge-warn-fg: #FFC196;
  --badge-info-bg: rgba(145, 212, 180, 0.16);
  --badge-info-fg: #BEEBD4;
  --badge-danger-bg: rgba(240, 102, 94, 0.2);
  --badge-danger-fg: #FFB2AD;

  --bg-map: #101922;
  --bg-map-water: #0d2234;
  --bg-map-park: #142a23;
  --bg-map-road: #25364a;
  --bg-map-road-minor: #182534;
  --bg-map-grid: rgba(226, 240, 59, 0.05);
  --bg-map-label: rgba(226, 240, 59, 0.44);

  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.44);
  --shadow-float: 0 18px 42px rgba(0, 0, 0, 0.62);
  --scrim-normal: linear-gradient(180deg, rgba(6, 14, 10, 0.5) 0%, rgba(5, 11, 8, 0.84) 100%);
  --scrim-guard: linear-gradient(180deg, rgba(6, 14, 10, 0.72) 0%, rgba(4, 10, 7, 0.92) 100%);
  --wheel-lens-bg: rgba(243, 239, 230, 0.13);
}

/* --------------------------------------------------------------------------
   Skin D：暮色紅土 · 銅光紅土
   -------------------------------------------------------------------------- */
html[data-theme="rooftop-twilight"] {
  --brand-pine: #933A24;
  --brand-clay: #A65537;
  --brand-cream: #FFF2DE;
  --brand-lime: #E2F03B;
  --accent-solid: #933A24;
  --crest-bg: #35251C;
  --accent-tint: rgba(147, 58, 36, 0.13);
  --bg-reading-surface: #FFF2DE;
  --bg-wheel-options: #F4E2CC;
  --overlay-rgb: 53 37 28;

  --shell-bg: radial-gradient(circle at 22% 18%, #634132 0%, #35251C 60%, #201610 100%);
  --bg-surface: #FFF2DE;
  --bg-surface-strong: #FFF2DE;
  --bg-subtle: #F4E2CC;
  --bg-nav: rgba(53, 37, 28, 0.94);
  --bg-chip-glass: rgba(53, 37, 28, 0.91);

  --text-primary: #34271F;
  --text-secondary: #684B3A;
  --text-muted: #71513E;
  --text-on-canvas: #FFF4E8;
  --text-on-canvas-muted: #ECD2BA;
  --text-on-accent: #FFF6E9;

  --cta-bg: #933A24;
  --cta-bg-hover: #792C1A;
  --cta-specular: #BB7457;
  --cta-shadow: 0 7px 18px rgba(77, 33, 21, 0.26);

  --border-hairline: #D3BBA1;
  --border-strong: #986E50;
  --border-glass: #DBBFA6;
  --backdrop-tint: rgba(32, 22, 15, 0.62);

  --badge-ok-bg: #E5E6CC;
  --badge-ok-fg: #394528;
  --badge-warn-bg: #F4E2CA;
  --badge-warn-fg: #743F22;
  --badge-info-bg: #EED8C5;
  --badge-info-fg: #753B26;
  --badge-danger-bg: rgba(240, 102, 94, 0.2);
  --badge-danger-fg: #8E251B;

  --bg-map: #EADBC8;
  --bg-map-water: #CFD8C6;
  --bg-map-park: #D8DDBB;
  --bg-map-road: #FFF3DF;
  --bg-map-road-minor: #F4E7D4;
  --bg-map-grid: rgba(96, 68, 50, 0.1);
  --bg-map-label: #604432;
  --map-radar-accent: #A65537;
  --map-radius-fill: var(--brand-clay);

  --shadow-card: 0 8px 22px rgba(36, 22, 14, 0.22);
  --shadow-float: 0 15px 34px rgba(36, 22, 14, 0.34);
  --scrim-normal: linear-gradient(180deg, rgba(53, 37, 28, 0.52) 0%, rgba(53, 37, 28, 0.16) 38%, rgba(30, 19, 12, 0.8) 100%);
  --scrim-guard: linear-gradient(180deg, rgba(53, 37, 28, 0.63) 0%, rgba(30, 19, 12, 0.86) 100%);
  --wheel-lens-bg: #FFF6E9;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: #091610;
  touch-action: pan-x pan-y;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand-lime);
  outline-offset: 2px;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.editorial-serif {
  font-family: var(--font-serif);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Desktop Reviewer Shell & Phone Frame
   ========================================================================== */
.studio-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 14px;
}

.reviewer-launch {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 600;
  width: auto !important;
  min-height: 40px !important;
  padding: 0 14px !important;
  border-radius: var(--radius-control) !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.34) !important;
  color: #F6F2EA !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: var(--text-cap) !important;
  font-weight: 700;
}

.reviewer-bar {
  width: min(760px, 94vw);
  margin: auto;
  background: var(--bg-surface-strong);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-panel);
  padding: 20px;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.reviewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.reviewer-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.reviewer-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.control-label {
  font-size: var(--text-cap);
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 4px;
}

.theme-chip,
.scenario-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: var(--text-cap);
  font-weight: 600;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.theme-chip.is-active,
.theme-chip[aria-pressed="true"] {
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-color: var(--accent-solid);
}

.scenario-chip:hover {
  border-color: var(--border-strong);
}

.phone-stage {
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-frame {
  position: relative;
  width: 390px;
  height: min(844px, calc(100dvh - 32px));
  background: #0F231A;
  border-radius: 44px;
  border: 7px solid #09150F;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.56);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* Full-Bleed Surface × Time Backdrop + Dynamic Scrim */
.app-backdrop-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity var(--dur-spring) ease;
}

.app-backdrop-scene svg,
.app-backdrop-scene .backdrop-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.02);
  transition: filter var(--dur-spring) ease, opacity var(--dur-spring) ease;
}

.app-backdrop-scene .backdrop-photo.is-night-graded {
  filter: brightness(0.46) contrast(1.22) saturate(0.84) hue-rotate(-6deg);
}

.app-backdrop-scene .backdrop-floodlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 80% 14%, rgba(255, 250, 214, 0.24) 0%, rgba(226, 240, 59, 0.08) 28%, transparent 58%),
    radial-gradient(circle at 22% 18%, rgba(16, 46, 36, 0.36) 0%, transparent 62%);
}

.app-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--scrim-normal);
  transition: background var(--dur-fast) ease;
}

.app-scrim.is-reading-guard {
  background: var(--scrim-guard);
}

.status-bar,
.app-topbar,
.screen-root,
.bottom-dock {
  position: relative;
  z-index: 2;
}

/* iOS Status Bar */
.status-bar {
  height: 38px;
  padding: 10px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-on-canvas);
  flex-shrink: 0;
}

.dynamic-island {
  width: 108px;
  height: 26px;
  border-radius: 999px;
  background: #050a08;
}

/* ==========================================================================
   App Topbar (Compact 22px TC Monogram + Concise Title)
   ========================================================================== */
.app-topbar {
  min-height: 54px;
  padding: 6px 16px 8px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--text-on-canvas);
  background: transparent;
  border-bottom: 1px solid transparent;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}

.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.topbar-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-mark-compact {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-control);
  background: var(--crest-bg, #163A2A);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  text-shadow: 0 1px 2px #091610, 0 0 7px rgb(9 22 16 / 85%);
  line-height: 1.1;
  white-space: nowrap;
}

.app-topbar.is-subpage .topbar-title {
  font-size: 1.125rem;
}

.app-topbar .icon-btn,
.app-topbar .avatar-btn,
.app-topbar .back-btn {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  border-radius: var(--radius-control);
  background: var(--bg-chip-glass);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--text-on-canvas);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.app-topbar .back-btn {
  width: var(--touch-target);
  height: var(--touch-target);
  padding: 0;
  border-radius: 999px;
  background: rgba(16, 36, 25, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
  flex-shrink: 0;
}

.app-topbar .icon-btn:active,
.app-topbar .avatar-btn:active,
.app-topbar .back-btn:active {
  transform: scale(0.96);
}

.icon-btn.mobile-reviewer-btn {
  display: none;
}

.avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-control);
  background: var(--brand-lime);
  color: #0D1F17;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
}

.notif-count-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-badge);
  background: var(--brand-lime);
  color: #0D1F17;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-topbar .avatar-btn .notif-count-badge {
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  font-size: 12.5px;
}

.topbar-create-btn {
  min-height: var(--touch-target);
  padding: 0 12px;
  border-radius: var(--radius-control);
  background: var(--bg-chip-glass);
  border: 1px solid rgba(226, 240, 59, 0.48);
  color: #E2F03B;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform var(--dur-fast) ease, background var(--dur-fast) ease;
}
.topbar-create-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Main Screen Container & Typography
   ========================================================================== */
.screen-root {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.screen-root:focus {
  outline: none;
}

/* Personal center: only the content between the tabs and close control scrolls. */
.screen-root.is-profile-screen {
  overflow: hidden;
}

.profile-center {
  --profile-canvas: var(--brand-cream);
  --profile-tint: #c1d2bd;
  --profile-highlight: #fffaf1;
  --profile-level: var(--brand-clay);
  --profile-close-size: 48px;
  --profile-close-inset: max(var(--space-3), env(safe-area-inset-bottom));
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  container-type: size;
  color: var(--text-primary);
  background: radial-gradient(ellipse at 72% 24%, var(--profile-highlight) 0%, transparent 62%) top / 100% 55% no-repeat,
    linear-gradient(160deg, var(--profile-tint), var(--profile-canvas) 56%);
}

.profile-center img[data-profile-artwork-loading] { visibility: hidden; }
.profile-center .profile-player-image:not([data-profile-artwork-loading]) + .profile-initial-art { visibility: hidden; }

@media (prefers-reduced-motion: no-preference) {
  .profile-center.is-dock-entering::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: var(--profile-highlight);
    opacity: 0;
    animation: profileDockVeil 200ms cubic-bezier(.32,.72,0,1);
  }

  .profile-center.is-dock-entering > :is(.profile-tabs, .profile-close) {
    animation: profileDockControlsIn 220ms cubic-bezier(.32,.72,0,1);
  }

  @keyframes profileDockVeil {
    from { opacity: .32; }
    to { opacity: 0; }
  }

  @keyframes profileDockControlsIn {
    from { opacity: .66; translate: 0 8px; }
    to { opacity: 1; translate: 0 0; }
  }
}

html[data-theme="aus-blue"] .profile-center { --profile-tint: #c8dceb; --profile-highlight: #f8fdff; }
html[data-theme="club-night"] .profile-center { --profile-canvas: #0f221a; --profile-tint: #254734; --profile-highlight: #376449; --profile-level: var(--brand-lime); }
html[data-theme="rooftop-twilight"] .profile-center { --profile-canvas: #FFF2DE; --profile-tint: #EACBB0; --profile-highlight: #FFF5E6; }

.profile-tabs {
  display: flex;
  flex: none;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
}

.profile-tabs button {
  position: relative;
  flex: 1;
  min-height: var(--profile-close-size);
  color: var(--text-secondary);
  font-weight: 700;
}

.profile-tabs button[aria-selected="true"] { color: var(--text-primary); }
.profile-tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto var(--space-3) 0;
  height: 2px;
  background: var(--accent-solid);
}

.profile-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  padding-bottom: calc(var(--profile-close-size) + var(--profile-close-inset));
  scroll-padding-bottom: calc(var(--profile-close-size) + var(--profile-close-inset) + var(--space-2));
}

.profile-self-panel { padding: 0 var(--space-4) var(--space-4); }
.profile-friends-panel { display: flex; flex-direction: column; min-height: 100%; }
.profile-friends-tools { padding: 12px var(--space-4) 14px; border-bottom: 1px solid var(--border-hairline); }
.profile-friends-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.profile-friends-toolbar button { display: grid; justify-items: center; align-content: start; gap: 5px; min-height: 72px; padding: var(--space-1); border-radius: var(--radius-control); color: var(--text-primary); font-size: var(--text-cap); font-weight: 700; }
.profile-friends-toolbar button[aria-expanded="true"] > span { border-color: var(--accent-solid); background: var(--accent-tint); }
.profile-friends-toolbar button > span svg { width: 22px; height: 22px; }
.profile-inbox-icon { position: relative; }
.profile-inbox-icon small { position: absolute; inset: -4px -4px auto auto; display: grid; place-items: center; min-width: 18px; height: 18px; padding-inline: 3px; border-radius: 999px; background: var(--accent-solid); color: var(--text-on-accent); font-size: 12.5px; }
.profile-friend-search-panel { position: relative; display: block; margin-top: var(--space-3); }
.profile-friend-search-panel > svg { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; }
.profile-friend-search-panel .input { min-height: 48px; padding-left: 40px; }
.profile-friends-roster { flex: 1; padding: 14px var(--space-4) var(--space-4); background: var(--profile-canvas); }
.profile-friends-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: var(--space-1) var(--space-2); margin-bottom: var(--space-1); }
.profile-friends-heading .section-title { margin: 0; }
.profile-player-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: 326px;
  height: clamp(290px, 42cqh, 350px);
  margin: 0 calc(-1 * var(--space-4));
}

.profile-court-lines {
  position: absolute;
  inset: auto -10% -34px;
  width: 120%;
  height: 128px;
  color: var(--accent-solid);
  opacity: .17;
}

.profile-player-image {
  position: absolute;
  inset: 25px 0 auto;
  width: 100%;
  height: calc(100% - 42px);
  object-fit: contain;
  transform: translateX(9%);
}

.profile-player-identity {
  position: absolute;
  inset: var(--space-6) auto auto var(--space-5);
  max-width: 43%;
  overflow-wrap: anywhere;
}

.profile-player-identity h2 { margin: 0; font: 700 var(--text-large-title)/1.2 var(--font-serif); }
.profile-player-identity p { margin: var(--space-1) 0 0; color: var(--text-secondary); font-size: var(--text-sub); }
.profile-player-identity > span { display: inline-block; margin-top: var(--space-1); color: var(--profile-level); font-weight: 700; font-size: var(--text-cap); }

.profile-player-image.is-ai-character { filter: drop-shadow(0 5px 9px #11261c26); }

/* Self profile card. The app's resolved theme also covers automatic day/night. */
.profile-showcase {
  --showcase-panel: #254335;
  --showcase-base: #163a2a;
  --showcase-border: #769381;
  --showcase-edge: #b6c6a1;
  --showcase-accent: #e8efcc;
  --showcase-ink: #f6f2ea;
  --showcase-scene: linear-gradient(140deg, #17372b, #467757 65%, #234433);
  --showcase-ambient: rgb(30 85 53 / 63%);
  --showcase-scrim: #10291b;
  height: clamp(320px, 48cqh, 360px);
  margin: var(--space-1) 0 var(--space-3);
  overflow: clip;
  border: 1px solid var(--showcase-border);
  border-radius: var(--radius-card);
  background: var(--showcase-scene);
  color: var(--showcase-ink);
}
html[data-theme="aus-blue"] .profile-showcase {
  --showcase-panel: #1b4266;
  --showcase-base: #102b48;
  --showcase-border: #6b99ba;
  --showcase-edge: #a9d9f0;
  --showcase-accent: #b6e8ff;
  --showcase-ink: #f4faff;
  --showcase-scene: linear-gradient(140deg, #102b48, #237ab5 65%, #153858);
  --showcase-ambient: rgb(21 84 138 / 62%);
  --showcase-scrim: #0c233a;
}
html[data-theme="club-night"] .profile-showcase {
  --showcase-panel: #20392c;
  --showcase-base: #12251c;
  --showcase-border: #61796b;
  --showcase-edge: #abb18c;
  --showcase-accent: #e7ef9d;
  --showcase-ink: #f5f0e5;
  --showcase-scene: linear-gradient(140deg, #102720, #254865 62%, #122b22);
  --showcase-ambient: transparent;
  --showcase-scrim: #081610;
}
html[data-theme="rooftop-twilight"] .profile-showcase {
  --showcase-panel: #60392b;
  --showcase-base: #35251c;
  --showcase-border: #ae795c;
  --showcase-edge: #ebc59d;
  --showcase-accent: #ffe1b0;
  --showcase-ink: #fff2de;
  --showcase-scene: linear-gradient(142deg, #592e22, #ad5739 64%, #663424);
  --showcase-ambient: rgb(166 85 55 / 82%);
  --showcase-scrim: #321b14;
}
.profile-showcase::before,
.profile-showcase::after {
  position: absolute;
  content: "";
  pointer-events: none;
}
.profile-showcase::before {
  inset: 0 0 13%;
  background: linear-gradient(var(--showcase-ambient), var(--showcase-ambient)),
    url("./assets/backdrops/night-rooftop.jpg") center top / cover;
  mask-image: linear-gradient(#000 40%, transparent 97%);
  opacity: .66;
}
.profile-showcase::after {
  z-index: 2;
  inset: auto 0 0;
  height: 108px;
  background: linear-gradient(transparent, var(--showcase-scrim));
}
.profile-showcase .profile-player-image {
  z-index: 1;
  inset: 56px 2% auto auto;
  width: 68%;
  height: calc(100% - 56px);
  object-fit: contain;
  object-position: right top;
  transform: none;
  mask-image: linear-gradient(#000 83%, transparent);
  filter: drop-shadow(-8px 12px 11px rgb(6 13 10 / 55%));
}
.profile-showcase .profile-player-image.is-waist-crop {
  object-position: right top;
}
.profile-showcase .profile-player-identity {
  z-index: 3;
  isolation: isolate;
  inset: 0 auto auto var(--space-2);
  width: max(118px, 39%);
  max-width: none;
  min-height: 60%;
  padding: 18px var(--space-3) 38px;
}
.profile-showcase .profile-player-identity::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 100% 83%, 73% 98%, 0 86%);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--showcase-edge) 30%, transparent), transparent 5%),
    linear-gradient(160deg, var(--showcase-base) 60%, color-mix(in srgb, var(--showcase-panel) 64%, transparent));
  border-top: 1px solid var(--showcase-edge);
}
.profile-showcase .profile-player-identity h2 {
  font-size: var(--text-display);
}
.profile-self-name-edit {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) 15px;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: var(--touch-target);
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
}
.profile-self-name-edit > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.profile-self-name-edit svg { width: 15px; height: 15px; color: var(--showcase-accent); }
.profile-self-name-edit:hover > span { text-decoration: underline; text-underline-offset: .16em; }
.profile-self-name-edit:focus-visible { outline: 2px solid var(--showcase-accent); outline-offset: 2px; }
.profile-showcase .profile-player-identity > span {
  margin-top: var(--space-2);
  padding-top: var(--space-1);
  border-top: 1px solid var(--showcase-border);
  color: var(--profile-tone-ink, var(--showcase-accent));
}
.profile-showcase-level > span { display: block; }
.profile-ntrp-line { white-space: nowrap; font-size: clamp(.68rem, 3cqi, .82rem); }

.profile-edit-card {
  position: absolute;
  z-index: 4;
  inset: var(--space-2) var(--space-2) auto auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 1px solid var(--showcase-border);
  border-radius: var(--radius-control);
  background: var(--showcase-scrim);
  color: var(--showcase-ink);
  font-size: var(--text-cap);
  font-weight: 700;
}
.profile-edit-card svg { display: block; width: 16px; height: 16px; }
.profile-edit-card:hover { border-color: var(--showcase-accent); }
.profile-showcase-avatar {
  position: relative;
  width: 50px;
  aspect-ratio: 1;
  overflow: hidden;
  margin-bottom: var(--space-3);
  border: 2px solid var(--showcase-edge);
  border-radius: 50%;
  background: var(--showcase-panel);
}
.profile-showcase-avatar img {
  position: absolute;
  inset: -14% 0 auto;
  width: 100%;
  height: auto;
}
.profile-showcase-avatar.has-personal-avatar img {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
}

.profile-showcase .profile-showcase-avatar.avatar-circle {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  font-size: var(--text-h2);
}

.profile-initial-art {
  position: absolute;
  z-index: 2;
  inset: 45px 12px 12px 44%;
  display: grid;
  place-items: center;
  container-type: inline-size;
  pointer-events: none;
}

.profile-initial-badge {
  --profile-tone-fill: #e2f03b;
  --profile-tone-ink: #0d1f17;
  display: grid;
  place-items: center;
  width: min(72cqi, 140px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--profile-tone-fill) 52%, #fff5de);
  background: radial-gradient(circle at 32% 24%,
    color-mix(in srgb, var(--profile-tone-fill) 84%, #fff7e7), var(--profile-tone-fill) 62%);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--profile-tone-fill) 76%, #302916), 0 5px 14px #080d1166;
  color: var(--profile-tone-ink);
  font: 900 clamp(56px, 48cqi, 102px)/1 var(--font-tc-serif);
}

.pc-hero-stage .profile-initial-art { inset: 10px 10px 10px 51%; }
.pc-hero-stage .profile-initial-badge { width: min(90%, 128px); font-size: clamp(38px, 50cqi, 82px); }
.profile-settings-mini .profile-initial-badge { width: min(72%, 70px); font-size: clamp(30px, 40cqi, 47px); }
.profile-showcase:has(.profile-featured-medals) .profile-initial-art { bottom: 72px; }
.profile-featured-medals {
  position: absolute;
  z-index: 4;
  inset: auto var(--space-2) var(--space-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  text-shadow: 0 2px 4px var(--showcase-scrim);
}
.profile-featured-medals h3 {
  margin: 0;
  font-size: 12px;
}
.profile-featured-medals ul {
  display: flex;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.profile-featured-medals button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  cursor: pointer;
}
.profile-featured-medals button:focus-visible {
  outline: 2px solid var(--showcase-accent);
  outline-offset: 2px;
}
.profile-featured-medal {
  display: block;
  width: clamp(56px, 16cqi, 88px);
  height: auto;
  overflow: visible;
}
@media (prefers-reduced-motion: no-preference) {
  .profile-featured-medal-body { transition: transform 160ms ease-out; }
  .profile-featured-medals button:is(:hover, :focus-visible) .profile-featured-medal-body { transform: translateY(-3px); }
}

.profile-ntrp-help {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--space-2);
  background: transparent;
  color: inherit;
  font-size: var(--text-cap);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.profile-ntrp-scale {
  display: grid;
  gap: var(--space-2);
  list-style: none;
  margin: var(--space-3) 0;
  padding: 0;
}

.profile-ntrp-scale li {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-inline-start: 2px solid transparent;
}

.profile-ntrp-scale li[aria-current="true"] {
  border-inline-start-color: currentColor;
  background: var(--bg-subtle);
}

.profile-ntrp-scale li span {
  color: var(--text-secondary);
  font-size: var(--text-sub);
}

.pc-player-card {
  --pc-court: url("./assets/backdrops/club-day.jpg");
  --pc-surface: #183d30;
  --pc-shade: #081f19;
  --pc-ink: #d8f1e1;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--pc-surface);
  color: #f6f2ea;
}

html[data-theme="aus-blue"] .pc-player-card {
  --pc-court: url("./assets/backdrops/aus-coastal-day.jpg");
  --pc-surface: #123a5b;
  --pc-shade: #061b30;
  --pc-ink: #d7eeff;
}

html[data-theme="club-night"] .pc-player-card {
  --pc-court: url("./assets/backdrops/night-floodlight.jpg");
  --pc-surface: #112a1e;
  --pc-shade: #04120d;
  --pc-ink: #daefdc;
}

html[data-theme="rooftop-twilight"] .pc-player-card {
  --pc-court: url("./assets/backdrops/copper-clay-twilight.jpg");
  --pc-surface: #663323;
  --pc-shade: #31150e;
  --pc-ink: #ffe6d8;
}

.pc-hero-stage {
  position: relative;
  min-height: clamp(200px, 30svh, 240px);
  isolation: isolate;
  overflow: hidden;
  background: var(--pc-court) center / cover no-repeat;
}

.pc-hero-backdrop,
.pc-hero-stage::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pc-hero-backdrop {
  z-index: -2;
  object-fit: cover;
}

.pc-hero-stage::before {
  content: "";
  z-index: -1;
  background: linear-gradient(to right, color-mix(in srgb, var(--pc-shade) 86%, transparent) 0 24%,
    color-mix(in srgb, var(--pc-shade) 54%, transparent) 39%, transparent 60%);
  pointer-events: none;
}

.pc-player-portrait {
  position: absolute;
  inset: auto 0 0 auto;
  width: 72%;
  height: 98%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 16px rgb(0 0 0 / 34%));
  pointer-events: none;
}

.pc-player-portrait.is-waist-crop {
  right: 8px;
  height: 93%;
  object-position: right bottom;
}

.pc-player-portrait.is-avatar {
  inset: 50% 7% auto auto;
  width: min(43%, 145px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid #f6f2ea;
  border-radius: 50%;
  transform: translateY(-50%);
}

.pc-identity {
  position: relative;
  width: 48%;
  padding: var(--space-3);
  text-shadow: 0 1px 4px var(--pc-shade), 0 0 8px var(--pc-shade);
}

.pc-player-name {
  margin: 0 0 var(--space-1);
  overflow-wrap: anywhere;
  font-size: var(--text-h1);
}

.pc-meta-row { color: var(--pc-ink); font-size: var(--text-sub); }
.pc-meta-row > span { display: block; }
.pc-player-card .profile-ntrp-help { padding-inline: 0; }

.pc-medal-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}
.pc-verified { display: block; margin-top: var(--space-1); font-size: var(--text-cap); }

.pc-player-card .trust-metrics-row {
  margin: 0;
  padding-inline: var(--space-3);
  border-top: 1px solid rgb(255 255 255 / 14%);
}
.pc-player-card .metric-label { color: var(--pc-ink); }
.member-friend-management summary { min-height: 44px; align-content: center; cursor: pointer; }

.profile-showcase-card {
  --record-surface: #162f25;
  --record-link: #214737;
  --record-hover: #2f5d49;
  --record-edge: #719789;
  --record-label: #d9eee2;
  --record-cue: #b6e1c8;
  overflow: hidden;
  margin: var(--space-1) 0 var(--space-3);
  border-radius: var(--radius-card);
  background: var(--record-surface);
}

html[data-theme="aus-blue"] .profile-showcase-card {
  --record-surface: #112e49;
  --record-link: #1c496a;
  --record-hover: #285f86;
  --record-edge: #6998b7;
  --record-label: #d4ebfa;
  --record-cue: #a9d8f5;
}

html[data-theme="club-night"] .profile-showcase-card {
  --record-surface: #0e231a;
  --record-link: #193a2d;
  --record-hover: #24533f;
  --record-edge: #64877a;
  --record-label: #d4e9de;
  --record-cue: #ade0bf;
}

html[data-theme="rooftop-twilight"] .profile-showcase-card {
  --record-surface: #44271f;
  --record-link: #683d30;
  --record-hover: #844d3a;
  --record-edge: #bb8b75;
  --record-label: #ffe8d8;
  --record-cue: #ffcbab;
}

.profile-showcase-card .profile-showcase {
  margin: 0;
  border-block-end: 0;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
}

.profile-showcase-card .trust-metrics-row {
  padding: var(--space-2);
  gap: var(--space-1);
  border-top: 1px solid var(--record-edge);
  background: var(--record-surface);
}

.profile-showcase-card .metric-item {
  min-height: 66px;
  justify-content: center;
  padding: var(--space-1) var(--space-2);
  border: 1px solid transparent;
}

.profile-showcase-card .metric-label { color: var(--record-label); }

.profile-showcase-card .metric-link {
  border-color: var(--record-edge);
  background: var(--record-link);
}

.profile-showcase-card .metric-link:hover { background: var(--record-hover); }
.profile-showcase-card .metric-link .metric-label > span { color: var(--record-cue); }
.profile-showcase-card .metric-link:focus-visible { outline-color: var(--record-cue); }

.profile-player-image.is-ai-character { filter: drop-shadow(0 5px 9px #11261c26); }
.profile-showcase .profile-ntrp-help { display: flex; padding-inline: 0; }

.profile-avatar-image { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar-circle:has(.is-comic-crop) { overflow: hidden; }
.profile-avatar-image.is-comic-crop { transform: scale(1.4); transform-origin: 50% 25%; }
.player-avatar { flex: none; overflow: hidden; border-radius: 50%; }
.player-avatar--host { width: 40px; height: 40px; }
.player-avatar--applicant { width: 36px; height: 36px; }
.player-avatar--small { width: 24px; height: 24px; font-size: 12.5px; }
.player-avatar--notice { width: 20px; height: 20px; font-size: 12.5px; }
.player-avatar-label { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.cloud-result-roster { display: grid; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }

.profile-friends-toolbar button > span {
  display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--border-strong);
  border-radius: 50%; background: var(--bg-surface-strong); color: var(--text-primary);
}
.profile-journal-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 60px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--bg-surface-strong);
  color: var(--text-primary);
  text-align: start;
}
.profile-journal-link svg { display: block; width: 24px; height: 24px; }
.profile-journal-link small, .profile-journal-link strong { display: block; }
.profile-journal-link small { color: var(--text-secondary); }
.profile-journal-link:hover { background: var(--bg-subtle); }
.profile-recent-game {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  text-align: start;
}
.profile-recent-game strong { white-space: nowrap; }
.profile-recent-game:hover { background: var(--bg-subtle); }

.profile-card-settings-preview { display: grid; gap: var(--space-2); }
.pc-player-card.profile-settings-mini { margin: 0; }
.profile-settings-mini .pc-hero-stage { min-height: 92px; }
.profile-settings-mini .pc-identity { width: 64%; padding: 9px 12px; }
.profile-settings-mini .pc-identity > strong { display: block; font-size: 1.05rem; }
.profile-settings-mini .pc-meta-row,
.profile-settings-mini .pc-verified { font-size: var(--text-cap); }
.profile-settings-mini .pc-meta-row > span { display: inline; }
.profile-settings-mini .pc-player-portrait { width: 52%; object-position: right bottom; }
.profile-settings-mini .pc-player-portrait.is-avatar { width: 66px; height: 66px; object-position: center; }

.profile-card-settings-groups { display: grid; gap: var(--space-3); }
.profile-card-settings-groups h4 {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: var(--text-cap);
  font-weight: 700;
}

.profile-avatar-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 6px;
}
.profile-avatar-heading h4 { margin: 0; }
.profile-avatar-choices { display: grid; gap: var(--space-2); }
.profile-avatar-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.profile-avatar-mode {
  display: grid;
  grid-template-rows: 58px auto 15px;
  gap: 4px;
  align-items: start;
  min-width: 0;
  min-height: 104px;
  padding: 4px 4px 5px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-control);
  background: var(--bg-reading-surface);
  color: var(--text-primary);
  font-size: var(--text-cap);
  font-weight: 700;
}
.profile-avatar-mode[aria-expanded="true"] {
  border-color: var(--accent-solid);
  box-shadow: inset 0 0 0 1px var(--accent-solid);
  background: var(--accent-tint);
}
.profile-avatar-mode small { color: var(--text-secondary); font-size: 12.5px; line-height: 1.15; }
.profile-avatar-tile {
  display: grid;
  place-items: center;
  height: 58px;
  border-radius: var(--radius-badge);
  overflow: hidden;
  background: var(--crest-bg);
  color: var(--brand-cream);
}
.profile-avatar-tile img { display: block; width: 100%; height: 58px; object-fit: contain; object-position: center top; }
.profile-avatar-tile img.is-avatar-thumb { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.profile-avatar-tile > svg { width: 24px; height: 24px; }
.profile-avatar-tile .avatar-circle,
.profile-avatar-colors .avatar-circle { border-radius: 50%; }
.profile-avatar-tile .avatar-circle,
.profile-avatar-colors > .avatar-circle { width: 38px; height: 38px; }
.profile-avatar-options {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-control);
  background: var(--bg-reading-surface);
}
.profile-avatar-options h5, .profile-avatar-options p { margin: 0; }
.profile-avatar-options h5 { color: var(--text-primary); font-size: var(--text-sub); }
.profile-avatar-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.profile-avatar-actions .btn { flex: 1 1 auto; min-height: 44px; }
.profile-avatar-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.profile-avatar-presets .btn {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  padding: 4px;
  font-size: var(--text-cap);
  white-space: normal;
}
.profile-avatar-presets img { width: 27px; height: 34px; object-fit: contain; }
.profile-avatar-presets [aria-pressed="true"] { border-color: var(--accent-solid); background: var(--accent-tint); }
.profile-avatar-colors, .profile-avatar-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.profile-avatar-swatches button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 50%;
}
.profile-avatar-swatches [aria-pressed="true"] { border-color: var(--accent-solid); background: var(--accent-tint); }
.profile-avatar-swatches .avatar-circle { width: 27px; height: 27px; }
.profile-avatar-feedback { margin: var(--space-1) 0 0; }

.profile-settings-list {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  background: var(--bg-reading-surface);
}

.profile-settings-list .profile-settings-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 6px 10px;
  color: var(--text-primary);
  background: transparent;
  border-radius: 0;
  text-align: start;
}

.profile-settings-row + .profile-settings-row { border-top: 1px solid var(--border-hairline); }
.profile-settings-list .profile-settings-row:hover { background: var(--bg-subtle); }
.profile-settings-list .profile-settings-row:focus-visible { outline-offset: -3px; }
.profile-settings-row :is(strong, small) { display: block; line-height: 1.35; }
.profile-settings-row small { margin-top: 2px; color: var(--text-secondary); font-size: var(--text-cap); font-weight: 500; }
.profile-settings-icon { display: grid; place-items: center; color: var(--accent-solid); }
.profile-settings-chevron { color: var(--text-secondary); }

.profile-settings-switch {
  display: flex;
  align-items: center;
  width: 36px;
  height: 22px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-subtle);
}

.profile-settings-switch::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-secondary);
}

.profile-settings-row[aria-checked="true"] .profile-settings-switch {
  justify-content: end;
  border-color: var(--accent-solid);
  background: var(--accent-solid);
}

.profile-settings-row[aria-checked="true"] .profile-settings-switch::before { background: var(--text-on-accent); }

.profile-compact-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; min-height: 44px; padding: var(--space-2) var(--space-1); border-bottom: 1px solid var(--border-hairline); }
.profile-self-panel .badge-wall-card { margin-top: var(--space-6); }
.profile-self-panel .medal-wall-grid { grid-template-columns: repeat(3, minmax(0, 98px)); }
.profile-self-panel .medal-wall-item { width: 100%; min-width: 0; }
.profile-self-panel .medal-coin-wrap { width: min(100%, 78px); height: auto; aspect-ratio: 1; }
.profile-self-panel .medal-coin-wrap > svg { width: 100%; height: 100%; }
.profile-compact-list, .profile-friend-list { list-style: none; padding: 0; margin: 0; }

.profile-friend-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-2); border-bottom: 1px solid var(--border-hairline); }
.profile-friend-identity { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 68px; padding: 3px 0; text-align: left; }
.profile-friend-list .avatar-circle { width: 42px; height: 42px; border-radius: 50%; }
.profile-friend-name-row { display: flex; align-items: center; margin-bottom: -5px; }
.profile-friend-name { min-width: 0; min-height: 44px; padding: 0; text-align: left; }
.profile-friend-name::before { content: ""; position: absolute; inset: 0; }
.profile-friend-name strong,
.profile-friend-level { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-friend-level { color: var(--text-secondary); font-size: var(--text-cap); }
.profile-friend-edit {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center start;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0 6px;
  border-radius: var(--radius-control);
  color: var(--text-secondary);
}
.profile-friend-edit:hover { background: var(--accent-tint); }
.profile-friend-edit svg { width: 17px; height: 17px; }

.profile-friend-action-toggle {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; color: var(--text-primary);
}
.profile-friend-action-toggle::before {
  content: ""; position: absolute; inset: 50% auto auto 50%; width: 35.2px; height: 35.2px;
  border: 1px solid var(--border-strong); border-radius: 50%; background: var(--bg-surface-strong);
  transform: translate(-50%, -50%); pointer-events: none;
}
.profile-friend-action-toggle:is(:hover, [aria-expanded="true"])::before { background: var(--accent-tint); }
.profile-friend-action-toggle::after {
  content: ""; position: relative; width: 7.2px; height: 7.2px;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg);
}
.profile-friend-action-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
.profile-friend-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin: 0 0 10px 52px; }
.profile-friend-actions button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: var(--space-1); border: 1px solid var(--border-hairline); border-radius: var(--radius-control); color: var(--text-primary); background: var(--bg-surface-strong); font-size: var(--text-cap); font-weight: 700; }
.profile-friend-actions button svg { width: 20px; height: 20px; color: var(--accent-solid); }
.profile-friends-note { margin: var(--space-4) 0 0; }
.profile-friend-empty { margin: 0; padding: var(--space-6) 0; text-align: center; }
.profile-pending-invite { margin-top: var(--space-6); padding: var(--space-3); background: var(--bg-subtle); border-radius: var(--radius-card); }
.profile-pending-invite > div { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }

.profile-message-heading { display: flex; align-items: center; justify-content: center; gap: var(--space-2); flex: none; padding: max(var(--space-3), env(safe-area-inset-top)) var(--space-4) var(--space-3); border-bottom: 1px solid var(--border-hairline); text-align: center; }
.profile-message-heading h2 { margin: 0; font: 700 var(--text-h3)/1.35 var(--font-serif); }
.profile-message-note { margin: var(--space-3) var(--space-4); }
.profile-inbox-list { list-style: none; margin: 0; padding: 0 var(--space-4); }
.profile-inbox-list button { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: var(--space-3); width: 100%; min-height: 68px; padding: var(--space-2) 0; border-bottom: 1px solid var(--border-hairline); text-align: left; }
.profile-inbox-list .avatar-circle { width: 44px; height: 44px; border-radius: 50%; }
.profile-inbox-list strong, .profile-inbox-list small { display: block; }
.profile-inbox-preview small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-message-view.is-chat .profile-message-scroll { padding-bottom: var(--space-2); }
.profile-direct-chat { display: grid; gap: var(--space-3); margin: 0; padding: 0 var(--space-4) var(--space-2); list-style: none; }
.profile-direct-chat li { display: flex; }
.profile-direct-chat .is-mine { justify-content: end; }
.profile-direct-bubble { max-width: min(90%, 32ch); padding: var(--space-2) var(--space-3); background: var(--bg-surface-strong); color: var(--text-primary); border: 1px solid var(--border-hairline); border-radius: var(--radius-card); overflow-wrap: anywhere; }
.profile-direct-bubble p { margin: 0; }
.profile-direct-bubble small { display: block; margin-top: var(--space-1); color: var(--text-secondary); }
.profile-direct-bubble small.player-avatar-label { display: flex; }
.profile-direct-chat .is-mine .profile-direct-bubble { background: var(--bg-subtle); }
.profile-direct-composer { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; flex: none; gap: var(--space-2); padding: var(--space-2) var(--space-4) calc(var(--profile-close-inset) + var(--profile-close-size) + var(--space-2)); border-top: 1px solid var(--border-hairline); }
.profile-direct-composer .input { min-width: 0; min-height: 44px; }
.profile-direct-composer .btn { min-width: 54px; min-height: 44px; }
.profile-game-invite-option { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: var(--space-2); min-height: 48px; padding: var(--space-2); border: 1px solid var(--border-hairline); border-radius: var(--radius-card); cursor: pointer; }
.profile-game-invite-option:has(input:checked) { border-color: var(--accent-solid); background: var(--bg-subtle); }
.profile-game-invite-option small { display: block; }

.profile-add-heading { flex: none; padding: max(var(--space-3), env(safe-area-inset-top)) var(--space-4) 0; text-align: center; }
.profile-add-heading h2 { margin: 0; font: 700 var(--text-h3)/1.35 var(--font-serif); }
.profile-add-friend .profile-tabs { border-bottom: 1px solid var(--border-hairline); }
.profile-add-friend .profile-scroll { margin-bottom: calc(var(--profile-close-size) + var(--profile-close-inset) + var(--space-1)); padding-bottom: var(--space-2); scroll-padding-bottom: var(--space-2); }
.profile-add-friend [role="tabpanel"]:focus { outline: none; }
.profile-my-friend-pass { padding: var(--space-2) var(--space-4) var(--space-3); text-align: center; border-bottom: 1px solid var(--border-hairline); }
.profile-my-friend-pass .section-title, .profile-friend-add-section .section-title { margin: 0; }
.profile-my-friend-identity { display: flex; justify-content: center; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.profile-my-friend-identity .avatar-circle { width: 38px; height: 38px; border-radius: 50%; }
.profile-friend-code-row { display: flex; justify-content: center; align-items: center; gap: var(--space-1); }
.profile-my-friend-code { width: 10.4ch; min-width: 0; border: 0; padding: var(--space-1); text-align: center; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--text-h2); font-weight: 700; letter-spacing: .06em; }
.profile-my-friend-code.is-cloud-code { width: 25ch; max-width: calc(100% - 52px); font-size: var(--text-sub); letter-spacing: .03em; }
#cloud-room-messages { display: contents; }
#cloud-room-status:empty { display: none; }
.profile-copy-code { display: grid; place-items: center; width: 48px; min-height: 48px; border-radius: 50%; color: var(--text-primary); }
.profile-copy-code:focus-visible { outline: 2px solid var(--accent-solid); outline-offset: -2px; }
.profile-my-friend-qr { display: block; width: min(128px, 52%); height: auto; margin: var(--space-1) auto var(--space-2); border: 1px solid var(--border-hairline); border-radius: var(--radius-card); }
.profile-my-friend-pass .btn { width: auto; }
.profile-friend-add-section { padding: var(--space-3) var(--space-4) var(--space-4); }
#profile-add-code-form { gap: var(--space-2); margin-block: var(--space-2); }
.profile-add-friend [role="status"]:empty { display: none; }
.profile-friend-scanner { position: relative; display: grid; place-items: center; aspect-ratio: 1.6; overflow: hidden; margin-block: var(--space-3); border-radius: var(--radius-card); background: #10281d; color: #f6f2ea; }
.profile-friend-scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-friend-scan-box { position: absolute; z-index: 1; width: min(48%, 134px); aspect-ratio: 1; border: 1.5px solid #e2f03bbd; border-radius: var(--radius-card); pointer-events: none; }
#profile-friend-camera-placeholder { z-index: 1; padding: 4px 8px; background: #0c1d17; font-size: var(--text-cap); }
.profile-friend-qr-sample { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border-hairline); }
.profile-friend-qr-sample img { width: 64px; height: 64px; border-radius: var(--radius-control); }
.profile-friend-qr-sample .btn { margin-left: auto; }

.profile-close {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: var(--profile-close-inset);
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: var(--profile-close-size);
  height: var(--profile-close-size);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-surface-strong);
  color: var(--text-primary);
  box-shadow: 0 4px 14px #09161026;
}

.profile-tabs button:focus-visible, .profile-journal-link:focus-visible, .profile-recent-game:focus-visible, .profile-close:focus-visible,
.profile-friend-list button:focus-visible, .profile-friends-toolbar button:focus-visible, .profile-inbox-list button:focus-visible {
  outline: 2px solid var(--accent-solid);
  outline-offset: -2px;
}

.profile-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.profile-visually-hidden:focus-visible + .profile-file-label { outline: 2px solid var(--accent-solid); outline-offset: 2px; }
.profile-file-label { cursor: pointer; }
.profile-sheet-stack { display: grid; gap: var(--space-3); }
.profile-sheet-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.profile-sheet-actions > :is(button, label) { flex: 1 0 auto; }
.profile-field-error { color: var(--badge-danger-fg); font-size: var(--text-sub); }
.profile-source-preview { display: block; width: 100%; height: min(32dvh, 235px); object-fit: contain; border-radius: var(--radius-card); background: var(--bg-subtle); }
.profile-photo-progress { text-align: center; display: grid; justify-items: center; gap: var(--space-3); margin: var(--space-4) 0; }
.profile-photo-progress > span { width: 40px; height: 40px; border: 2px solid var(--border-strong); border-top-color: var(--accent-solid); border-radius: 50%; animation: profile-orbit .85s linear infinite; }
@keyframes profile-orbit { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .profile-photo-progress > span { animation: none; } }

.profile-avatar-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.profile-avatar-results figure { display: flex; flex-direction: column; gap: var(--space-2); align-items: center; justify-content: center; min-height: 116px; margin: 0; padding: var(--space-2); border-radius: var(--radius-card); text-align: center; background: var(--bg-subtle); }
.profile-avatar-results img { display: block; max-width: 100%; height: 95px; object-fit: contain; border-radius: var(--radius-control); }
.profile-avatar-results figcaption { font-size: var(--text-cap); }
.profile-avatar-results .profile-review-dock { background: #0d1f17; color: #f6f2ea; }
.profile-avatar-results .profile-review-dock img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

@media (max-width: 360px) {
  .profile-player-identity { left: var(--space-4); }
  .profile-player-identity h2 { font-size: var(--text-display); }
}

.page-pad {
  padding: 12px 16px 104px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-pad-sticky {
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.page-display-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-large-title);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.large-title-row .games-create-button { width: auto; min-height: 44px; flex: none; white-space: nowrap; }
.featured-load-state { padding: 28px 20px; text-align: center; }
.cloud-result-choices { border: 0; padding: 0; margin: 0; min-width: 0; }
.cloud-result-choices .segmented-option:has(:checked) { background: var(--bg-surface-strong); color: var(--text-primary); box-shadow: 0 1px 3px #09161018; }
.cloud-result-choices .segmented-option:focus-within { outline: 2px solid var(--accent-solid); outline-offset: 1px; }

.page-kicker {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-canvas-muted);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-title {
  margin: 0;
  font-size: var(--text-h3);
  font-weight: 700;
  line-height: 1.3;
}

.meta-text {
  margin: 0;
  font-size: var(--text-sub);
  color: var(--text-secondary);
  line-height: 1.45;
}

.caption-text {
  margin: 0;
  font-size: var(--text-cap);
  color: var(--text-muted);
  line-height: 1.4;
}

.body-text {
  margin: 0;
  font-size: var(--text-body);
  color: var(--text-primary);
  line-height: 1.5;
}

.large-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 0;
}

.large-title-row .page-display-title,
.page-pad > .section-block > .section-title,
.page-pad > .section-header > .section-title {
  color: var(--text-on-canvas);
}

.page-pad > .section-block > .meta-text {
  color: var(--text-on-canvas-muted);
}

/* ==========================================================================
   Guarded Frosted Glass Cards (82% General / >=92% Reading Guard)
   ========================================================================== */
.card,
.game-card,
.week-strip-card,
.match-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px) saturate(1.18);
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
  color: var(--text-primary);
}

.is-reading-guard .card,
.is-reading-guard .game-card,
.is-reading-guard .week-strip-card,
.is-reading-guard .sticky-footer {
  background: var(--bg-surface-strong);
}

.card-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-stack--spacious {
  gap: 16px;
}

.card-stack--compact {
  gap: 10px;
}

.game-card {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.game-card:active {
  transform: scale(0.985);
}

.game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 6px;
}

.game-card-title {
  margin: 0;
  font-size: var(--text-h3);
  font-weight: 700;
  line-height: 1.3;
}

.game-card-time {
  margin: 0;
  font-size: var(--text-sub);
  font-weight: 700;
  color: var(--brand-pine);
}

html[data-theme="club-night"] .game-card-time {
  color: var(--brand-lime);
}

.game-card-sub {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--text-cap);
  color: var(--text-secondary);
}

.hairline-divider {
  border: none;
  border-top: 1px solid var(--border-hairline);
  margin: 2px 0;
}

/* ==========================================================================
   Tab 1: 精選配對 (Editorial Full-Bleed Hero Focus)
   ========================================================================== */
.featured-shell {
  flex: 0 0 auto;
  padding: var(--space-1) max(var(--space-4), env(safe-area-inset-right))
    var(--space-2) max(var(--space-4), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.weather-capsule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.weather-capsule > svg {
  flex-shrink: 0;
  color: var(--brand-pine);
}
html[data-theme="club-night"] .weather-capsule > svg {
  color: var(--brand-lime);
}
.weather-capsule.is-indoor {
  color: var(--badge-info-fg);
}
.weather-capsule.is-rain-risk {
  padding: 4px 8px;
  border-radius: var(--radius-badge);
  background: var(--badge-warn-bg);
  color: var(--badge-warn-fg);
  border-left: 3px solid var(--badge-warn-fg);
}

.featured-bottom-create {
  margin-top: 0;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--text-on-canvas);
  font-size: var(--text-cap);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform var(--dur-fast) ease, background var(--dur-fast) ease;
}
.featured-bottom-create:hover {
  background: rgba(255, 255, 255, 0.2);
}
.featured-bottom-create:active {
  transform: scale(0.988);
}
.featured-bottom-create.is-end-cue {
  border-color: rgba(226, 240, 59, 0.56);
  background: rgba(226, 240, 59, 0.14);
}

.featured-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.featured-top-row .explore-mode-row { flex: none; margin: 0; }
.featured-top-row .explore-single-btn { min-height: 48px; white-space: nowrap; }

.featured-filter-pill {
  min-height: 48px;
  max-width: 64%;
  padding: 0 12px;
  border-radius: var(--radius-control);
  background: var(--bg-chip-glass);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: var(--text-on-canvas);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.featured-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  padding: 20px 18px 18px;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(22px) saturate(1.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
}

.featured-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.featured-meta-bar .badge {
  flex-shrink: 0;
}

.featured-meta-bar .caption-text {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.featured-time-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.featured-hero-time {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.featured-date-range {
  font-size: var(--text-cap);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
}

.featured-court-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 1.18;
  color: var(--text-primary);
}

.featured-court-sub {
  margin: 4px 0 0;
  font-size: var(--text-sub);
  color: var(--text-secondary);
}

.featured-spec-strip {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  padding: 8px 0 4px;
  border-top: 1px solid var(--border-hairline);
  border-bottom: none;
}

.spec-chip {
  min-height: 24px;
  padding: 0 6px 0 0;
  border-radius: 0;
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.spec-chip + .spec-chip {
  border-left: 1px solid var(--border-hairline);
  padding-left: 10px;
}

.spec-chip:last-child {
  padding-right: 0;
}

.spec-chip > svg {
  flex-shrink: 0;
  color: var(--brand-pine);
}

.spec-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.spec-chip:not(:last-child) > span {
  overflow: visible;
  text-overflow: clip;
}

html[data-theme="club-night"] .spec-chip > svg {
  color: var(--brand-lime);
}

.featured-host-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
  border-top: none;
}

.featured-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
}

.featured-pager-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.featured-counter {
  font-size: var(--text-cap);
  font-weight: 700;
  color: var(--text-on-canvas);
  text-align: center;
}

/* ==========================================================================
   Buttons, Badges & Native HIG Segmented Control (5px Sharp Geometry)
   ========================================================================== */
.btn {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  font-size: var(--text-body);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--dur-fast) ease, opacity var(--dur-fast) ease, background var(--dur-fast) ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

/* Translucent Glass Gradient Primary CTA */
.btn-primary {
  background: var(--cta-bg);
  color: var(--text-on-accent);
  border: 1px solid var(--cta-specular);
  box-shadow: var(--cta-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.btn-primary:hover:not(:disabled) {
  background: var(--cta-bg-hover);
}

.btn.btn-featured-cta {
  min-height: 54px;
  padding: 0 12px 0 18px;
  justify-content: space-between;
  background: linear-gradient(135deg, #EAF74E 0%, #D0E322 100%);
  color: #0D1F17;
  border: 1.5px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38), 0 0 18px rgba(226, 240, 59, 0.28);
  font-size: 1.03rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.btn.btn-featured-cta:hover:not(:disabled) {
  background: linear-gradient(135deg, #F0FC62 0%, #D9EC2E 100%);
}
.cta-join-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-badge);
  background: #0D1F17;
  color: #E2F03B;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.btn-secondary {
  background: var(--bg-surface-strong);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.btn-ghost-glass {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  background: var(--bg-chip-glass);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--text-on-canvas);
  font-size: var(--text-sub);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-ghost-glass:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger-outline {
  background: transparent;
  color: var(--badge-danger-fg);
  border: 1px solid var(--badge-danger-fg);
}

.btn-sm-pill,
.mini-pill-btn {
  min-height: 36px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  font-size: var(--text-cap);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-subtle,
.mini-pill-btn {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
}

.mini-pill-btn.is-active,
.mini-pill-btn[aria-pressed="true"] {
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-color: var(--accent-solid);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.badge-success { background: var(--badge-ok-bg); color: var(--badge-ok-fg); }
.badge-warning { background: var(--badge-warn-bg); color: var(--badge-warn-fg); }
.badge-info { background: var(--badge-info-bg); color: var(--badge-info-fg); }
.badge-danger { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.badge-neutral { background: var(--bg-subtle); color: var(--text-secondary); }

/* HIG Segmented Control (5px crisp sliding block) */
.segmented-control {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}

.segmented-option {
  min-height: 40px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: var(--text-cap);
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.segmented-option[aria-pressed="true"],
.segmented-option[aria-selected="true"],
.segmented-option.is-active {
  background: var(--bg-surface-strong);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

html[data-theme="club-night"] .segmented-option[aria-pressed="true"],
html[data-theme="club-night"] .segmented-option[aria-selected="true"],
html[data-theme="club-night"] .segmented-option.is-active {
  background: rgba(226, 240, 59, 0.18);
  color: var(--brand-lime);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-chip {
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: var(--text-cap);
  font-weight: 600;
}

.choice-chip[aria-pressed="true"] {
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-color: var(--accent-solid);
}

/* ==========================================================================
   Form Inputs & Native Wheel Picker Triggers
   ========================================================================== */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: var(--text-cap);
  font-weight: 700;
  color: var(--text-secondary);
}

.input,
.select,
.textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-primary);
}
input[type="date"].input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
}

.textarea {
  min-height: 78px;
  resize: vertical;
}

.picker-trigger {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.picker-trigger-val {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--text-primary);
}

.picker-trigger-chevron {
  font-size: var(--text-cap);
  font-weight: 700;
  color: var(--text-muted);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  padding-top: 8px;
  border-top: 1px solid var(--border-hairline);
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.spec-item-time {
  grid-column: 1 / -1;
}

.spec-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.spec-value {
  font-size: var(--text-sub);
  font-weight: 700;
  color: var(--text-primary);
}

.banner {
  padding: 12px 14px;
  border-radius: var(--radius-card);
  font-size: var(--text-sub);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border-hairline);
}

.banner-info { background: var(--badge-info-bg); color: var(--badge-info-fg); }
.banner-warning { background: var(--badge-warn-bg); color: var(--badge-warn-fg); }

.sticky-footer {
  position: sticky;
  bottom: 0;
  padding: 12px 16px max(18px, env(safe-area-inset-bottom));
  background: var(--bg-surface-strong);
  border-top: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ==========================================================================
   Tab 2: 方案 C · 全滿版 Grand Slam 純向量訂製地圖
   ========================================================================== */
.map-screen {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
}

.map-overlay-top {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  z-index: 420;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.map-search-box,
.map-filter-strip,
.map-radar-hud {
  pointer-events: auto;
}

.map-search-box {
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.map-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--text-sub);
  color: var(--text-primary);
}

.map-search-clear {
  min-width: 32px;
  min-height: 32px;
  border-radius: var(--radius-control);
  color: var(--text-muted);
}

.map-filter-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.map-filter-strip::-webkit-scrollbar {
  display: none;
}

.map-filter-pill {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: var(--text-cap);
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.map-filter-pill[aria-pressed="true"] {
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-color: var(--accent-solid);
}

.map-canvas {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--bg-map);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.vector-map-world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition: transform 180ms var(--ease-snappy);
  cursor: grab;
}
.vector-map-world.is-dragging {
  transition: none;
  cursor: grabbing;
}

.map-grid-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.map-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.court-pin {
  position: absolute;
  pointer-events: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%) scale(calc(1 / var(--map-zoom, 1)));
}

.court-pin--selected {
  z-index: 30;
}

.court-pin:focus-visible {
  outline: none;
}

.court-pin:is(:focus-visible, .court-pin--selected) :is(.court-map-label, .court-map-dot) {
  outline: 2px solid #163A2A;
  outline-offset: 2px;
}

.court-map-label {
  --map-label-fill: #933A24;
  --map-label-border: #FFF7EB;
  position: absolute;
  bottom: calc(50% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  min-height: 29px;
  padding: 3px 8px;
  border: 1.5px solid var(--map-label-border);
  border-radius: 6px;
  background: var(--map-label-fill);
  color: #FFFAF2;
  box-shadow: 0 2px 7px #0003;
  font-size: .79rem;
  font-weight: 750;
  white-space: nowrap;
}

.court-map-label::after {
  content: "";
  position: absolute;
  left: calc(50% - 4px);
  top: calc(100% - 3px);
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border-right: inherit;
  border-bottom: inherit;
  background: inherit;
}

.court-pin.is-out-of-range .court-map-label {
  --map-label-fill: #FFF2E3;
  --map-label-border: #A85B39;
  color: #71351F;
}

.court-map-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border: 2px solid #FFFCF6;
  border-radius: 50%;
  background: #4B6556;
  box-shadow: 0 1px 4px #0005;
}

.user-location-dot {
  position: absolute;
  transform: translate(-50%, -50%) scale(calc(1 / var(--map-zoom, 1)));
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #15548A;
  border: 3px solid #FFFFFF;
  box-shadow: 0 0 0 6px rgba(21, 84, 138, 0.24);
  z-index: 40;
  pointer-events: none;
}

.map-controls-stack {
  position: absolute;
  right: 12px;
  bottom: 184px;
  z-index: 420;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--radius-control);
  background: var(--bg-chip-glass);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}

.court-peek-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 84px;
  z-index: 425;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.court-peek-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.court-peek-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.court-peek-title {
  margin: 0;
  font-size: var(--text-h3);
  font-weight: 800;
  color: var(--text-primary);
}

.court-peek-sub {
  margin: 0;
  font-size: var(--text-cap);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-zoom-group {
  display: flex;
  flex-direction: column;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.map-ctrl-btn,
.map-recenter-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #F6F2EA;
  background: transparent;
}

.map-ctrl-btn + .map-ctrl-btn,
.map-recenter-btn {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.map-recenter-btn {
  border-radius: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  box-shadow: none;
}

/* ==========================================================================
   Tab 3: 我的球局
   ========================================================================== */
.games-timeline { container-type: inline-size; }
.games-timeline .games-create-button { min-height: 48px; }
.games-timeline .section-block { gap: var(--space-3); }
.games-timeline-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  color: var(--text-on-canvas);
}
.games-timeline-heading .section-title { font-family: var(--font-serif); }
.games-timeline-heading > span { flex: none; font-size: var(--text-cap); }
.games-timeline-day {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: var(--space-2);
}
.games-timeline-rail {
  align-self: start;
  display: grid;
  gap: var(--space-1);
  padding-block: var(--space-2) var(--space-3);
  border-top: 1px solid color-mix(in srgb, var(--text-on-canvas) 37%, transparent);
  color: var(--text-on-canvas);
  font-size: var(--text-cap);
  line-height: 1.35;
}
.games-timeline-rail :is(time, strong) {
  font: 400 1.375rem/1.1 "Instrument Serif", "Bodoni MT", Georgia, serif;
  white-space: nowrap;
}
.games-timeline-rail.is-countdown { border-top-color: var(--brand-lime); }
.games-timeline-rail.is-countdown > span { font-weight: 700; }
.games-timeline-rail.is-countdown strong {
  color: var(--brand-lime);
  font-size: 1.625rem;
  letter-spacing: -.025em;
}
.games-timeline-surface {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--bg-reading-surface);
  color: var(--text-primary);
}
.games-timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.games-timeline-item.has-nav { grid-template-columns: minmax(0, 1fr) auto; }
.games-timeline-item + .games-timeline-item { border-top: 1px solid var(--border-hairline); }
.games-timeline-main {
  position: relative;
  display: grid;
  align-content: center;
  gap: var(--space-1);
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 0;
  color: inherit;
  text-align: start;
}
.games-timeline-item.has-nav .games-timeline-main { padding-inline-end: 0; }
.games-timeline-main.has-chevron { padding-inline-end: 36px; }
.games-timeline-schedule,
.games-timeline-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
}
.games-timeline-time { font-size: var(--text-cap); font-weight: 800; }
.games-timeline-venue {
  font: 700 1rem/1.35 var(--font-serif);
  overflow-wrap: anywhere;
}
.games-timeline-summary {
  color: var(--text-secondary);
  font-size: var(--text-cap);
  line-height: 1.4;
}
.games-timeline .badge { white-space: normal; }
.games-timeline-chevron {
  position: absolute;
  inset: 0 0 0 auto;
  display: grid;
  width: 36px;
  place-items: center;
  color: var(--text-secondary);
}
.games-timeline-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: var(--space-1);
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  margin-inline-end: var(--space-2);
  padding-inline: var(--space-1);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-cap);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.games-timeline-nav svg { flex: none; }
.games-timeline-main:hover .games-timeline-venue { text-decoration: underline; text-underline-offset: .15em; }
.games-timeline-nav:hover, .games-timeline-main:active, .games-timeline-nav:active { background: var(--bg-subtle); }
.games-timeline :is(.games-timeline-main, .games-timeline-nav):focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: -2px;
}
.games-timeline-featured .games-timeline-venue { font-size: 1.25rem; }
.games-timeline-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 var(--space-1);
  margin-inline: var(--space-3);
  padding-block: 2px;
  border-top: 1px solid var(--border-hairline);
}
.games-timeline-footer .badge { gap: var(--space-1); padding-inline: 6px; }
.games-timeline-footer .badge svg { flex: none; }
.games-timeline-footer .badge-success svg { display: none; }
.games-timeline-footer .games-timeline-nav { margin-inline: auto 0; padding-inline: 2px; }

@container (max-width: 304px) {
  .games-timeline-day { grid-template-columns: 5.25rem minmax(0, 1fr); }
  .games-timeline-rail.is-countdown strong { font-size: 1.375rem; }
}

@container (max-width: 282px) {
  .games-timeline-item.has-nav { grid-template-columns: minmax(0, 1fr); }
  .games-timeline-item.has-nav .games-timeline-main { padding-inline-end: var(--space-3); padding-bottom: 0; }
  .games-timeline-item > .games-timeline-nav { justify-self: end; }
}

.week-strip-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.week-strip-grid {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.week-strip-grid::-webkit-scrollbar {
  display: none;
}

.day-cell {
  flex: 0 0 calc((100% - 30px) / 7);
  scroll-snap-align: start;
  min-height: 54px;
  border-radius: var(--radius-control);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-secondary);
}

.day-cell[aria-pressed="true"] {
  background: var(--accent-solid);
  color: var(--text-on-accent);
}

.day-cell-weekday {
  font-size: 12.5px;
  font-weight: 600;
}

.day-cell-date {
  font-size: var(--text-sub);
  font-weight: 800;
}

.day-cell-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-clay);
}

.day-cell[aria-pressed="true"] .day-cell-dot {
  background: currentColor;
}

.day-cell-dot.is-empty {
  opacity: 0;
}

/* ==========================================================================
   已加入球局的聊天室與詳情
   ========================================================================== */
.phone-frame:has(.game-detail-shell) {
  --session-canvas: #e9eee7;
  --session-surface: #f8f9f4;
  --session-tint: #dce7dc;
  --session-bubble: #fffef9;
  --session-ink: #152f22;
  --session-muted: #4b6356;
  --session-line: #bdcbbd;
  --session-control-border: #728a7a;
  --session-accent: #184432;
  --session-accent-ink: #fffdf4;
  --session-header: #173b2b;
}

html[data-theme="club-night"] .phone-frame:has(.game-detail-shell) {
  --session-canvas: #dce8e3;
  --session-surface: #eef5ef;
  --session-tint: #cedfd5;
  --session-bubble: #fafdf8;
  --session-muted: #415b50;
  --session-line: #a9bfb2;
  --session-control-border: #6e897b;
  --session-accent: #214936;
  --session-header: #10291f;
}

html[data-theme="aus-blue"] .phone-frame:has(.game-detail-shell) {
  --session-canvas: #e6eff6;
  --session-surface: #f3f8fc;
  --session-tint: #d4e5f2;
  --session-bubble: #fcfeff;
  --session-ink: #18344a;
  --session-muted: #40586e;
  --session-line: #adc4d6;
  --session-control-border: #6f879c;
  --session-accent: #154c7a;
  --session-accent-ink: #f5fbff;
  --session-header: #123754;
}

html[data-theme="rooftop-twilight"] .phone-frame:has(.game-detail-shell) {
  --session-canvas: #f5e7d9;
  --session-surface: #fff6ec;
  --session-tint: #efdbc8;
  --session-bubble: #fffaf2;
  --session-ink: #3d2a21;
  --session-muted: #694d3e;
  --session-line: #d7bba1;
  --session-control-border: #a27a64;
  --session-accent: #823822;
  --session-accent-ink: #fff7ed;
  --session-header: #783625;
}

.phone-frame:has(.game-detail-shell) .app-topbar :is(.back-btn, .topbar-more-btn) {
  min-height: var(--touch-target);
  background: var(--session-header);
  border-color: color-mix(in srgb, var(--session-accent-ink) 40%, transparent);
  color: var(--session-accent-ink);
}

.game-detail-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--session-canvas);
}

.game-detail-shell:has(.chat-panel:not([hidden])) {
  flex: 1;
  min-height: 0;
}

.game-detail-shell > #panel-detail {
  flex: 1;
  background: var(--bg-reading-surface);
}

.session-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: none;
  padding: 8px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--session-canvas);
}

.session-pinned-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--session-surface);
  border: 1px solid var(--session-line);
  border-radius: var(--radius-card);
}

.session-pinned-bar .badge {
  flex: none;
  background: var(--session-tint);
  color: var(--session-ink);
}

.session-pinned-bar.has-share {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1);
}

.session-summary-heading,
.game-share-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.session-summary-heading .section-title {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--session-ink);
}

.game-share-footer {
  padding-top: var(--space-1);
  border-top: 1px solid var(--border-hairline);
}

.game-share-footer .session-pinned-sub {
  white-space: normal;
}

.btn.game-share-trigger {
  flex: none;
  width: auto;
  min-height: 44px;
  margin-inline-start: auto;
  padding-inline: var(--space-2);
  font-size: var(--text-cap);
  white-space: nowrap;
}

.session-pinned-bar .game-share-trigger {
  background: var(--session-tint);
  border-color: var(--session-line);
  color: var(--session-ink);
}

.game-share-arrow {
  font: 700 1.15em/1 system-ui, sans-serif;
}

.game-share-options,
.game-share-fallback:not([hidden]) {
  display: grid;
  gap: var(--space-2);
}

.btn.game-share-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-2);
  min-height: 56px;
  padding: var(--space-2) var(--space-3);
  text-align: start;
  text-decoration: none;
}

.game-share-option small {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-cap);
  font-weight: 500;
}

.game-share-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
}

.game-share-mark.is-line {
  background: #087c40;
  color: #fff;
  font-size: 12.5px;
}

.game-share-fallback input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--bg-surface-strong);
  color: var(--text-primary);
  font-size: 16px;
}

.shared-game-heading {
  padding-block: var(--space-3) var(--space-1);
}

.shared-game-heading .page-display-title {
  margin: 0;
}

.shared-game-preview .card :is(p, h3),
.shared-game-specs {
  margin: 0;
}

.shared-game-seats {
  font-weight: 700;
}

.shared-game-specs {
  display: grid;
  gap: var(--space-2);
}

.shared-game-specs > div {
  display: grid;
  grid-template-columns: 5em minmax(0, 1fr);
  gap: var(--space-2);
}

.shared-game-specs dt {
  color: var(--text-muted);
}

.shared-game-specs dd {
  margin: 0;
}

.session-tabs {
  padding: 4px;
  border-color: var(--session-line);
  border-radius: 7px;
  background: var(--session-tint);
}

.session-tabs .segmented-option {
  min-height: 44px;
  border-radius: 4px;
  color: var(--session-muted);
}

.game-detail-shell .session-tabs .segmented-option[aria-selected="true"] {
  color: var(--session-accent-ink);
  background: var(--session-accent);
  box-shadow: none;
}

.session-pinned-sub {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--session-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  color-scheme: light;
}

.chat-messages {
  flex: 1 1 0;
  min-height: 0;
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-color: var(--session-line) transparent;
}

.chat-messages > * {
  flex-shrink: 0;
}

.chat-fee-note {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 8px 10px;
  border-inline-start: 1px solid var(--session-control-border);
  border-radius: var(--radius-control);
  background: var(--session-tint);
  color: var(--session-muted);
  font-size: var(--text-cap);
  line-height: 1.5;
}

.chat-fee-note strong {
  color: var(--session-ink);
}

.chat-empty {
  margin: 12px 0 0;
  color: var(--session-muted);
  text-align: center;
}

.chat-msg-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 92%;
  align-self: flex-start;
}

.chat-msg-wrap.is-me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 30px;
  height: 30px;
  margin-top: 20px;
  border-radius: 50%;
  background: var(--session-tint);
  color: var(--session-ink);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.chat-bubble-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.chat-msg-wrap.is-me .chat-bubble-row {
  align-items: flex-end;
}

.chat-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--session-muted);
  padding: 0 2px;
}

.chat-bubble {
  padding: 8px 10px;
  border-radius: 4px 11px 11px 11px;
  background: var(--session-bubble);
  border: 1px solid var(--session-line);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--session-ink);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-msg-wrap.is-me .chat-bubble {
  background: var(--session-accent);
  color: var(--session-accent-ink);
  border-color: transparent;
  border-radius: 11px 4px 11px 11px;
}

.chat-system-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  color: var(--session-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}
.chat-system-divider::before,
.chat-system-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--session-line);
}

.chat-bottom-dock {
  flex: none;
  min-width: 0;
  overflow: hidden;
  padding-top: 4px;
  border-top: 1px solid var(--session-line);
  background: var(--session-surface);
}

.chat-quick-replies {
  display: flex;
  gap: 6px;
  padding: 4px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-quick-replies::-webkit-scrollbar {
  display: none;
}

.chat-quick-chip {
  min-height: 44px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  background: var(--session-tint);
  border: 1px solid var(--session-control-border);
  color: var(--session-ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.chat-quick-chip:active {
  transform: scale(0.96);
}

.chat-compose-bar {
  padding: 4px 16px max(12px, env(safe-area-inset-bottom));
  background: var(--session-surface);
  display: flex;
  gap: 8px;
  align-items: center;
}

.game-detail-shell :is(.segmented-option, .chat-input, .chat-quick-chip, .chat-send-btn):focus-visible {
  outline: 2px solid var(--session-accent);
  outline-offset: -2px;
}

.game-detail-shell :is(.session-tabs .segmented-option[aria-selected="true"], .chat-send-btn):focus-visible {
  outline-color: var(--session-accent-ink);
}

/* ==========================================================================
   通知中心（左條紋／外框區隔已讀未讀 · 類別圖示 · 三層視覺階層）
   ========================================================================== */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-card {
  position: relative;
  width: 100%;
  text-align: left;
  padding: 14px 14px 14px 16px;
  border-radius: var(--radius-card);
  background: var(--bg-reading-surface);
  border: 1px solid var(--border-hairline);
  border-left: 4px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform var(--dur-fast) ease, background var(--dur-fast) ease;
}
.notif-card:active {
  transform: scale(0.985);
}

.notif-card.is-unread {
  border-color: var(--border-strong);
  border-left: 4px solid var(--brand-clay);
}
.notif-card.is-unread.type-urgent-fill,
.notif-card.is-unread.type-reminder {
  border-left-color: var(--brand-pine);
}
html[data-theme="club-night"] .notif-card.is-unread {
  border-left-color: var(--brand-lime);
}

.notif-icon-badge {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-card);
  background: var(--bg-subtle);
  color: var(--brand-pine);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.notif-card.type-urgent-fill .notif-icon-badge,
.notif-card.type-weather .notif-icon-badge {
  background: var(--badge-warn-bg);
  color: var(--badge-warn-fg);
}
.notif-card.type-revision .notif-icon-badge {
  background: var(--badge-danger-bg);
  color: var(--badge-danger-fg);
}
html[data-theme="club-night"] .notif-icon-badge {
  color: var(--brand-lime);
}

.notif-unread-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-clay);
  border: 2px solid var(--bg-surface-strong);
}
html[data-theme="club-night"] .notif-unread-dot {
  background: var(--brand-lime);
}

.notif-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.notif-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notif-category {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--brand-pine);
}
html[data-theme="club-night"] .notif-category {
  color: var(--brand-lime);
}
.notif-card.type-urgent-fill .notif-category {
  color: var(--badge-warn-fg);
}

.notif-time {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.notif-title {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 700;
  line-height: 1.38;
  color: var(--text-primary);
}
.notif-card.is-unread .notif-title {
  font-weight: 800;
}

.notif-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.notif-action-cue {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-pine);
  margin-top: 2px;
}
html[data-theme="club-night"] .notif-action-cue {
  color: var(--brand-lime);
}

.chat-input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--session-control-border);
  background: var(--session-bubble);
  color: var(--session-ink);
}

.chat-input::placeholder {
  color: var(--session-muted);
  opacity: 1;
}

.chat-send-btn {
  flex: none;
  min-width: 72px;
  min-height: 46px;
  border-radius: var(--radius-control);
  background: var(--session-accent);
  color: var(--session-accent-ink);
  border: 1px solid transparent;
  font-size: var(--text-sub);
  font-weight: 700;
}

.member-row {
  width: 100%;
  min-height: 56px;
  padding: 8px 8px;
  border-radius: var(--radius-control);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.member-row:hover {
  background: var(--bg-subtle);
}

.member-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-row-left > .avatar-circle {
  width: 40px;
  height: 40px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
}

/* 個人中心 Bento 三格指標 & Master Crest */
.trust-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  padding-block: var(--space-3);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.metric-link {
  min-height: 44px;
  padding: 0 var(--space-1);
  border: 0;
  border-radius: var(--radius-control);
  background: #1b3428;
  text-align: start;
}
.metric-link:hover { background: #284c3a; }
.metric-link .metric-label > span { color: var(--brand-lime); }
.metric-link:focus-visible, .profile-edit-card:focus-visible {
  outline: 2px solid var(--brand-lime);
  outline-offset: -2px;
}

.metric-num {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 6vw, 1.875rem);
  font-weight: 700;
  line-height: 1.1;
  color: #f6f2ea;
}

.metric-label {
  font-size: 12px;
  font-weight: 600;
  color: #c5cfc6;
}

.metric-attendance-dot {
  flex: 0 0 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-lime);
  box-shadow: 0 0 0 2px rgb(226 240 59 / 24%);
}

.master-crest-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-card);
  background: #163A2A;
  color: #F6F2EA;
}

html[data-theme="aus-blue"] .master-crest-banner {
  background: #15548A;
}

html[data-theme="club-night"] .master-crest-banner,
html[data-theme="rooftop-twilight"] .master-crest-banner {
  background: #0D1F17;
  border: 1px solid rgba(226, 240, 59, 0.25);
}

/* 賽後 IG 限動海報圖卡（雜誌編輯風 · 主題色票同步） */
.ig-story-card {
  position: relative;
  overflow: hidden;
  padding: 24px 20px;
  border-radius: var(--radius-card);
  background: linear-gradient(155deg, #1A4733 0%, #113022 58%, #0B1E15 100%);
  color: #F6F2EA;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

html[data-theme="aus-blue"] .ig-story-card {
  background: linear-gradient(155deg, #15548A 0%, #0D385E 58%, #072138 100%);
}

html[data-theme="club-night"] .ig-story-card {
  background: linear-gradient(155deg, #132A1F 0%, #0A1912 58%, #050D09 100%);
  border-color: rgba(226, 240, 59, 0.28);
}

html[data-theme="rooftop-twilight"] .ig-story-card {
  background: linear-gradient(155deg, #1E293B 0%, #111827 58%, #090D16 100%);
  border-color: rgba(226, 240, 59, 0.28);
}

.ig-court-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.14;
  pointer-events: none;
}

.ig-story-kicker {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #E2F03B;
}

.ig-court-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-display);
  line-height: 1.15;
}

/* ==========================================================================
   Bottom Dock（左頭像 ｜ 中央網球功能總覽 ｜ 右通知鈴鐺）
   ========================================================================== */
.bottom-dock {
  position: absolute;
  inset-inline: max(var(--space-6), env(safe-area-inset-left)) max(var(--space-6), env(safe-area-inset-right));
  inset-block-end: var(--dock-bottom-offset);
  z-index: 320;
  height: auto;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
  transition-property: none;
}
#nav-profile {
  justify-self: start;
  background: var(--crest-bg);
  color: var(--text-on-canvas);
  touch-action: manipulation;
}
#btn-tennis-hub { grid-column: 2; grid-row: 1; justify-self: center; }
#nav-notifications { justify-self: end; }
.bottom-dock[hidden] {
  display: none !important;
}

.dock-side-btn {
  pointer-events: auto;
  position: relative;
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 31, 23, 0.68);
  border: 1.5px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  color: #F6F2EA;
  transition: transform var(--dur-fast) ease, background var(--dur-fast) ease;
}
.dock-side-btn:active {
  transform: scale(0.94);
}
#nav-profile:is(:active, .is-pressed) {
  transform: scale(0.97);
}
.dock-profile-seam {
  position: absolute;
  z-index: 1;
  inset: -4px;
  border: 2px solid transparent;
  border-inline-start-color: #f7f5df;
  border-inline-end-color: var(--brand-lime);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: rotate(-38deg);
}
.dock-profile-release { inset: auto; z-index: 321; }
#nav-profile:is(:active, .is-pressed) .dock-profile-seam {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  #nav-profile {
    transition: none;
  }
  #nav-profile:is(:active, .is-pressed) {
    transform: none;
  }
}
.dock-side-btn[aria-current="page"] {
  background: rgba(226, 240, 59, 0.28);
  border-color: var(--brand-lime);
}

#nav-profile .avatar-circle,
.dock-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
}

:where(#nav-profile) .avatar-circle,
#nav-profile .avatar-circle:has(.profile-avatar-image) {
  background: var(--crest-bg);
  color: var(--text-on-canvas);
}

#nav-profile.has-dock-portrait {
  width: 72px;
  height: 72px;
  overflow: visible;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

#nav-profile.has-dock-portrait:focus-visible {
  outline: 2px solid var(--brand-lime);
  outline-offset: 3px;
}

.dock-portrait,
.dock-portrait-ring,
.dock-portrait-breakout {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dock-portrait-ring {
  overflow: hidden;
  border-radius: 50%;
  background: var(--crest-bg);
  box-shadow: 0 4px 12px rgb(0 0 0 / 35%);
}

.dock-portrait-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid #d6dcc6;
  border-radius: inherit;
}

.dock-portrait img {
  position: absolute;
  inset: -19px -4px auto;
  width: 80px;
  height: 96px;
  max-width: none;
}

.dock-portrait.is-framed img {
  inset: -25% 0 auto;
  width: 100%;
  height: 125%;
}

.dock-portrait.is-framed .dock-portrait-breakout img {
  clip-path: inset(0 0 52% 0);
}

.dock-portrait-breakout img {
  /* Only the head area can extend beyond the circular portrait. */
  clip-path: polygon(0 0, 100% 0, 100% 16%, var(--dock-head-right, 82%) 16%, var(--dock-head-right, 82%) 70%, 0 70%);
}

.dock-portrait-breakout img[src$="/player-male-dock.png"] {
  --dock-head-right: 69%;
}

.dock-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand-lime);
  color: #0D1F17;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.dock-tennis-ball {
  pointer-events: auto;
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  border: none;
  color: #F6F2EA;
  overflow: visible;
  transition: transform var(--dur-fast) cubic-bezier(0.22, 1, 0.36, 1);
}
.dock-tennis-ball model-viewer {
  position: relative;
  z-index: 2;
  width: 68px;
  height: 68px;
  align-self: flex-end;
  pointer-events: none;
  background: transparent;
  --poster-color: transparent;
}
.dock-ball-fallback {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45));
  transition: opacity 180ms ease;
}
.dock-tennis-ball.is-3d-ready .dock-ball-fallback,
.dock-tennis-ball:has(#dock-ball-viewer[hidden]) .dock-ball-fallback,
.dock-tennis-ball.has-ball-landed[aria-expanded="true"] .dock-ball-fallback {
  opacity: 0;
  pointer-events: none;
}

.dock-close-x[hidden] {
  display: none;
}

.dock-close-x {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  background: rgba(12, 26, 19, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #F6F2EA;
  display: inline-flex;
  align-self: flex-end;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}
.ball-ab-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(13, 31, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
}
.ball-ab-btn {
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(246, 242, 234, 0.84);
}
.ball-ab-btn[aria-pressed="true"] {
  background: var(--brand-lime);
  color: #0D1F17;
}
.dock-tennis-ball:active {
  transform: scale(0.93);
}
.dock-tennis-ball[aria-expanded="true"] {
  transform: scale(1.06) rotate(18deg);
  box-shadow: 0 0 0 4px rgba(226, 240, 59, 0.32), 0 12px 26px rgba(7, 22, 16, 0.55);
}

/* Let the landing feedback finish over the open menu without covering its controls. */
.bottom-dock:has(.is-ball-landing) { z-index: auto; }
.bottom-dock:has(.is-ball-landing) .dock-side-btn { z-index: 320; }
.dock-tennis-ball.is-ball-landing { z-index: 421; transform: none; box-shadow: none; }
.dock-tennis-ball.is-ball-landing[aria-expanded="true"] { pointer-events: none; }
.dock-tennis-ball.has-ball-landed[aria-expanded="true"] model-viewer { opacity: 0; transition: opacity 100ms ease; }
.dock-landing-wave {
  --landing-light: #effdb2;
  position: absolute;
  top: calc(50% + 24px);
  left: 50%;
  width: 68px;
  height: 27px;
  border: 2px solid var(--landing-light);
  border-radius: 50%;
  box-shadow: 0 0 9px color-mix(in srgb, var(--landing-light) 30%, transparent);
  opacity: 0;
  pointer-events: none;
}
html[data-theme="aus-blue"] .dock-landing-wave { --landing-light: #b1e8ff; }
html[data-theme="club-night"] .dock-landing-wave { --landing-light: #f2fbb7; }
html[data-theme="rooftop-twilight"] .dock-landing-wave { --landing-light: #ffdfae; }
.dock-landing-wave.is-still { top: 50%; height: 68px; }

/* ==========================================================================
   Full-Screen Semi-Transparent Tennis Hub Overlay
   ========================================================================== */
@keyframes hubRadialExpand {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.84);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tennis-hub-overlay {
  --hub-photo: url("./assets/backdrops/club-day.jpg");
  --hub-photo-position: 54% center;
  --hub-tint: 20 54 39;
  --hub-ink: 7 25 17;
  --hub-glass: 235 251 233;
  --hub-accent: #E2F03B;
  --hub-mid-opacity: 0.30;

  position: absolute;
  inset: 0;
  z-index: 420;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(54px, calc(env(safe-area-inset-top) + 20px)) 20px var(--dock-bottom-offset);
  background: rgb(var(--hub-ink));
  transition-property: none;
}
html[data-theme="aus-blue"] .tennis-hub-overlay {
  --hub-photo: url("./assets/backdrops/aus-coastal-day.jpg");
  --hub-photo-position: 48% center;
  --hub-tint: 29 78 120;
  --hub-ink: 7 33 63;
  --hub-glass: 221 244 255;
  --hub-accent: #BCE9FF;
  --hub-mid-opacity: 0.26;
}
html[data-theme="club-night"] .tennis-hub-overlay {
  --hub-photo: url("./assets/backdrops/night-floodlight.jpg");
  --hub-photo-position: center;
  --hub-tint: 36 45 55;
  --hub-ink: 9 17 23;
  --hub-glass: 227 240 248;
  --hub-mid-opacity: 0.36;
}
html[data-theme="rooftop-twilight"] .tennis-hub-overlay {
  --hub-photo: url("./assets/backdrops/copper-clay-twilight.jpg");
  --hub-photo-position: center;
  --hub-tint: 126 55 32;
  --hub-ink: 54 21 11;
  --hub-glass: 255 231 207;
  --hub-accent: #FFD0A3;
  --hub-mid-opacity: 0.28;
}
.tennis-hub-overlay::before,
.tennis-hub-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.tennis-hub-overlay::before {
  background: var(--hub-photo) var(--hub-photo-position) / cover no-repeat;
  filter: blur(6px) saturate(0.96);
  transform: scale(1.03);
}
.tennis-hub-overlay::after {
  background: linear-gradient(180deg,
    rgb(var(--hub-ink) / 0.82),
    rgb(var(--hub-tint) / 0.55) 18%,
    rgb(var(--hub-tint) / var(--hub-mid-opacity)) 43%,
    rgb(var(--hub-ink) / 0.80) 67%,
    rgb(var(--hub-ink) / 0.94) 100%);
}
.tennis-hub-close-row {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.tennis-hub-close-btn {
  width: 62px;
  height: 62px;
  scale: 0.95;
  border-radius: 999px;
  background: rgb(var(--hub-glass) / 0.14);
  border: 1.5px solid rgb(var(--hub-glass) / 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #F6F2EA;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
  transition: transform var(--dur-fast) ease, background var(--dur-fast) ease;
}
.tennis-hub-close-btn:active {
  transform: scale(0.92);
  background: rgb(var(--hub-glass) / 0.24);
}
.tennis-hub-overlay:not([hidden]) .tennis-hub-grid {
  animation: hubRadialExpand 280ms cubic-bezier(0.32, 0.72, 0, 1);
  transform-origin: center bottom;
}
.tennis-hub-overlay[hidden] {
  display: none !important;
}

.tennis-hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.tennis-hub-title {
  margin: 0;
  color: #F6F2EA;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.tennis-hub-settings-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgb(var(--hub-glass) / 0.14);
  border: 1px solid rgb(var(--hub-glass) / 0.42);
  color: #F6F2EA;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.tennis-hub-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  row-gap: 22px;
  column-gap: 10px;
  margin: auto 0 28px;
}

.hub-tile {
  grid-column: span 2;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #F6F2EA;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--dur-fast) ease;
}
.tennis-hub-overlay:not([hidden]) .hub-tile {
  animation: hubRadialExpand 300ms cubic-bezier(0.32, 0.72, 0, 1) both;
}
.tennis-hub-overlay:not([hidden]) .hub-tile:nth-child(1) { animation-delay: 0ms; }
.tennis-hub-overlay:not([hidden]) .hub-tile:nth-child(2) { animation-delay: 35ms; }
.tennis-hub-overlay:not([hidden]) .hub-tile:nth-child(3) { animation-delay: 70ms; }
.tennis-hub-overlay:not([hidden]) .hub-tile:nth-child(4) { animation-delay: 105ms; }
.tennis-hub-overlay:not([hidden]) .hub-tile:nth-child(5) { animation-delay: 140ms; }
.hub-tile-bottom-left {
  grid-column: 2 / span 2;
}
.hub-tile-bottom-right {
  grid-column: 4 / span 2;
}
.hub-tile:active {
  transform: scale(0.92);
}
.hub-tile-icon {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: rgb(var(--hub-glass) / 0.14);
  border: 1.5px solid rgb(var(--hub-glass) / 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #F6F2EA;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hub-tile-icon svg {
  width: 30px;
  height: 30px;
}
.hub-icon-detail {
  fill: var(--hub-accent);
}
.hub-tile-icon.is-accent {
  background: rgb(var(--hub-ink));
  background: color-mix(in srgb, var(--hub-accent) 18%, rgb(var(--hub-ink)));
  border-color: var(--hub-accent);
  color: var(--hub-accent);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.27);
}
.hub-tile-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #F6F2EA;
}
.tennis-hub-hint {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(246, 242, 234, 0.68);
}

/* ==========================================================================
   Explore Mode Switcher（[ 球局卡 ｜ 球場地圖 ] 置中於卡片正上方）
   ========================================================================== */
.explore-mode-row {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}
.explore-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(13, 31, 23, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
}
.explore-mode-btn {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(246, 242, 234, 0.85);
}
.explore-mode-btn[aria-selected="true"] {
  background: var(--brand-lime);
  color: #0D1F17;
}

/* ==========================================================================
   Settings Screen Helpers
   ========================================================================== */
.settings-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.settings-theme-btn {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.settings-theme-btn[aria-pressed="true"] {
  border-color: var(--brand-pine);
  background: rgba(226, 240, 59, 0.24);
}
html[data-theme="rooftop-twilight"] .settings-theme-btn {
  background: var(--bg-subtle);
  border-color: var(--border-hairline);
}
html[data-theme="rooftop-twilight"] .settings-theme-btn[aria-pressed="true"] {
  background: var(--accent-solid);
  color: var(--text-on-accent);
  border-color: var(--accent-solid);
}
html[data-theme="rooftop-twilight"] .settings-theme-btn[aria-pressed="true"] .settings-theme-swatch {
  border-color: var(--text-on-accent);
}

.settings-theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}
.settings-rule-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}

.explore-single-btn {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(13, 31, 23, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #F6F2EA;
  font-size: 12.5px;
  font-weight: 700;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.featured-refresh-btn {
  grid-column: 2;
  justify-self: center;
  min-height: 48px;
  min-width: 48px;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #F6F2EA;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.featured-end-toolbar {
  position: relative;
  z-index: 3;
}

.featured-end-cue {
  position: absolute;
  top: calc(100% + 2px);
  right: 12px;
  width: 47px;
  height: 44px;
  overflow: visible;
  pointer-events: none;
  color: var(--brand-lime);
  filter: drop-shadow(0 1px 1px #241b11);
}

.featured-end-cue path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: no-preference) {
  .featured-end-cue { animation: featuredEndPoint 1.2s ease-in-out 2; }
  .featured-end-toolbar .featured-filter-pill { animation: featuredEndHighlight 1.2s ease-in-out 2; }
}

@keyframes featuredEndPoint {
  48% { transform: translate(2px, -6px); }
}

@keyframes featuredEndHighlight {
  48% { border-color: var(--brand-lime); }
}

/* iOS Inset Grouped List & Native Switch */
.ios-grouped-list {
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 4px 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.settings-palette-drawer {
  padding: 6px 0 12px;
}
.setting-row-danger {
  width: 100%;
  justify-content: center;
  color: var(--badge-danger-fg);
  font-weight: 700;
}
.ios-switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.32);
  transition: background 180ms ease;
  flex-shrink: 0;
  cursor: pointer;
}
.ios-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: transform 180ms cubic-bezier(0.32, 0.72, 0, 1);
}
.ios-switch:checked {
  background: #34C759;
}
html[data-theme="rooftop-twilight"] .ios-switch:checked {
  background: var(--accent-solid);
}

.ios-switch:checked::after {
  transform: translateX(20px);
}

.journal-day-cell.is-today {
  box-shadow: inset 0 0 0 1.5px var(--brand-clay);
}
.journal-day-cell.is-future {
  opacity: 0.32;
  cursor: not-allowed;
}
.journal-date-dur-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-height: 700px) {
  .featured-hero-card .card-photo-hero {
    height: 144px;
  }
  .dock-tennis-ball {
    width: 70px;
    height: 70px;
  }
  .dock-tennis-ball model-viewer {
    width: 64px;
    height: 64px;
  }
}
.leaflet-map-host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: var(--bg-map);
}
.leaflet-map-host .leaflet-user-location-pane {
  /* Above map markers and tooltips, below Leaflet popups. */
  z-index: 660;
  pointer-events: none;
}
.map-screen .leaflet-tile-pane,
.map-screen .vector-map-world > svg {
  filter: saturate(.46) contrast(.69) brightness(1.16);
}
.leaflet-map-host .map-radius-boundary {
  stroke: var(--map-radius-edge);
  fill: var(--map-radius-fill);
}
.map-park-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
}
.court-map-model {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 45px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.court-map-model[data-surface="unknown"] {
  width: 47px;
  height: 36px;
}
.court-map-model[data-surface="mixed"] {
  width: 74px;
  height: 55px;
}
.court-pin.has-court-model .court-map-label { bottom: calc(50% + 17px); }
.court-pin.has-court-model:focus-visible {
  outline: 2px solid #163A2A;
  outline-offset: 2px;
  border-radius: 5px;
}
.leaflet-map-host .leaflet-control-attribution {
  background: rgba(255, 250, 242, 0.94);
  color: #253C30;
  font-size: 12.5px;
}
.leaflet-map-host .leaflet-control-attribution a {
  color: inherit;
}
.venue-data-sources a {
  color: var(--text-secondary);
  text-underline-offset: .17em;
  font-weight: 700;
}
.leaflet-court-marker {
  background: transparent;
  border: none;
}
.leaflet-court-marker .court-pin {
  left: 0;
  top: 0;
  transform: none;
}

.games-nav-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(22, 58, 42, 0.1);
  border: 1px solid rgba(22, 58, 42, 0.22);
  color: var(--brand-pine);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}
.games-nav-icon-btn:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.ig-story-card.has-nrc-photo {
  background-size: cover;
  background-position: center;
}
.ig-story-card.has-nrc-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 18, 13, 0.58) 0%, rgba(8, 18, 13, 0.25) 45%, rgba(8, 18, 13, 0.78) 100%);
  pointer-events: none;
}

/* ==========================================================================
   Bottom Sheet & Dialogs (12px Panel / Drag-to-Dismiss Ready)
   ========================================================================== */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: transparent;
  transition: background-color var(--dur-fast) ease;
}

dialog:is([open]):where(:not([data-closing]))::backdrop {
  background: var(--backdrop-tint);
}

.sheet-dialog {
  border: none;
  padding: 0;
  background: transparent;
  width: min(100vw, 390px);
  max-width: 100vw;
  max-height: 84dvh;
  margin: auto auto 0;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--dur-sheet) var(--ease-decel), transform var(--dur-sheet) var(--ease-decel);
}

.sheet-dialog:is([open]):where(:not([data-closing])) {
  opacity: 1;
  transform: translateY(0);
}

.sheet-surface {
  background: var(--bg-surface-strong);
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  border-top: 1px solid var(--border-glass);
  padding: 8px 18px max(22px, env(safe-area-inset-bottom));
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

.sheet-handle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: var(--touch-target);
  touch-action: none;
  cursor: grab;
}

.sheet-grabber {
  width: 42px;
  height: 4px;
  border-radius: var(--radius-badge);
  background: var(--border-strong);
}

.icon-close-btn {
  position: absolute;
  right: 0;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  border-radius: var(--radius-control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 700;
}

.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
}

.center-dialog {
  border: none;
  padding: 16px;
  background: transparent;
  width: min(100vw, 370px);
  max-width: 100vw;
  margin: auto;
  color: var(--text-primary);
}

.center-surface {
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-panel);
  padding: 20px;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.dialog-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  min-height: 44px;
}

.dialog-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: 700;
}

.center-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 68dvh;
  overflow-y: auto;
}

.member-friend-action {
  display: flex;
  flex-direction: column;
  flex: none;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
}

.member-friend-action p {
  margin: 0;
}

.member-friend-label {
  font-weight: 700;
}

.member-friend-button {
  min-height: 46px;
  border: 1px solid transparent;
  background: #173d30;
  color: #fff;
}

.member-friend-button:hover:not(:disabled) {
  background: #235743;
}

.member-friend-button:disabled {
  opacity: 1;
  background: color-mix(in srgb, var(--bg-surface-strong) 88%, var(--text-secondary));
  border-color: var(--border-hairline);
  color: var(--text-secondary);
}

.member-friend-status {
  text-align: center;
}

.confirm-message {
  font-size: var(--text-body);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.confirm-actions .btn.is-destructive {
  background: #94392f;
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}

.confirm-actions .btn.is-destructive:hover:not(:disabled) {
  background: #7d2923;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  font-size: var(--text-body);
  cursor: pointer;
}

.setting-row-main {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.setting-row-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toast-banner {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 84px;
  z-index: 650;
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: rgba(12, 28, 21, 0.94);
  color: #F6F2EA;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: var(--text-sub);
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-float);
}

/* ==========================================================================
   iPhone 原生滾輪選擇器 (5px/8px Sharp HIG Wheel)
   ========================================================================== */
.wheel-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.wheel-field-tile {
  min-height: 52px;
  padding: 6px 8px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  text-align: left;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.wheel-field-tile[aria-selected="true"] {
  background: var(--bg-surface);
  border-color: var(--accent-solid);
  box-shadow: 0 0 0 1px var(--accent-solid);
}

.wheel-field-tile.has-wheel-lock { position: relative; padding-bottom: 20px; }

.wheel-lock-mark {
  position: absolute;
  right: 5px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-badge);
  background: var(--bg-surface-strong);
  color: var(--text-secondary);
}

.wheel-lock-mark svg { width: 12px; height: 12px; }
.wheel-lock-note { margin: 0; color: var(--text-secondary); }

@media (max-height: 750px) {
  #quick-sheet-body { gap: var(--space-2); }
}

.wheel-field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.wheel-field-val {
  width: 100%;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ios-wheel-wrap {
  position: relative;
  height: 204px;
  min-height: 132px;
  container-type: size;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  user-select: none;
  -webkit-user-select: none;
}

.ios-wheel-wrap.is-dual {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
}

.ios-wheel-colon {
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  color: var(--brand-lime);
  z-index: 2;
  padding: 0 2px;
  pointer-events: none;
}

.ios-wheel-lens {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
  border-radius: var(--radius-control);
  background: var(--wheel-lens-bg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  z-index: 1;
}

.ios-wheel-track {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  padding: 80px 0;
  padding-block: max(0px, calc(50cqh - 22px));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 24%, #000 76%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 24%, #000 76%, transparent 100%);
}

.ios-wheel-track::-webkit-scrollbar {
  display: none;
}

.ios-wheel-item {
  width: 100%;
  height: 44px;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 16px;
}

.ios-wheel-item.is-centered,
.ios-wheel-item[aria-selected="true"] {
  color: var(--text-primary);
  font-weight: 800;
}

.ios-wheel-item > span {
  opacity: var(--wheel-label-opacity, 1);
}

#quick-sheet .ios-wheel-wrap {
  background: var(--bg-wheel-options);
}

#quick-sheet .ios-wheel-track {
  mask-image: none;
  -webkit-mask-image: none;
}

#quick-sheet .ios-wheel-lens {
  background: transparent;
  box-shadow: none;
}

#quick-sheet .ios-wheel-item {
  width: calc(100% - 16px);
  margin-inline: auto;
  border-radius: var(--radius-control);
  color: var(--text-secondary);
}

#quick-sheet .ios-wheel-item.is-centered {
  background: var(--accent-solid);
  color: var(--text-on-accent);
}

#quick-sheet .ios-wheel-item > span {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 1ms !important;
  }
}

@media (max-width: 520px),
       (orientation: landscape) and (max-height: 520px) and (hover: none) and (pointer: coarse) {
  html,
  body {
    overscroll-behavior-y: none;
    background: #091610;
  }
  .studio-shell {
    padding: 0;
    width: 100%;
    height: 100dvh;
    align-items: stretch;
  }
  .phone-stage {
    width: 100%;
    height: 100%;
    flex: 1;
  }
  .reviewer-launch {
    display: none;
  }
  .phone-frame {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    border: none;
    border-radius: 0;
  }
  .status-bar {
    display: none;
  }
  .app-topbar {
    padding-top: max(44px, calc(env(safe-area-inset-top) + 12px));
    padding-bottom: 10px;
  }
  .app-topbar:not(.is-subpage) {
    min-height: calc(54px + env(safe-area-inset-top, 0px));
    padding-block: calc(6px + env(safe-area-inset-top, 0px)) 8px;
    padding-inline: max(16px, env(safe-area-inset-left, 0px))
      max(16px, env(safe-area-inset-right, 0px));
  }
  html[data-production-app],
  html[data-production-app] body {
    overflow: hidden;
  }
  [data-production-app] .studio-shell {
    height: min(100dvh, var(--app-viewport-height, 100dvh));
    min-height: 0;
  }
  [data-production-app] .phone-stage,
  [data-production-app] .phone-frame {
    min-height: 0;
  }
  [data-iphone-standalone] {
    --chat-safe-top: max(44px, env(safe-area-inset-top, 0px));
  }
  [data-iphone-standalone] .phone-frame:has(.chat-panel:not([hidden])) > .app-topbar.is-subpage {
    padding-top: calc(var(--chat-safe-top) + var(--space-3));
  }
  [data-iphone-standalone] .profile-message-view.is-chat .profile-message-heading {
    padding-top: calc(var(--chat-safe-top) + var(--space-2));
  }
  [data-iphone-chat-keyboard] .studio-shell:has(:is(#chat-input, #profile-direct-input):focus) {
    position: relative;
    top: var(--chat-viewport-top, 0px);
  }
  [data-iphone-chat-keyboard] .chat-panel:has(#chat-input:focus) .chat-quick-replies {
    display: none;
  }
  [data-iphone-chat-keyboard] .game-detail-shell:has(#chat-input:focus) .session-pinned-bar.has-share :is(.session-summary-date, .game-share-footer) {
    display: none;
  }
  [data-iphone-chat-keyboard] .profile-message-view:has(#profile-direct-input:focus) .profile-direct-composer {
    padding-bottom: var(--space-2);
  }
  [data-iphone-chat-keyboard] .profile-message-view:has(#profile-direct-input:focus) .profile-message-heading {
    min-height: calc(max(var(--space-1), var(--chat-safe-top, env(safe-area-inset-top))) + var(--profile-close-size) + var(--space-1));
    padding-inline: calc(var(--profile-close-size) + var(--space-3));
  }
  [data-iphone-chat-keyboard] .profile-message-view:has(#profile-direct-input:focus) .profile-close {
    inset: max(var(--space-1), var(--chat-safe-top, env(safe-area-inset-top))) var(--space-2) auto auto;
    transform: none;
  }
}

/* ==========================================================================
   v5-v7 Visual Lock Additions:
   L1/L2/L3 字體階層 · 卡片場地攝影 · 滿版左側縮圖 · 半版頭像封面 · 俱樂部通知卡
   ========================================================================== */
.topbar-title,
.page-display-title,
.featured-court-title,
.game-card-title,
.court-peek-title,
.dialog-title,
.ig-court-title,
.section-title,
.session-pinned-title,
.editorial-serif,
.notif-title {
  font-family: var(--font-tc-serif);
}

.editorial-serif.tabular-nums {
  font-family: var(--font-serif);
}

.page-kicker {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 13.5px;
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--text-on-canvas);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

.link-action-underline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sub);
  font-weight: 700;
  color: var(--brand-pine);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  min-height: 36px;
}

/* Court Card Photo Hero (Featured Card + Venue Sheet) */
.featured-swipe-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}

.featured-swipe-stage .featured-hero-card {
  position: relative;
  z-index: 2;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.featured-swipe-stage .featured-hero-card:active {
  cursor: grabbing;
}

.featured-stack-peek {
  position: absolute;
  top: 14px;
  bottom: 14px;
  width: 24px;
  border-radius: var(--radius-card);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  opacity: 0.42;
  z-index: 1;
  pointer-events: none;
}
.featured-stack-peek.is-prev {
  left: -8px;
}
.featured-stack-peek.is-next {
  right: -8px;
}

@keyframes featuredSlideFromRight {
  from { opacity: 0.92; transform: translate3d(20px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes featuredSlideFromLeft {
  from { opacity: 0.92; transform: translate3d(-20px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
.featured-hero-card.is-slide-next {
  animation: featuredSlideFromRight 220ms var(--ease-snappy);
}
.featured-hero-card.is-slide-prev {
  animation: featuredSlideFromLeft 220ms var(--ease-snappy);
}

.featured-deck {
  display: flex;
  flex-direction: column;
  gap: inherit;
}

.featured-deck-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-1);
}
.featured-dots {
  grid-column: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.featured-deck-footer.is-ending .featured-dots {
  grid-column: 1 / -1;
  justify-self: center;
}

.featured-dot {
  flex: 0 0 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
}
.featured-dot:focus-visible { outline-offset: -3px; }
.featured-dot::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}
.featured-dot.is-active::after {
  width: 20px;
  background: var(--brand-lime);
}

.swipe-gesture-stamp {
  position: absolute;
  top: 46px;
  z-index: 15;
  padding: 6px 12px;
  border-radius: var(--radius-badge);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 80ms ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.swipe-gesture-stamp.is-join {
  left: 16px;
  background: #E2F03B;
  color: #0D1F17;
  border: 2px solid #0D1F17;
  transform: rotate(-6deg);
}
.swipe-gesture-stamp.is-next {
  right: 16px;
  background: rgba(13, 31, 23, 0.92);
  color: #F6F2EA;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  transform: rotate(6deg);
}

.featured-hero-card.has-photo-hero {
  padding: 0;
  overflow: hidden;
  gap: 0;
}
.featured-hero-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-reading-surface);
}

.card-photo-hero {
  position: relative;
  height: 148px;
  flex-shrink: 0;
  overflow: hidden;
  background: #132C20;
}
.featured-hero-card .card-photo-hero {
  height: 182px;
}
.card-photo-hero.is-sheet-hero {
  height: 188px;
  border-radius: var(--radius-card);
}
.card-photo-hero img,
.card-photo-hero svg.court-visual-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Lighting variations so Morning vs Afternoon vs Lit Night are clear at 1 glance */
.card-photo-hero.is-morning img {
  filter: brightness(1.08) saturate(0.95) hue-rotate(-8deg) contrast(1.02);
}
.card-photo-hero.is-afternoon img {
  filter: brightness(1.02) saturate(1.12) sepia(0.08);
}
.card-photo-hero.is-night-lit img {
  filter: brightness(1.12) contrast(1.08) saturate(1.12);
}
.card-photo-hero.is-night-unlit img {
  filter: brightness(0.62) contrast(1.05) saturate(0.68);
}
.card-photo-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7, 15, 11, 0.10) 0%, rgba(7, 15, 11, 0.64) 100%);
}
.card-photo-hero.is-night-lit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 12%, rgba(226, 240, 59, 0.28) 0%, transparent 56%);
  pointer-events: none;
}

.card-photo-overlay {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #FFFFFF;
}
.card-photo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#featured-swipe-card .card-photo-top {
  align-items: flex-start;
}
#featured-swipe-card .card-photo-top .photo-pill-light {
  flex-shrink: 0;
  white-space: nowrap;
}
.photo-pill-dark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: var(--radius-badge);
  background: rgb(var(--overlay-rgb) / 89%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text-on-overlay);
  font-size: 12.5px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.photo-pill-dark.is-no-light {
  background: rgba(142, 31, 23, 0.92);
  border-color: rgba(255, 196, 190, 0.45);
  color: #FFFFFF;
}
.photo-pill-light {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-badge);
  background: rgba(246, 242, 234, 0.94);
  color: #0D1F17;
  font-size: 12.5px;
  font-weight: 800;
}
.card-photo-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-control);
  background: rgb(var(--overlay-rgb) / 89%);
}
.card-photo-title-row .featured-court-title {
  color: var(--text-on-overlay);
  font-size: 1.32rem;
  line-height: 1.15;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}

/* Conditional L5 Host Remark Speech Bubble */
.host-speech-bubble {
  background: var(--bg-subtle);
  border-left: 3px solid var(--brand-pine);
  border-radius: 0 8px 8px 8px;
  padding: 6px 10px;
  font-size: var(--text-sub);
  line-height: 1.38;
  color: var(--text-primary);
}

.host-tap-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 40px;
  text-align: left;
  padding: 2px 4px;
  border-radius: var(--radius-control);
}
.host-tap-profile:active {
  background: var(--bg-subtle);
}

/* Avatar Color Tones */
:is(.avatar-circle, .profile-initial-badge).tone-lime { --profile-tone-fill: #e2f03b; --profile-tone-ink: #0d1f17; }
:is(.avatar-circle, .profile-initial-badge).tone-pine { --profile-tone-fill: #163a2a; --profile-tone-ink: #e2f03b; }
:is(.avatar-circle, .profile-initial-badge).tone-clay { --profile-tone-fill: #9e3b1d; --profile-tone-ink: #f6f2ea; }
:is(.avatar-circle, .profile-initial-badge).tone-ocean { --profile-tone-fill: #15548a; --profile-tone-ink: #fff; }
:is(.avatar-circle, .profile-initial-badge).tone-gold { --profile-tone-fill: #c89b3c; --profile-tone-ink: #0d1f17; }
.avatar-circle:is(.tone-lime, .tone-pine, .tone-clay, .tone-ocean, .tone-gold) {
  background: var(--profile-tone-fill);
  color: var(--profile-tone-ink);
}
.avatar-circle.tone-pine { border: 1px solid rgb(226 240 59 / 45%); }

/* My Games Curved Green Hero Strip + Full-Bleed Left Thumbnails */
.games-week-hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px 16px 26px 26px;
  padding: 16px 14px 14px;
  background: linear-gradient(150deg, #1A4733 0%, #113022 65%, #0D2419 100%);
  color: #F6F2EA;
  border: 1px solid rgba(226, 240, 59, 0.25);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
html[data-theme="aus-blue"] .games-week-hero {
  background: linear-gradient(150deg, #175C96 0%, #0F3E68 68%, #0B2C4B 100%);
}
html[data-theme="rooftop-twilight"] .games-week-hero {
  background: linear-gradient(150deg, #1B334D 0%, #102133 70%, #0A1522 100%);
}
.games-week-hero .day-cell {
  color: rgba(246, 242, 234, 0.78);
}
.games-week-hero .day-cell[aria-pressed="true"] {
  background: #FFFFFF;
  color: #0D1F17;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.24);
}
.games-week-hero .day-cell-dot {
  background: #E2F03B;
}
.games-week-hero .day-cell[aria-pressed="true"] .day-cell-dot {
  background: #163A2A;
}

.game-card.game-card-with-thumb,
.game-card-with-thumb {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  min-height: 92px;
}
.game-card-thumb {
  position: relative;
  width: 84px;
  min-height: 92px;
  flex-shrink: 0;
  align-self: stretch;
  border-radius: 0;
  overflow: hidden;
  background: #163A2A;
  border-right: 1px solid var(--border-hairline);
}
.game-card-thumb img,
.game-card-thumb svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-card-thumb.is-night-lit img {
  filter: brightness(1.10) contrast(1.08);
}
.game-card-thumb.is-night-unlit img {
  filter: brightness(0.62) saturate(0.68);
}
.game-card-main {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

/* Profile & Member Card Half-Bleed Hero Cover Wrapping Avatar */
.member-hero-cover {
  position: relative;
  min-height: 176px;
  margin: -16px -16px 2px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  overflow: hidden;
  background: #132C20;
}
.member-hero-cover.is-dialog-cover {
  margin: 0;
  min-height: 164px;
  border-radius: var(--radius-card);
}
.member-hero-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.member-hero-cover-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8, 18, 13, 0.16) 0%, rgba(8, 18, 13, 0.50) 45%, rgba(6, 14, 10, 0.90) 100%);
}
.member-hero-cover-actions {
  position: relative;
  z-index: 2;
  margin-bottom: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.profile-cover-pill {
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-badge);
  background: rgba(13, 31, 23, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #E2F03B;
  font-size: 12.5px;
  font-weight: 700;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.profile-cover-pill.is-ghost {
  background: rgba(246, 242, 234, 0.92);
  color: #0D1F17;
  border-color: transparent;
}
.member-profile-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 0;
}
.profile-avatar-edit-btn {
  position: relative;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--radius-control);
  flex-shrink: 0;
}
.avatar-edit-pip {
  position: absolute;
  right: -4px;
  bottom: -4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #E2F03B;
  color: #0D1F17;
  font-size: 12.5px;
  font-weight: 800;
  border: 1.5px solid #0D1F17;
}
.member-hero-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.member-hero-name {
  display: block;
  font-size: 1.38rem;
  font-weight: 700;
  line-height: 1.18;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}
.member-hero-sub {
  display: block;
  font-size: var(--text-sub);
  font-weight: 600;
  line-height: 1.35;
  color: rgba(246, 242, 234, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.72);
}

/* Editorial Club Dispatch Notification Cards */
.notif-card {
  align-items: stretch;
  min-height: 98px;
  padding: 12px 14px;
  gap: 12px;
}
.notif-card.is-unread {
  border-color: var(--accent-solid);
  box-shadow: 0 0 0 1px var(--accent-solid), var(--shadow-card);
}
.notif-media-stamp {
  position: relative;
  width: 68px;
  min-height: 74px;
  align-self: stretch;
  flex-shrink: 0;
}
.notif-media-stamp .game-card-thumb {
  width: 100%;
  height: 100%;
  min-height: 74px;
  border-radius: 6px;
  border-right: none;
  border: 1px solid var(--border-hairline);
}
.notif-media-stamp .notif-player-stamp {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 74px;
  border-radius: 6px;
  font-size: var(--text-h2);
}
.notif-icon-chip {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background-color: #F8F5EF;
  border: 1px solid var(--border-strong);
  color: var(--brand-pine);
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}
.notif-icon-chip svg {
  width: 13px;
  height: 13px;
}
.notif-card.type-urgent-fill .notif-icon-chip,
.notif-card.type-weather .notif-icon-chip {
  background-color: #FDF3EB;
  border-color: rgba(158, 59, 29, 0.38);
  color: var(--badge-warn-fg);
}
.notif-card.type-revision .notif-icon-chip {
  background-color: #FDECEB;
  border-color: rgba(169, 44, 34, 0.38);
  color: var(--badge-danger-fg);
}
html[data-theme="club-night"] .notif-icon-chip {
  background-color: #162820;
  color: var(--brand-lime);
}
html[data-theme="club-night"] .notif-card.type-urgent-fill .notif-icon-chip,
html[data-theme="club-night"] .notif-card.type-weather .notif-icon-chip {
  background-color: #2B2114;
  border-color: rgba(240, 178, 92, 0.45);
  color: #F7C873;
}
html[data-theme="club-night"] .notif-card.type-revision .notif-icon-chip {
  background-color: #32181B;
  border-color: rgba(242, 130, 130, 0.45);
  color: #FCA5A5;
}
.notif-category-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-pine);
}
html[data-theme="club-night"] .notif-category-pill {
  color: var(--brand-lime);
}
.notif-kicker-en {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  font-weight: 400;
}
.notif-bottom-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.notif-cta-link {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-pine);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
html[data-theme="club-night"] .notif-cta-link {
  color: var(--brand-lime);
}

.notif-center, .notif-friend-section { display: grid; gap: var(--space-2); }
.notif-center {
  --notif-reminder-accent: var(--brand-lime);
  gap: var(--space-3);
}
html[data-theme="aus-blue"] .notif-center { --notif-reminder-accent: #B1E0FF; }
html[data-theme="club-night"] .notif-center { --notif-reminder-accent: #E8FF3B; }
html[data-theme="rooftop-twilight"] .notif-center { --notif-reminder-accent: #FFC196; }
.notif-empty-section { display: grid; gap: var(--space-2); }
.settings-device-push { padding: 12px 16px; }
.settings-device-push .btn { align-self: start; width: auto; }
.notif-center-heading { margin: 0; color: var(--text-on-canvas); }
.notif-center-heading .section-title { margin: 0; color: inherit; }
.notif-center-heading .meta-text { margin: 2px 0 0; color: var(--text-on-canvas); }
.notif-center .mini-pill-btn { min-height: 44px; background: var(--bg-reading-surface); color: var(--text-primary); }
.notif-group-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px var(--space-2); color: var(--text-on-canvas); }
.notif-group-heading h3 { margin: 0; font: 700 var(--text-h3)/1.25 var(--font-serif); }
.notif-group-heading h3, .notif-center-heading > div { text-shadow: 0 2px 7px rgb(0 0 0 / 70%); }
#notif-others-heading { margin-bottom: var(--space-2); }

.notif-center.is-empty { padding-top: var(--space-6); gap: var(--space-4); }
.notif-center.is-empty .notif-center-heading .section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font: 700 var(--text-display)/1.3 var(--font-serif);
}
.notif-center.is-empty .notif-center-heading .section-title::before {
  content: "";
  flex: 0 0 var(--space-2);
  height: var(--space-2);
  border-radius: 50%;
  background: var(--notif-reminder-accent);
}
.notif-center.is-empty .notif-center-heading .meta-text { margin-top: var(--space-2); }
.notif-center [data-cloud-notice-status]:empty { display: none; }
.notif-center [data-cloud-notice-status],
.notif-center [data-cloud-notice-status] .meta-text,
.notif-empty-note {
  color: var(--text-on-canvas);
  text-shadow: 0 2px 7px rgb(0 0 0 / 70%);
}
.notif-center [data-cloud-notice-status] .btn { margin-top: var(--space-2); }

.notif-reminder {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-6);
  border-radius: var(--radius-panel);
  color: var(--text-on-canvas);
  background: var(--crest-bg);
}
.notif-center.is-empty .notif-reminder { margin-top: var(--space-4); }
.notif-reminder > svg { color: var(--notif-reminder-accent); width: 24px; height: 24px; }
.notif-reminder h3 { margin: 0; font: 700 var(--text-h2)/1.3 var(--font-serif); }
.notif-reminder p { margin: 0; font-size: var(--text-body); line-height: 1.5; }
.notif-reminder .btn-primary {
  --cta-bg: var(--notif-reminder-accent);
  --cta-bg-hover: color-mix(in srgb, var(--notif-reminder-accent), white 16%);
  --cta-specular: transparent;
  --text-on-accent: #142217;
  --cta-shadow: none;
  justify-self: start;
  width: auto;
  margin-top: var(--space-2);
}
.notif-inbox-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-2) 0;
  text-align: left;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--text-on-canvas);
  border: 0;
  border-bottom: 1px solid rgb(246 242 234 / 35%);
  background: transparent;
  text-shadow: 0 2px 7px rgb(0 0 0 / 70%);
}
.notif-inbox-link svg { flex-shrink: 0; }
.notif-inbox-link svg:last-child { margin-inline-start: auto; }
.notif-inbox-link:hover, .notif-inbox-link:active { background: rgb(246 242 234 / 10%); }
.notif-reminder .btn:focus-visible, .notif-inbox-link:focus-visible { outline-color: var(--text-on-canvas); }

.notif-urgent-feature {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: end;
  gap: var(--space-1);
  width: 100%;
  min-height: 142px;
  padding: var(--space-3);
  overflow: hidden;
  border: 1px solid rgb(250 235 217 / 55%);
  border-radius: var(--radius-card);
  background: var(--crest-bg);
  color: #fff8ed;
  text-align: left;
}
.notif-urgent-feature > .game-card-thumb, .notif-urgent-feature::before { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.notif-urgent-feature > .game-card-thumb { z-index: -2; border: 0; }
.notif-urgent-feature::before { content: ""; z-index: -1; background: linear-gradient(0deg, #130f0cee 10%, #201812c2 58%, #20181224 100%); }
.notif-urgent-feature:focus-visible, .notif-friend-tile:focus-visible { outline: 2px solid var(--text-on-canvas); outline-offset: 2px; }
.notif-urgent-meta, .notif-urgent-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 3px var(--space-2); font-size: var(--text-cap); }
.notif-urgent-meta time { margin-inline-start: auto; font-weight: 650; }
.notif-urgent-label { padding: 3px 6px; border-radius: var(--radius-badge); background: #873521; color: #fff5e8; font-weight: 750; }
.notif-urgent-unread { font-weight: 700; }
.notif-urgent-title { font: 750 var(--text-h3)/1.28 var(--font-serif); overflow-wrap: anywhere; }
.notif-urgent-summary > strong { margin-inline-start: auto; }

.notif-friend-count { margin-inline-start: 3px; font: 650 var(--text-cap)/1.2 var(--font-sans); }
.notif-friend-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 90px), 1fr)); gap: 6px; }
.notif-friend-tile {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 3px 5px;
  min-width: 0;
  min-height: 70px;
  padding: 7px 6px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  background: var(--bg-reading-surface);
  color: var(--text-primary);
  text-align: left;
}
.notif-friend-tile.is-unread { border-color: var(--border-strong); }
.notif-friend-tile:hover { border-color: var(--accent-solid); }
.notif-friend-tile .avatar-circle { width: 28px; height: 28px; font-size: var(--text-cap); }
.notif-friend-identity strong, .notif-friend-excerpt { display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.notif-friend-identity strong { font-size: var(--text-sub); }
.notif-friend-identity small { display: block; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.35; }
.notif-friend-tile.is-unread small { font-weight: 750; }
.notif-friend-excerpt { grid-column: 1 / -1; color: var(--text-secondary); font-size: var(--text-cap); }

.screen-root:has(> .notif-screen) { overflow: hidden; }
.notif-screen { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.notif-screen .notif-center {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: var(--space-4);
  scrollbar-width: thin;
}
.notif-screen .notif-center > * { flex: none; }
.notif-center:focus-visible { outline: 2px solid var(--brand-lime); outline-offset: -2px; }
.notif-read-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text-on-canvas); font-size: var(--text-cap); }
.notif-compact-section { display: grid; gap: var(--space-2); }
.notif-compact-section .notif-group-heading > span { font-size: var(--text-cap); }
.notif-settings-link { align-self: flex-start; }
.notif-swipe-list { overflow: hidden; border-radius: var(--radius-card); }
.notif-swipe-row {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--crest-bg);
  touch-action: pan-y;
  user-select: none;
}
.notif-swipe-row + .notif-swipe-row { border-top: 1px solid var(--border-hairline); }
.notif-swipe-tray {
  position: absolute;
  inset-block: 0;
  display: grid;
  width: 64px;
  place-items: center;
  color: var(--brand-lime);
  pointer-events: none;
}
.notif-swipe-tray.is-start { inset-inline-start: 0; }
.notif-swipe-tray.is-end { inset-inline-end: 0; }
.notif-swipe-tray svg { width: 20px; height: 20px; }
.notif-swipe-face {
  position: relative;
  display: flex;
  background: var(--bg-reading-surface);
  color: var(--text-primary);
  transform: translateX(var(--notice-swipe-x, 0px));
  transition: transform var(--dur-fast) ease;
}
.notif-swipe-row.is-dragging .notif-swipe-face { transition: none; cursor: grabbing; }
.notif-compact-main {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  flex: 1;
  align-items: start;
  gap: 6px;
  min-width: 0;
  min-height: 60px;
  padding: 8px 4px 8px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  line-height: 1.4;
}
.notif-compact-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: var(--radius-badge);
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.notif-compact-icon.is-friend { font-size: .8125rem; font-weight: 800; }
.notif-compact-icon svg { width: 12px; height: 12px; }
.notif-compact-icon .notif-unread-dot { inset: -2px -2px auto auto; }
.notif-compact-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 6px; min-width: 0; }
.notif-compact-time { color: var(--text-secondary); font-size: .75rem; white-space: nowrap; }
.notif-compact-copy strong { font-size: var(--text-body); font-weight: 650; overflow-wrap: anywhere; }
.notif-compact-main.is-unread strong { font-weight: 800; }
.notif-compact-desc { grid-column: 1 / -1; color: var(--text-secondary); font-size: var(--text-cap); overflow-wrap: anywhere; }
.notif-compact-desc:empty { display: none; }
.notif-skip-button {
  display: grid;
  flex: none;
  place-items: center;
  min-width: 48px;
  min-height: 48px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
}
.notif-skip-button svg { width: 16px; height: 16px; }
.notif-compact-main:hover strong { text-decoration: underline; text-underline-offset: .16em; }
.notif-skip-button:hover, .notif-skip-button:active { background: var(--bg-subtle); }
.notif-swipe-face button:focus-visible { outline: 2px solid var(--text-primary); outline-offset: -3px; }
.notif-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: none;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) max(var(--space-2), env(safe-area-inset-bottom));
  background: transparent;
  border-top: 1px solid rgb(246 242 234 / 24%);
}
.notif-shortcuts button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 48px;
  padding-inline: var(--space-1);
  border: 1px solid rgb(246 242 234 / 30%);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-on-canvas);
  font-size: var(--text-cap);
  font-weight: 800;
}
.notif-shortcuts button:hover, .notif-shortcuts button:active { background: rgb(246 242 234 / 12%); }
.notif-shortcuts button:focus-visible { outline: 2px solid var(--brand-lime); outline-offset: -3px; }
.notif-shortcuts button svg { width: 16px; height: 16px; flex: none; }
.notif-shortcuts button > span { color: var(--brand-lime); }
.notif-archive-content .mini-pill-btn { min-height: 48px; min-width: 48px; }
.notif-archive-list { margin: 0; padding: 0 var(--space-3); list-style: none; border-radius: var(--radius-card); background: var(--bg-reading-surface); }
.notif-archive-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block: 8px;
}
.notif-archive-list li + li { border-top: 1px solid var(--border-hairline); }
.notif-archive-list strong { display: block; color: var(--text-primary); font-size: var(--text-body); overflow-wrap: anywhere; }
.notif-archive-list small { color: var(--text-secondary); font-size: var(--text-cap); }
@media (prefers-reduced-motion: reduce) { .notif-swipe-face { transition: none; } }

.game-card-time-hero {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  line-height: 1.15;
  color: var(--brand-pine);
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
html[data-theme="club-night"] .game-card-time-hero {
  color: var(--brand-lime);
}
.game-card-top .badge {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 2px 6px;
  font-size: 12.5px;
}

/* Top-Right Theme Color Circle Dot + 5-Swatch Circle Picker Sheet */
.theme-top-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.theme-top-dot[data-mode="auto"] {
  background: linear-gradient(135deg, #1E543B 50%, #0D1F17 50%);
}
.theme-top-dot[data-mode="club-classic"] {
  background: radial-gradient(circle at 35% 30%, #2B6D4E 0%, #163A2A 75%);
}
.theme-top-dot[data-mode="aus-blue"] {
  background: radial-gradient(circle at 35% 30%, #2478C0 0%, #15548A 75%);
}
.theme-top-dot[data-mode="club-night"] {
  background: radial-gradient(circle at 35% 30%, #214031 0%, #0B1B14 75%);
  box-shadow: 0 0 0 2px #E2F03B, 0 2px 8px rgba(0, 0, 0, 0.36);
}
.theme-top-dot[data-mode="rooftop-twilight"] {
  background: radial-gradient(circle at 35% 30%, #CE825C 0%, #933A24 75%);
}

.theme-circle-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 8px 0 4px;
}
.theme-circle-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-radius: var(--radius-card);
  border: 1.5px solid transparent;
  background: transparent;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.theme-circle-option[aria-pressed="true"] {
  background: var(--bg-subtle);
  border-color: var(--brand-pine);
}
html[data-theme="club-night"] .theme-circle-option[aria-pressed="true"] {
  border-color: var(--brand-lime);
}
.theme-circle-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  position: relative;
}
.theme-circle-option[aria-pressed="true"] .theme-circle-swatch {
  box-shadow: 0 0 0 2.5px var(--bg-surface-strong), 0 0 0 4.5px var(--brand-pine);
}
html[data-theme="club-night"] .theme-circle-option[aria-pressed="true"] .theme-circle-swatch {
  box-shadow: 0 0 0 2.5px var(--bg-surface-strong), 0 0 0 4.5px var(--brand-lime);
}
.theme-circle-swatch[data-mode="auto"] {
  background: linear-gradient(135deg, #215B40 50%, #0D1F17 50%);
}
.theme-circle-swatch[data-mode="club-classic"] {
  background: radial-gradient(circle at 32% 28%, #2E7352 0%, #163A2A 78%);
}
.theme-circle-swatch[data-mode="aus-blue"] {
  background: radial-gradient(circle at 32% 28%, #2B84CE 0%, #15548A 78%);
}
.theme-circle-swatch[data-mode="club-night"] {
  background: radial-gradient(circle at 32% 28%, #254737 0%, #0B1B14 78%);
}
.theme-circle-swatch[data-mode="rooftop-twilight"] {
  background: radial-gradient(circle at 32% 28%, #CE825C 0%, #933A24 78%);
}
.theme-circle-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.25;
}

/* Personal Journal Monthly Calendar */
.journal-calendar-card {
  gap: 12px;
}
.journal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.journal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.journal-day-cell {
  min-height: 44px;
  border-radius: var(--radius-control);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1.5px solid transparent;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.journal-day-cell.is-empty {
  pointer-events: none;
  opacity: 0;
}
.journal-day-cell.is-logged {
  background: rgba(226, 240, 59, 0.28);
  color: var(--text-primary);
  font-weight: 700;
  border-color: rgba(22, 58, 42, 0.22);
}
html[data-theme="aus-blue"] .journal-day-cell.is-logged {
  background: rgba(21, 84, 138, 0.14);
  border-color: rgba(21, 84, 138, 0.34);
  color: #0F2740;
}
html[data-theme="club-night"] .journal-day-cell.is-logged {
  background: rgba(226, 240, 59, 0.22);
  border-color: rgba(226, 240, 59, 0.45);
  color: #E2F03B;
}
.journal-day-cell.is-selected {
  background: var(--brand-pine);
  color: var(--text-on-accent);
  border-color: var(--brand-pine);
  box-shadow: 0 4px 12px rgba(10, 28, 19, 0.25);
}
html[data-theme="club-night"] .journal-day-cell.is-selected {
  background: #E2F03B;
  color: #0D1F17;
  border-color: #E2F03B;
}
.journal-day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-pine);
}
html[data-theme="club-night"] .journal-day-dot {
  background: #E2F03B;
}
.journal-day-cell.is-selected .journal-day-dot {
  background: #E2F03B;
}
html[data-theme="club-night"] .journal-day-cell.is-selected .journal-day-dot {
  background: #0D1F17;
}

/* The journal uses its own reading surfaces because the picker is shared. */
:is(#journal-calendar-card, #picker-sheet:has(#journal-sheet-form)) {
  --journal-surface: var(--bg-reading-surface);
  --journal-field: #E8EEE6;
  --journal-border: #6D8276;
  --journal-placeholder: #4C6357;
  --journal-active: #194B36;
  --journal-active-ink: #FFF9F0;
  --journal-logged: #E0EBD6;
  --journal-focus: #315C47;
}
html[data-theme="aus-blue"] :is(#journal-calendar-card, #picker-sheet:has(#journal-sheet-form)) {
  --journal-surface: #F4F8FC;
  --journal-field: #E7EFF8;
  --journal-border: #6E8398;
  --journal-placeholder: #45617A;
  --journal-active: #15548A;
  --journal-active-ink: #FFF;
  --journal-logged: #D7E8F4;
  --journal-focus: #225B87;
}
html[data-theme="club-night"] :is(#journal-calendar-card, #picker-sheet:has(#journal-sheet-form)) {
  --journal-field: #213B30;
  --journal-border: #84998C;
  --journal-placeholder: #B9CCBF;
  --journal-active: #E2F03B;
  --journal-active-ink: #0D1F17;
  --journal-logged: #374629;
  --journal-focus: #E2F03B;
}
html[data-theme="rooftop-twilight"] :is(#journal-calendar-card, #picker-sheet:has(#journal-sheet-form)) {
  --journal-field: #F4E2CC;
  --journal-border: #95705A;
  --journal-placeholder: #674737;
  --journal-active: #933A24;
  --journal-active-ink: #FFF6E9;
  --journal-logged: #F1DCC4;
  --journal-focus: #8A3B26;
}
#journal-calendar-card,
#picker-sheet:has(#journal-sheet-form) .sheet-surface {
  background: var(--journal-surface);
  color: var(--text-primary);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#picker-sheet:has(#journal-sheet-form) :is(.icon-close-btn, .section-header .meta-text),
#journal-calendar-card :is(.journal-weekdays, .meta-text),
#journal-sheet-form :is(.field-label, .segmented-option) { color: var(--text-secondary); }
#picker-sheet:has(#journal-sheet-form) .sheet-grabber { background: var(--journal-border); }
#journal-calendar-card .journal-day-cell { color: var(--text-primary); }
#journal-calendar-card .journal-day-cell.is-logged:not(.is-selected) { background: var(--journal-logged); border-color: transparent; }
#journal-calendar-card .journal-day-cell.is-selected,
#journal-sheet-form :is(.segmented-option[aria-pressed="true"], .btn-primary) {
  background: var(--journal-active);
  border-color: var(--journal-active);
  color: var(--journal-active-ink);
  box-shadow: none;
}
#journal-calendar-card .journal-day-dot { background: currentColor; }
#journal-calendar-card .btn-sm-pill,
#journal-sheet-form :is(.input, .textarea, .btn-sm-pill, .segmented-control) {
  background: var(--journal-field);
  border-color: var(--journal-border);
  color: var(--text-primary);
}
#journal-sheet-form { gap: 11px; }
#journal-sheet-form .field-group { gap: 5px; min-width: 0; }
#journal-sheet-form .field-label { font-size: 13.5px; line-height: 1.32; }
.journal-court-row, .journal-details-row { display: grid; gap: 6px; }
.journal-court-row { grid-template-columns: minmax(0, 1fr) auto; }
.journal-details-row { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
#journal-sheet-form :is(.input, .textarea, .btn-sm-pill, .segmented-option) { min-height: var(--touch-target); }
#journal-sheet-form :is(.input, .textarea) { padding: 7px 9px; }
#journal-sheet-form :is(.input, .textarea)::placeholder { color: var(--journal-placeholder); opacity: 1; }
#journal-sheet-form .textarea { min-height: 78px; }
#journal-sheet-form :is(.btn-sm-pill, .segmented-option) { padding-inline: 5px; }
#journal-sheet-form .segmented-control { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 2px; gap: 2px; }
#journal-calendar-card button:focus-visible,
#journal-sheet-form :is(button, input, textarea):focus-visible { outline: 2px solid var(--journal-focus); outline-offset: 2px; }

/* Brand Icon Spec Sheet Grid */
.icon-spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.icon-spec-tile {
  padding: 12px 8px 10px;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}
.icon-spec-glyph {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-badge);
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-hairline);
  display: grid;
  place-items: center;
  color: var(--brand-pine);
}
html[data-theme="club-night"] .icon-spec-glyph,
html[data-theme="rooftop-twilight"] .icon-spec-glyph {
  background: #13281E;
  color: #F6F2EA;
}
.icon-spec-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.icon-spec-role {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.25;
}

/* Custom Time Range Filter Box */
.custom-time-range-box {
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}
.custom-time-range-box[hidden] {
  display: none;
}
.custom-time-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.custom-time-range-row .input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 6px 10px;
}

/* ==========================================================================
   P3 Onboarding · 首次載入登入與程度校準引導
   ========================================================================== */
.ob-step-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.ob-step-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border-hairline);
  transition: background var(--dur-fast) ease;
}
.ob-step-bar.is-active {
  background: var(--brand-lime);
}

.screen-root:has(> .ob-welcome) {
  scrollbar-width: thin;
  scrollbar-color: #80988B rgb(var(--overlay-rgb));
}

.ob-welcome {
  --ob-welcome-top: 14 36 27;
  --ob-welcome-surface: 15 39 30;
  --ob-welcome-position: 51% 52%;
  --ob-welcome-ink: #F9F8E9;
  --ob-welcome-quiet: #C6D9C9;
  --ob-welcome-border: #819E8C;
  --ob-welcome-accent: #DFE7AB;
  --ob-welcome-on-accent: #213420;
  --ob-welcome-menu: #1A392B;

  min-height: 100%;
  container-type: inline-size;
  background: rgb(var(--ob-welcome-surface));
  color: var(--ob-welcome-ink);
}

html[data-theme="aus-blue"] .ob-welcome {
  --ob-welcome-top: 13 35 57;
  --ob-welcome-surface: 16 41 65;
  --ob-welcome-position: 49% 58%;
  --ob-welcome-ink: #F2F8FD;
  --ob-welcome-quiet: #C7DCEB;
  --ob-welcome-border: #7B9AB5;
  --ob-welcome-accent: #BFEBFF;
  --ob-welcome-on-accent: #0F334B;
  --ob-welcome-menu: #173D5C;
}

html[data-theme="club-night"] .ob-welcome {
  --ob-welcome-top: 16 28 37;
  --ob-welcome-surface: 19 37 47;
  --ob-welcome-position: 48% 48%;
  --ob-welcome-ink: #F6F5EA;
  --ob-welcome-quiet: #CCDAE0;
  --ob-welcome-border: #839BA6;
  --ob-welcome-accent: var(--brand-lime);
  --ob-welcome-on-accent: #182510;
  --ob-welcome-menu: #172B37;
}

html[data-theme="rooftop-twilight"] .ob-welcome {
  --ob-welcome-top: 47 28 21;
  --ob-welcome-surface: 55 30 21;
  --ob-welcome-position: 50% 56%;
  --ob-welcome-ink: #FFF4E7;
  --ob-welcome-quiet: #EAD0BC;
  --ob-welcome-border: #BB9176;
  --ob-welcome-accent: #FFCD9E;
  --ob-welcome-on-accent: #422416;
  --ob-welcome-menu: #522E21;
}

.ob-welcome-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: max(17rem, 92cqw);
  padding: 7cqw 7cqw 8cqw;
  background:
    linear-gradient(180deg,
      rgb(var(--ob-welcome-top) / 0.82),
      rgb(var(--ob-welcome-top) / 0.13) 34%,
      rgb(var(--ob-welcome-surface) / 0.42) 56%,
      rgb(var(--ob-welcome-surface)) 100%),
    var(--ob-welcome-photo, none) var(--ob-welcome-position) / cover no-repeat;
  background-color: rgb(var(--ob-welcome-surface));
}

.ob-welcome-progress {
  position: absolute;
  inset: 8px 18px auto;
}

.ob-welcome-progress .ob-step-bar { background: rgba(255, 255, 255, 0.23); }
.ob-welcome-progress .ob-step-bar.is-active { background: var(--ob-welcome-accent); }

.ob-welcome-crest {
  position: absolute;
  top: 7cqw;
  right: 6cqw;
  width: 17cqw;
  height: 15cqw;
}

.ob-welcome-crest svg { display: block; width: 100%; height: 100%; }
.ob-welcome-copy { width: 100%; text-align: right; }

.ob-welcome-copy h2 {
  margin: 0;
  color: #FFF8E9;
  font: 700 clamp(1.875rem, 10cqw, 2.625rem)/1.12 var(--font-tc-serif);
  letter-spacing: -0.035em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
}

.ob-welcome-copy h2 span { display: block; }

.ob-welcome-copy p {
  margin: 3cqw 0 0;
  color: var(--ob-welcome-ink);
  font-size: var(--text-sub);
  line-height: 1.55;
}

.ob-welcome-auth { padding: 8px 18px 20px; }

.ob-welcome-auth-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.ob-welcome-auth-heading h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.ob-welcome-theme-control { position: relative; z-index: 2; }

.ob-welcome-theme-trigger {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  padding-left: 8px;
  color: var(--ob-welcome-quiet);
  text-align: right;
  font-size: var(--text-cap);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ob-welcome-theme-trigger:hover { color: var(--ob-welcome-ink); }

.ob-welcome-theme-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: 164px;
  display: grid;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--ob-welcome-border);
  border-radius: var(--radius-card);
  background: var(--ob-welcome-menu);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32);
}

.ob-welcome-theme-menu[hidden] { display: none; }

.ob-welcome-theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch-target);
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--ob-welcome-ink);
  text-align: left;
  font-size: var(--text-cap);
  font-weight: 650;
}

.ob-welcome-theme-option .theme-circle-swatch {
  width: 17px;
  height: 17px;
  flex: none;
  border: 0;
  box-shadow: none;
}

.ob-welcome-theme-option:hover { background: rgba(255, 255, 255, 0.08); }
.ob-welcome-theme-option[aria-pressed="true"] {
  border-color: var(--ob-welcome-border);
  background: rgba(255, 255, 255, 0.10);
  font-weight: 800;
}

.ob-welcome-auth-options { display: grid; gap: 7px; }

.ob-welcome-provider {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 19px;
  min-height: 46px;
  padding: 7px 11px;
  border: 1px solid var(--ob-welcome-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ob-welcome-ink);
  font-size: var(--text-sub);
}

.ob-welcome-provider.is-primary {
  border-color: var(--ob-welcome-accent);
  background: var(--ob-welcome-accent);
  color: var(--ob-welcome-on-accent);
}

.ob-welcome-provider:hover { box-shadow: inset 0 0 0 1px currentColor; }
.ob-welcome button:focus-visible { outline-color: var(--ob-welcome-accent); }

.ob-welcome-note {
  margin: 12px 0 0;
  color: var(--ob-welcome-quiet);
  font-size: var(--text-cap);
  line-height: 1.55;
}

.ob-welcome-note + .ob-welcome-note { margin-top: 7px; }

.ob-welcome-legal-link {
  min-height: var(--touch-target);
  padding-inline: 2px;
  color: var(--ob-welcome-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ob-welcome-legal-link:hover { color: var(--ob-welcome-accent); }

.ob-legal-dialog {
  width: min(100vw, 490px);
  max-height: 96dvh;
  padding: 12px;
}

.ob-legal-surface {
  max-height: min(86dvh, 720px);
  padding: 16px;
  background: var(--bg-reading-surface);
}

.ob-legal-surface .dialog-top-row {
  flex: none;
  padding-inline-end: var(--touch-target);
}

.ob-legal-document {
  display: block;
  min-height: 0;
  padding-inline-end: 4px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  font-size: var(--text-body);
  line-height: 1.65;
}

.ob-legal-document h3 {
  margin: 16px 0 4px;
  font-size: 1rem;
}

.ob-legal-document p { margin: 0 0 8px; }
.ob-legal-document ul { margin: 0 0 8px; padding-inline-start: 1.3em; }
.ob-legal-document li + li { margin-top: 8px; }

.ob-legal-status {
  padding: 8px 10px;
  border-radius: var(--radius-control);
  background: var(--badge-warn-bg);
  color: var(--text-primary);
  font-size: var(--text-sub);
}

.ob-legal-surface > .btn { flex: none; }

.ob-phone-box {
  padding: 12px;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ob-phone-box[hidden] {
  display: none;
}

.ob-guest-btn {
  width: 100%;
  min-height: 44px;
  text-align: center;
  font-size: var(--text-sub);
  font-weight: 600;
  color: var(--text-on-canvas);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ob-avatar-tone-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ob-avatar-tone-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 3px;
  display: grid;
  place-items: center;
  background: transparent;
}
.ob-avatar-tone-btn[aria-pressed="true"] {
  border-color: var(--brand-pine);
}
.ob-avatar-tone-btn .avatar-circle {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.ob-card-heading { margin: 0; }
.ob-inline-auth { display: flex; justify-content: end; align-items: center; gap: 8px; }
.ob-card-preview { container-type: inline-size; min-width: 0; }
.ob-card-preview .ob-inline-showcase { height: clamp(238px, 72cqi, 294px); margin: 0; }
.ob-inline-showcase.pc-player-card { background: var(--pc-court) center / cover no-repeat; }
.ob-inline-showcase::before { display: none; }
.ob-public-cover-note {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-reading-surface);
  color: var(--text-secondary);
  border-radius: var(--radius-control);
}
.ob-inline-showcase .profile-player-identity {
  width: max(105px, 43%); padding: 12px 8px 27px;
}
.ob-inline-showcase .profile-player-image { top: 32px; height: calc(100% - 26px); width: 66%; }
.ob-inline-showcase .profile-player-image.is-waist-crop { top: 54px; height: calc(100% - 48px); }
.ob-inline-showcase .profile-showcase-avatar { margin-bottom: var(--space-2); }
.ob-inline-showcase .profile-edit-card { top: 6px; right: 6px; font-size: var(--text-cap); }
.ob-inline-name-label { display: block; margin-bottom: 4px; color: var(--showcase-accent); font-size: var(--text-cap); }
.ob-inline-name {
  width: 100%; min-height: 44px; padding: 4px 6px; border: 1px solid var(--showcase-border);
  border-radius: var(--radius-control); background: var(--showcase-scrim); color: var(--showcase-ink);
  font: 800 16px/1.2 var(--font-sans);
}
.ob-inline-name:focus-visible { outline: 2px solid var(--showcase-accent); outline-offset: 2px; }
.ob-avatar-methods .segmented-option { min-height: 44px; padding-inline: 3px; }
.ob-avatar-pane { display: grid; gap: var(--space-2); }
.ob-portrait-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
.ob-portrait-options .btn {
  display: flex; align-items: center; justify-content: center; gap: var(--space-1);
  min-width: 0; min-height: 46px; padding: 5px; font-size: var(--text-cap); white-space: normal;
}
.ob-portrait-options img { width: 29px; height: 34px; object-fit: contain; }
.ob-portrait-options [aria-pressed="true"] { border-color: var(--accent-solid); background: var(--accent-tint); }
.ob-card-small-btn { width: auto; min-height: var(--touch-target); padding: 0 var(--space-2); font-size: var(--text-cap); }
.ob-card-default { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); border: 1px solid var(--border-hairline); border-radius: var(--radius-control); background: var(--bg-subtle); }
.ob-card-default .avatar-circle { width: 48px; height: 48px; border-radius: 50%; font-size: var(--text-h3); flex: none; }
.ob-card-default .meta-text, .ob-card-media .meta-text { margin: 0; }
.ob-card-scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: var(--space-1); }
.ob-card-scenarios button { min-width: 0; display: grid; gap: var(--space-1); padding: var(--space-1); border: 1px solid var(--border-hairline); border-radius: var(--radius-control); color: var(--text-secondary); font-size: var(--text-cap); font-weight: 700; background: var(--bg-surface-strong); }
.ob-card-scenarios button[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-solid); color: var(--text-primary); }
.ob-card-scenarios img { display: block; width: 100%; min-width: 0; height: 36px; object-fit: cover; border-radius: var(--radius-badge); }
.ob-card-disclosure { border-top: 1px solid var(--border-hairline); }
.ob-card-disclosure summary { min-height: var(--touch-target); padding: var(--space-3) 0; color: var(--text-primary); font-weight: 700; cursor: pointer; }
.ob-card-disclosure summary span { margin-left: var(--space-1); }
.ob-card-custom-body { display: grid; gap: var(--space-2); }
.card-artwork-label,
.card-artwork-photo-form p { margin: 0; }
.card-artwork-results { display: grid; grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr); gap: var(--space-2); }
.card-artwork-result { margin: 0; min-width: 0; }
.card-artwork-result > div {
  height: clamp(92px, 21dvh, 148px);
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--bg-subtle);
}
.card-artwork-results:not(.is-sample) .card-artwork-result > div {
  background-image: conic-gradient(var(--border-hairline) 25%, transparent 0 50%, var(--border-hairline) 0 75%, transparent 0);
  background-size: 16px 16px;
}
.card-artwork-result img { width: 100%; height: 100%; display: block; object-fit: contain; }
.card-artwork-result figcaption { padding-block: 4px; color: var(--text-secondary); font-size: var(--text-cap); font-weight: 700; }
.card-artwork-style { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); font-size: var(--text-sub); }
.card-artwork-photo-form { display: grid; gap: var(--space-1); padding: var(--space-3); border: 1px solid var(--border-hairline); border-radius: var(--radius-card); background: var(--bg-reading-surface); }
.ob-card-photo-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ob-card-photo-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-2); }
.ob-card-photo-actions label { gap: 6px; min-width: 0; padding-inline: 4px; font-size: var(--text-cap); cursor: pointer; }
.ob-card-photo-actions label.ob-card-camera-label { background: var(--accent-tint); }
.ob-card-photo-actions label svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ob-card-photo-actions input:focus-visible + label { outline: 2px solid var(--brand-lime); outline-offset: 2px; }
.ob-card-photo-actions input:disabled + label { opacity: .55; cursor: wait; }
.ob-card-photo-thumb { display: block; width: min(100%, 80px); height: 48px; object-fit: cover; border-radius: var(--radius-control); }
.ob-card-result-note { margin-top: var(--space-2); }
.profile-cover-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px var(--space-2); margin: 0; }
.profile-cover-caption span { font-weight: 700; }
#profile-cover-preview .pc-hero-stage { min-height: clamp(142px, 25svh, 200px); }
.profile-cover-modes, .profile-cover-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
.profile-cover-modes .btn { padding-inline: 4px; white-space: normal; }
.profile-cover-modes [aria-pressed="true"] { border-color: var(--accent-solid); background: var(--accent-tint); color: var(--text-primary); }
#profile-cover-options button { min-height: 44px; line-height: 1.35; }
.card-artwork-action { display: grid; gap: var(--space-2); margin-top: var(--space-1); padding-top: var(--space-3); border-top: 1px solid var(--border-hairline); }
.card-artwork-action .meta-text { margin: 0; }
.card-artwork-status[data-error] { color: var(--badge-danger-fg); }

.ob-ntrp-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ob-ntrp-card {
  width: 100%;
  min-height: 54px;
  padding: 11px 13px;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-hairline);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.ob-ntrp-card[aria-pressed="true"] {
  border-color: var(--brand-pine);
  background: var(--accent-tint);
}
.ob-ntrp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ob-ntrp-title {
  font-weight: 700;
  font-size: var(--text-body);
  color: var(--text-primary);
}
.ob-ntrp-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ob-pledge-card {
  border-left: 3px solid var(--brand-pine);
}
.ob-pledge-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--text-sub);
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   榮譽勳章牆（A+B 混搭：鑽石切面紀念幣 ＋ 外圈進度弧 ＋ 三階星數）
   ========================================================================== */
.badge-wall-card {
  background: rgba(11, 26, 18, 0.92);
}

.badge-wall-heading { container-type: inline-size; }

.badge-wall-heading .badge-wall-hint {
  margin-top: 4px;
  font-size: clamp(10px, 3.9cqi, 12px);
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.badge-wall-progress {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 6px var(--space-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: var(--text-cap);
  white-space: nowrap;
}

.badge-wall-progress progress {
  flex: 1;
  min-width: 0;
  height: 7px;
  appearance: none;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--border-strong);
}

.badge-wall-progress progress::-webkit-progress-bar { background: var(--border-strong); }
.badge-wall-progress progress::-webkit-progress-value { background: var(--text-secondary); }
.badge-wall-progress progress::-moz-progress-bar { background: var(--text-secondary); }
.badge-wall-progress strong { color: var(--text-primary); }

.medal-wall-grid {
  display: grid;
  grid-template-columns: repeat(3, 98px);
  justify-content: start;
  gap: 20px 10px;
  padding: 6px 0 4px;
}

.medal-wall-item {
  width: 98px;
  min-height: 124px;
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}

.medal-wall-item:active {
  transform: scale(0.95);
}

.medal-coin-wrap {
  position: relative;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
}

.medal-pin-mark {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #0D2016;
  border: 1.5px solid #E2F03B;
  color: #E2F03B;
  display: grid;
  place-items: center;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.medal-wall-name {
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.medal-wall-item.is-locked .medal-wall-name {
  color: var(--text-secondary);
}

.medal-wall-count {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.medal-wall-tier {
  margin-top: 1px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-tier-label {
  --tier-ink: #3f5147;
  --tier-surface: #e4ebe7;
  display: inline-block;
  padding: 3px 5px;
  border-radius: 5px;
  color: var(--tier-ink);
  background: var(--tier-surface);
  line-height: 1.25;
}

.badge-tier-label[data-tier="gold"] { --tier-ink: #554400; --tier-surface: #f7e9a5; }
.badge-tier-label[data-tier="silver"] { --tier-ink: #344b5d; --tier-surface: #e8eef3; }
.badge-tier-label[data-tier="bronze"] { --tier-ink: #663118; --tier-surface: #f6ddca; }
html[data-theme="club-night"] .badge-tier-label[data-tier="locked"] { --tier-ink: #e2eee7; --tier-surface: #354b40; }
html[data-theme="club-night"] .badge-tier-label[data-tier="gold"] { --tier-ink: #fff1a7; --tier-surface: #4b3c14; }
html[data-theme="club-night"] .badge-tier-label[data-tier="silver"] { --tier-ink: #e5eff7; --tier-surface: #354d61; }
html[data-theme="club-night"] .badge-tier-label[data-tier="bronze"] { --tier-ink: #ffe3cc; --tier-surface: #623826; }

.medal-coin-wrap, .badge-sheet-medal {
  --medal-plate: #3c594f;
  --medal-plate-edge: #6e897d;
  position: relative;
  isolation: isolate;
}

html[data-theme="aus-blue"] :is(.medal-coin-wrap, .badge-sheet-medal) {
  --medal-plate: #354f65;
  --medal-plate-edge: #6b879c;
}

html[data-theme="club-night"] :is(.medal-coin-wrap, .badge-sheet-medal) {
  --medal-plate: #2a463b;
  --medal-plate-edge: #688478;
}

html[data-theme="rooftop-twilight"] :is(.medal-coin-wrap, .badge-sheet-medal) {
  --medal-plate: #644335;
  --medal-plate-edge: #9c7965;
}

:is(.medal-coin-wrap, .badge-sheet-medal)::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  border: 1px solid var(--medal-plate-edge);
  border-radius: 50%;
  background: var(--medal-plate);
  pointer-events: none;
}

/* 勳章詳情 Bottom Sheet */
.badge-sheet-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge-sheet-medal {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.badge-sheet-tier-eyebrow {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.badge-tier-roadmap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.badge-roadmap-step {
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-roadmap-step.is-done {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}

.badge-roadmap-step.is-current {
  border-color: rgba(226, 240, 59, 0.55);
  background: rgba(226, 240, 59, 0.09);
}

.badge-roadmap-lvl {
  font-size: 12.5px;
  font-weight: 800;
}

.badge-roadmap-req {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.badge-integrity-box {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px 12px;
}

.badge-integrity-box strong {
  color: var(--text-primary);
}

/* 個人名片預留位（低調嵌入最多 3 枚小圓章） */
.member-subtle-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.member-subtle-badges-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.member-subtle-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-mini-medal {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
}

/* ==========================================================================
   地圖方圓 5km 動態雷達圈 HUD & Pin 精簡層級
   ========================================================================== */
.map-radar-hud {
  position: relative;
  align-self: flex-start;
}

.map-radius-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 9px;
  border: 0;
  border-radius: 8px;
  background: #FFFDF4;
  color: #17362A;
  box-shadow: 0 2px 6px #2E43302B;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.map-radius-trigger:hover,
.map-radius-trigger[aria-expanded="true"] {
  background: #EAF1DF;
}

.map-radius-chevron {
  width: 6px;
  height: 6px;
  margin: -3px 2px 0;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.map-radius-popover {
  position: absolute;
  inset: calc(100% + 4px) auto auto 0;
  z-index: 1;
  width: max-content;
  padding: 7px 9px 3px;
  border: 1px solid #A7B6A5;
  border-radius: 8px;
  background: #FFFDF3;
  color: #17362A;
  box-shadow: 0 6px 15px #172F2639;
}

.map-radius-popover p {
  margin: 0;
  font-size: 12px;
  font-weight: 750;
}

.map-radius-pills {
  display: flex;
}

.map-radius-pill {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 2px;
  border: none;
  background: transparent;
  color: #345346;
  font-size: 12px;
  font-weight: 750;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.map-radius-pill span {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 26px;
  padding: 1px 3px;
  border-radius: 5px;
}

.map-radius-pill:hover span {
  background: #E5EBDC;
}

.map-radius-trigger:focus-visible,
.map-radius-pill:focus-visible {
  outline-color: #2F684A;
}

.map-radius-pill[aria-pressed="true"] span {
  background: #DBE7CB;
  color: #193A2A;
  font-weight: 850;
}

.map-radar-center-pin {
  position: relative;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.map-radar-pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--map-radar-accent) 72%, transparent);
  background: color-mix(in srgb, var(--map-radar-accent) 14%, transparent);
  animation: tcRadarPulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.map-radar-core {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--map-radar-accent);
  border: 2.5px solid #0B1910;
  box-shadow: 0 0 12px color-mix(in srgb, var(--map-radar-accent) 80%, transparent);
  position: relative;
  z-index: 2;
}

@keyframes tcRadarPulse {
  0% { transform: scale(0.45); opacity: 0.95; }
  100% { transform: scale(1.35); opacity: 0; }
}

html[data-theme="rooftop-twilight"] .map-screen :is(.map-search-box, .map-controls-stack) {
  background: var(--bg-surface-strong);
  border-color: var(--border-hairline);
}
html[data-theme="rooftop-twilight"] .map-screen :is(.map-ctrl-btn, .map-recenter-btn) {
  color: var(--text-primary);
  border-color: var(--border-hairline);
}
html[data-theme="rooftop-twilight"] :is(.map-radius-trigger, .map-radius-popover) {
  background: #FFF5E6;
  color: var(--text-primary);
  border-color: var(--border-hairline);
}
html[data-theme="rooftop-twilight"] :is(.map-radius-trigger:hover, .map-radius-trigger[aria-expanded="true"], .map-radius-pill:hover span) {
  background: var(--bg-subtle);
}
html[data-theme="rooftop-twilight"] .map-radius-pill {
  color: var(--text-secondary);
}
html[data-theme="rooftop-twilight"] .map-radius-pill[aria-pressed="true"] span {
  background: #EDD7C4;
  color: var(--text-primary);
}
html[data-theme="rooftop-twilight"] :is(.map-radius-trigger, .map-radius-pill):focus-visible {
  outline-color: var(--accent-solid);
}
html[data-theme="rooftop-twilight"] .map-radar-core {
  border-color: var(--brand-cream);
}

/* ==========================================================================
   球局選項與待審核名單
   ========================================================================== */
.topbar-more-btn {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 32, 22, 0.86);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.pending-applicant-row {
  padding-top: 10px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pending-applicant-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 打球日誌紀錄卡片排版重整 */
.journal-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.journal-entry.has-divider {
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
}

.journal-entry-court {
  font-size: var(--text-h3);
  color: var(--text-primary);
  line-height: 1.3;
}

.journal-entry-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.journal-entry-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: var(--text-secondary);
}

.journal-entry-pill.is-accent {
  background: #eee;
  border-color: #c8c8c8;
  color: #000;
}

.journal-entry-memo {
  margin: 2px 0 4px;
  font-size: var(--text-body);
  line-height: 1.5;
  color: var(--text-primary);
}

/* 開一局表單以不透明的主題表面維持對比。 */
#create-game-form {
  --create-card: var(--bg-reading-surface);
  --create-field: #E9EEE6;
  --create-border: #758778;
  --create-active: #194B36;
}

html[data-theme="aus-blue"] #create-game-form {
  --create-card: #F4F8FC;
  --create-field: #E9F0F8;
  --create-border: #74869A;
  --create-active: #154D77;
}

html[data-theme="club-night"] #create-game-form {
  --create-field: #213B30;
  --create-border: #81998A;
  --create-active: var(--accent-solid);
}

html[data-theme="rooftop-twilight"] #create-game-form {
  --create-field: #F4E2CC;
  --create-border: #A47A60;
  --create-active: var(--accent-solid);
}

#create-game-form > :is(.card, .sticky-footer) {
  background: var(--create-card);
}

#create-game-form > .card {
  gap: 9px;
  padding: 14px;
}

#create-game-form .field-group {
  gap: 4px;
}

#create-game-form .field-group > .field-label {
  font-size: var(--text-cap);
  font-weight: 550;
  color: var(--text-secondary);
  line-height: 1.35;
}

#create-game-form :is(.picker-trigger, .segmented-control, .input, .textarea) {
  background: var(--create-field);
  border-color: var(--create-border);
}

#create-game-form :is(.picker-trigger-chevron, .caption-text),
#create-game-form :is(.input, .textarea)::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

#create-game-form .picker-trigger-val {
  font-size: var(--text-body);
  font-weight: 620;
}

#create-game-form .segmented-option {
  min-height: 44px;
  font-size: var(--text-cap);
  font-weight: 550;
}

#create-game-form .segmented-option[aria-pressed="true"] {
  border: 1.5px solid var(--create-active);
  background: var(--create-active);
  color: var(--text-on-accent);
  font-weight: 650;
}

#create-game-form .sticky-footer .btn-primary {
  background: var(--create-active);
  border-color: var(--create-active);
}

#create-game-form .sticky-footer .btn-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--create-active) 92%, black);
}

#create-game-form :is(button, input, textarea):focus-visible {
  outline-color: var(--create-active);
}

#create-game-form :is(.create-count-error, .create-field-error) {
  color: var(--badge-danger-fg);
  font-weight: 700;
}

#create-game-form :is(.picker-trigger, .input)[aria-invalid="true"],
#create-game-form .segmented-control:has([aria-invalid="true"]) {
  border-color: var(--badge-danger-fg);
  box-shadow: inset 0 0 0 1px var(--badge-danger-fg);
}

.create-group-title {
  margin: 0 0 1px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

#create-game-form .create-schedule {
  gap: 11px;
}

.create-schedule-clock {
  padding: 6px 10px 9px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  background: var(--create-field);
}

#create-game-form .create-schedule-date {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--border-hairline);
}

.create-schedule-times {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
  align-items: end;
  gap: 4px;
  padding-top: 8px;
}

#create-game-form .create-schedule-times .field-label { padding-inline-start: 7px; }

#create-game-form .create-schedule-clock .picker-trigger {
  min-height: 44px;
  gap: 4px;
  padding: 4px 7px;
  border: 0;
  background: transparent;
}

#create-game-form .create-schedule-date .picker-trigger {
  justify-content: flex-end;
  gap: 8px;
}

#create-game-form .create-schedule-times .picker-trigger-val {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.create-time-divider {
  height: 1px;
  margin-bottom: 21px;
  background: var(--create-border);
}

#create-game-form .create-schedule-court {
  min-height: 44px;
  padding: 6px 7px 6px 0;
  border: 0;
  border-bottom: 1px solid var(--border-hairline);
  border-radius: 0;
  background: transparent;
}

#create-game-form .create-schedule-court .picker-trigger-val {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--text-h3);
  font-weight: 700;
}

.create-court-meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-cap);
  line-height: 1.4;
}

@media (max-width: 360px) {
  #create-game-form .create-schedule-times .picker-trigger-val { font-size: 1.25rem; }
}

/* 配對卡手勢教學與球局資訊 */
.featured-swipe-stage {
  --demo-duration: 3200ms;
}

/* 保留最後一張球局卡的排版尺寸，讓結尾卡隨視窗同步重排。 */
.featured-size-reference { visibility: hidden; }

.featured-swipe-stage .featured-end-card {
  position: absolute;
  inset: 0;
  justify-content: flex-end;
  justify-content: safe flex-end;
  gap: var(--space-3);
  padding: var(--space-4);
  overflow: auto;
  background: linear-gradient(180deg, rgb(13 31 23 / 34%) 10%, rgb(7 23 16 / 92%) 100%);
  color: var(--text-on-canvas);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.featured-end-copy {
  display: grid;
  gap: var(--space-1);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid rgb(246 242 234 / 50%);
}

.featured-end-copy h3 {
  margin: 0;
  font: 750 clamp(1.35rem, 6.6cqw, 1.8rem)/1.24 var(--font-tc-serif);
  text-wrap: balance;
}

.featured-end-copy p {
  margin: 0;
  font-size: var(--text-sub);
  line-height: 1.5;
}

.featured-end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.featured-end-actions .btn {
  width: auto;
  min-width: 48px;
  min-height: 48px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgb(246 242 234 / 43%);
  border-radius: var(--radius-control);
  font-size: var(--text-sub);
  font-weight: 800;
  white-space: nowrap;
}

.featured-end-filter {
  background: #f6efe1;
  color: #13251b;
}

.featured-end-create {
  background: rgb(13 31 23 / 61%);
  color: #f6f2ea;
}

.featured-end-replay {
  margin-inline-start: auto;
  background: rgb(246 242 234 / 12%);
  color: #f6f2ea;
}

.featured-guide-switch {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-block-size: 48px;
  min-inline-size: 48px;
  padding-inline: var(--space-1);
  border-radius: 8px;
  color: var(--text-on-canvas);
  font-size: var(--text-cap);
  font-weight: 700;
  white-space: nowrap;
}
.featured-guide-switch:focus-visible {
  outline: 2px solid #e9f779;
  outline-offset: -4px;
}
.featured-guide-track {
  position: relative;
  display: block;
  box-sizing: border-box;
  inline-size: 32px;
  block-size: 16px;
  border: 1px solid #adb9ad;
  border-radius: 20px;
  background: #344c40;
}
.featured-guide-track::before {
  content: "";
  position: absolute;
  inset: 2px auto auto 2px;
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  background: #f2f4e8;
  transition: transform 150ms ease;
}
.featured-guide-switch[aria-checked="true"] .featured-guide-track {
  background: #e9f779;
  border-color: #e9f779;
}
.featured-guide-switch[aria-checked="true"] .featured-guide-track::before {
  background: #173428;
  transform: translateX(16px);
}

@media (prefers-reduced-motion: reduce) {
  .featured-guide-track::before { transition: none; }
}

.gesture-demo {
  --swipe-distance: clamp(30px, 11cqi, 50px);
  --idle-hint: .72;
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  min-height: 28px;
  flex: 1;
  container-type: inline-size;
  background: radial-gradient(ellipse at center, rgb(7 23 16 / 21%), transparent 70%);
  color: #fefff4;
  pointer-events: none;
}
.gesture-demo[hidden] { display: none; }

.gesture-guidance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  z-index: 2;
  gap: 4px;
}
.gesture-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid rgb(251 252 237 / 35%);
  border-radius: 6px;
  background: rgb(9 25 18 / 91%);
  color: #f6f7ed;
  font-size: clamp(11px, 3.6cqi, 13px);
  font-weight: 800;
  white-space: nowrap;
}
.gesture-hint svg { width: 14px; height: 14px; flex: none; }
.gesture-hint--left { animation: gesture-hint-left var(--demo-duration) infinite; }
.gesture-hint--right {
  color: #e9f779;
  border-color: rgb(233 247 121 / 53%);
  animation: gesture-hint-right var(--demo-duration) infinite;
}
.gesture-traveler {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  animation: gesture-travel var(--demo-duration) cubic-bezier(.22,.7,.34,1) infinite;
}
.gesture-hand {
  z-index: 1;
  width: 47px;
  height: 47px;
  translate: 4px 11px;
  filter: drop-shadow(0 2px 3px rgb(5 20 13 / 78%));
}
.gesture-contact {
  position: absolute;
  z-index: 2;
  width: 16px;
  height: 16px;
  margin: -24px 0 0 -8px;
  border: 1.5px solid #e9f779;
  border-radius: 50%;
  animation: gesture-contact var(--demo-duration) ease-out infinite;
}
.gesture-ghost {
  position: absolute;
  width: clamp(83px, 39cqi, 130px);
  height: 68px;
  border: 1.5px solid rgb(251 255 230 / 82%);
  border-radius: 9px;
  background: rgb(230 246 166 / 16%);
  box-shadow: 0 3px 10px rgb(5 17 11 / 28%);
  animation: gesture-ghost-tilt var(--demo-duration) ease-in-out infinite;
}
@keyframes gesture-travel {
  0%, 12%, 48%, 59%, 100% { transform: translateX(0); }
  32%, 39% { transform: translateX(calc(-1 * var(--swipe-distance))); }
  81%, 90% { transform: translateX(var(--swipe-distance)); }
}
@keyframes gesture-hint-left {
  0%, 8%, 46%, 100% { opacity: var(--idle-hint); }
  19%, 38% { opacity: 1; }
}
@keyframes gesture-hint-right {
  0%, 55%, 98%, 100% { opacity: var(--idle-hint); }
  70%, 91% { opacity: 1; }
}
@keyframes gesture-contact {
  0%, 30%, 48%, 79%, 100% { opacity: 0; transform: scale(.75); }
  11%, 57% { opacity: 1; transform: scale(1.3); }
  19%, 66% { opacity: .64; transform: scale(1); }
}
@keyframes gesture-ghost-tilt {
  0%, 12%, 48%, 59%, 100% { transform: rotate(0); }
  30%, 39% { transform: rotate(-7deg); }
  81%, 90% { transform: rotate(7deg); }
}
@media (prefers-reduced-motion: reduce) {
  .gesture-demo,
  .gesture-demo * { animation: none !important; }
  .gesture-demo .gesture-contact,
  .gesture-demo .gesture-ghost { display: none; }
}

#featured-swipe-card .featured-hero-body {
  gap: 0;
  padding: 0 var(--space-4) var(--space-3);
}

.featured-capacity {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
  margin: 0 calc(-1 * var(--space-4));
  padding: var(--space-2) var(--space-4);
  color: var(--text-on-canvas);
  background: var(--crest-bg);
  overflow-wrap: anywhere;
}

.featured-capacity dt, .featured-capacity-count {
  font-size: var(--text-cap);
  font-weight: 700;
  line-height: 1.4;
}
.featured-capacity dd { margin: 0; }
.featured-capacity-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
}
.featured-capacity-count {
  text-align: end;
}
.featured-seat-markers {
  display: flex;
  gap: 2px;
  max-inline-size: 96px;
  margin-block-start: var(--space-1);
  margin-inline-start: auto;
}
.featured-seat-markers > span {
  flex: 1;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.featured-seat-markers > .is-occupied {
  border-color: var(--brand-lime);
  background: var(--brand-lime);
}

#featured-swipe-card .featured-time-row {
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  padding-block: var(--space-2);
}
#featured-swipe-card .featured-hero-time {
  font-size: clamp(1.5rem, 7.5cqw, 1.875rem);
  line-height: 1.12;
}
#featured-swipe-card .featured-date-range {
  font-size: var(--text-cap);
  text-align: start;
}
:is(#featured-swipe-card, #featured-end-card):focus-visible {
  outline: 3px solid var(--brand-lime, #e2f03b);
  outline-offset: -4px;
}

.match-notice-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-block-start: 1px solid var(--border-hairline);
  overflow-wrap: anywhere;
}
.match-notice-field { padding-block: var(--space-1); }
.match-notice-field--level { padding-inline-end: var(--space-3); }
.match-notice-field--entry, .match-notice-field--review {
  border-inline-start: 1px solid var(--border-hairline);
  padding-inline-start: var(--space-3);
}
.match-notice-field--fee {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-2);
  border-block-start: 1px solid var(--border-hairline);
  padding-block-end: 0;
}
.match-notice-field dt, .match-notice-note {
  color: var(--text-secondary);
  font-size: var(--text-cap);
  font-weight: 700;
  line-height: 1.4;
}
.match-notice-field dd {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-body);
  line-height: 1.4;
}
.match-notice-value { font-weight: 800; font-variant-numeric: tabular-nums; }
.match-notice-field--review .match-notice-value { color: var(--brand-pine); }
.match-notice-note { display: block; }

.phone-frame:has(> .screen-root > .featured-shell) {
  container: featured-frame / size;
}
.screen-root:has(> .featured-shell) { overflow-x: hidden; }
.screen-root:has(#featured-swipe-card) { flex: 1 1 auto; }
.screen-root:has(#featured-swipe-card) > .featured-shell { flex-grow: 1; }
.featured-deck:has(#featured-swipe-card) { margin-block: auto; }
.phone-frame:has(.featured-shell) > :is(.app-topbar, .screen-root) {
  transition-property: none;
}
.phone-frame:has(.featured-shell) > .app-topbar {
  min-height: calc(44px + var(--featured-safe-top, env(safe-area-inset-top)));
  padding-block: calc(var(--space-1) + var(--featured-safe-top, env(safe-area-inset-top))) var(--space-1);
}
.phone-frame:has(.featured-shell) > .bottom-dock {
  position: relative;
  inset: auto;
  flex: none;
  margin-block-end: var(--dock-bottom-offset);
  margin-inline: max(var(--space-6), env(safe-area-inset-left)) max(var(--space-6), env(safe-area-inset-right));
  padding-block: var(--space-2) 0;
}
#featured-swipe-card > .card-photo-hero {
  height: auto;
  min-height: clamp(88px, 21cqh, 176px);
  display: grid;
}
#featured-swipe-card .card-photo-overlay {
  height: auto;
  gap: var(--space-1);
  padding: var(--space-2);
}
#featured-swipe-card .card-photo-title-row .featured-court-title {
  min-width: 0;
  font-size: var(--text-h2);
  overflow-wrap: anywhere;
}
#featured-swipe-card .card-photo-title-row > .photo-pill-dark {
  max-width: 44%;
  padding-inline: var(--space-1);
  overflow-wrap: anywhere;
}

@container featured-frame (max-height: 660px) {
  .phone-frame > .bottom-dock :is(#nav-profile.has-dock-portrait, #btn-tennis-hub) { width: 56px; height: 56px; }
  .bottom-dock #dock-ball-viewer { max-width: 100%; max-height: 100%; }
  .gesture-demo .gesture-traveler { display: none; }
  .gesture-demo .gesture-hint { animation: none; opacity: 1; }
  #featured-swipe-card .card-photo-title-row .featured-court-title { font-size: var(--text-h3); }
}

@container featured-frame (max-height: 680px) {
  #featured-swipe-card .card-photo-overlay { padding-block: var(--space-1); }
  #featured-swipe-card .card-photo-title-row { padding-block: var(--space-1); }
  #featured-swipe-card .card-photo-title-row > .photo-pill-dark { padding-block: 0; }
  .gesture-demo { min-height: 22px; }
  .gesture-hint { padding: 2px var(--space-1); }
  .featured-capacity { padding-block: var(--space-1); }
  .featured-capacity-value { font-size: var(--text-h2); }
  #featured-swipe-card .featured-time-row { padding-block: var(--space-1); }
  #featured-swipe-card .featured-hero-time { font-size: 1.5rem; }
  .match-notice-fields { grid-template-columns: auto minmax(0, 1fr); }
  .match-notice-field {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr);
    grid-template-columns: subgrid;
    align-items: baseline;
    gap: var(--space-2);
    padding-inline: 0;
  }
  .match-notice-field--entry, .match-notice-field--review { border-inline-start: 0; }
  .match-notice-note { display: inline; }
}

@container featured-frame (max-height: 560px) {
  .phone-frame > .bottom-dock :is(#nav-profile.has-dock-portrait, #btn-tennis-hub) { width: 50px; height: 50px; }
  .featured-shell { gap: var(--space-1); }
  #featured-swipe-card > .card-photo-hero { min-height: clamp(88px, 20cqh, 108px); }
  #featured-swipe-card .featured-hero-body { padding-bottom: var(--space-2); }
}

@container featured-frame (max-height: 510px) {
  .phone-frame:has(.featured-shell) > .app-topbar {
    min-height: calc(36px + var(--featured-safe-top, env(safe-area-inset-top)));
    padding-block: calc(2px + var(--featured-safe-top, env(safe-area-inset-top))) 2px;
  }
  #featured-swipe-card > .card-photo-hero { min-height: 88px; }
  .match-notice-field { padding-block: 2px; }
  .match-notice-field--fee { padding-block-end: 0; }
  #featured-swipe-card .featured-date-range { font-size: .75rem; }
  .match-notice-note { display: none; }
}

@container featured-frame (max-width: 340px) and (max-height: 610px) {
  #featured-swipe-card > .card-photo-hero { min-height: clamp(88px, 16cqh, 104px); }
  #featured-swipe-card .card-photo-top { gap: var(--space-1); }
  #featured-swipe-card .card-photo-top > span { padding-inline: var(--space-1); font-size: 0.78rem; }
  #featured-swipe-card .card-photo-top .photo-pill-dark > svg { display: none; }
  #featured-swipe-card .featured-hero-body { padding-inline: var(--space-3); }
  .featured-capacity { margin-inline: calc(-1 * var(--space-3)); padding-inline: var(--space-3); }
}

@container featured-frame (max-width: 340px) and (max-height: 510px) {
  #featured-swipe-card .featured-time-row { column-gap: var(--space-1); }
  #featured-swipe-card .featured-hero-time { font-size: 1.375rem; }
}


/* ==========================================================================
   Universal Design Award 2026 Layer（慢伴拍・網球咖 通用設計升級模組）
   對齊七原則：友善大字級 120%、減少動態、手勢＋大按鈕雙軌、場域友善與無障礙資訊
   ========================================================================== */

/* 1. 友善大字級模式（高齡、老花與戶外強光易讀） */
html[data-font-scale="large"] {
  --text-hero-time: 3.15rem;
  --text-large-title: 2.15rem;
  --text-display: 1.75rem;
  --text-h2: 1.45rem;
  --text-h3: 1.22rem;
  --text-body: 1.125rem;   /* 18px 正文 */
  --text-sub: 1.03rem;     /* 16.5px 說明 */
  --text-cap: 0.94rem;     /* 15px 輔助標 */
  --touch-target: 48px;
}

html[data-font-scale="large"] body,
html[data-font-scale="large"] .phone-frame {
  font-size: var(--text-body);
  line-height: 1.5;
}

html[data-font-scale="large"] .btn,
html[data-font-scale="large"] .segmented-option,
html[data-font-scale="large"] .map-filter-pill,
html[data-font-scale="large"] .featured-filter-pill,
html[data-font-scale="large"] .explore-single-btn {
  min-height: 48px;
  font-size: 1rem;
}

html[data-font-scale="large"] .badge,
html[data-font-scale="large"] .meta-text,
html[data-font-scale="large"] .caption-text,
html[data-font-scale="large"] .match-notice-label,
html[data-font-scale="large"] .match-notice-value,
html[data-font-scale="large"] .setting-row {
  font-size: 0.96rem;
  line-height: 1.45;
}

html[data-font-scale="large"] .featured-hero-card .card-photo-hero,
html[data-font-scale="large"] #featured-swipe-card > .card-photo-hero {
  height: 132px;
  min-height: 120px;
}

html[data-font-scale="large"] .featured-hero-time {
  font-size: 2.35rem;
}

/* 2. 手動一鍵「減少動畫」覆寫（保護暈眩敏感與高齡使用者，不須找系統深層設定） */
html[data-reduced-motion="on"] *,
html[data-reduced-motion="on"] *::before,
html[data-reduced-motion="on"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* 3. 頂欄右側「Aa 大字」微快控按鈕（44px 安全熱區、不破壞品牌留白） */
.ud-topbar-font-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 40px;
  padding: 0 11px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(246, 242, 234, 0.34);
  background: rgba(13, 31, 23, 0.56);
  color: #F6F2EA;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.ud-topbar-font-btn[aria-pressed="true"] {
  background: #E2F03B;
  color: #0D1F17;
  border-color: #0D1F17;
  box-shadow: 0 2px 10px rgba(226, 240, 59, 0.32);
}

.ud-topbar-font-btn:focus-visible {
  outline: 2px solid #E2F03B;
  outline-offset: 2px;
}

/* 4. 精選配對「手勢＋大按鈕雙軌操作列」（原則二：使用彈性 + 原則三：簡單直覺） */
#featured-swipe-card > .card-photo-hero {
  height: 152px;
}

#featured-swipe-card .featured-hero-body {
  padding: 12px 14px 12px;
  gap: 8px;
}

.ud-dual-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr);
  gap: 10px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--border-hairline);
}

.ud-dual-btn-next {
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1.5px solid var(--border-strong, rgba(22, 58, 42, 0.28));
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-body);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.ud-dual-btn-next:hover,
.ud-dual-btn-next:active {
  background: var(--accent-tint);
}

.ud-dual-btn-join {
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  border: 1.5px solid transparent;
  background: var(--accent-solid);
  color: var(--text-on-accent);
  font-size: var(--text-body);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 31, 23, 0.16);
}

html[data-theme="club-night"] .ud-dual-btn-join,
html[data-theme="rooftop-twilight"] .ud-dual-btn-join {
  background: #E2F03B;
  color: #0D1F17;
}

.ud-dual-hint {
  margin: 2px 0 0;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-muted);
}

/* 5. 歡迎頁零門檻體驗主鍵與快速友善控制（固定深色底面板高對比配對） */
.ud-ob-quick-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ud-ob-font-pill {
  min-height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(246, 242, 234, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #F6F2EA;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ud-ob-font-pill[aria-pressed="true"] {
  background: #E2F03B;
  color: #0D1F17;
  border-color: #E2F03B;
}

.ud-ob-guest-btn {
  min-height: 50px;
  width: 100%;
  border-radius: var(--radius-control);
  background: #E2F03B;
  color: #0D1F17;
  font-size: var(--text-body);
  font-weight: 900;
  letter-spacing: 0.02em;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.ud-ob-quiz-link {
  min-height: 46px;
  width: 100%;
  border-radius: var(--radius-control);
  border: 1.5px solid rgba(246, 242, 234, 0.48);
  background: rgba(246, 242, 234, 0.08);
  color: #F6F2EA;
  font-size: var(--text-sub);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ud-ob-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  color: rgba(246, 242, 234, 0.72);
  font-size: 12.5px;
}
.ud-ob-divider::before,
.ud-ob-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(246, 242, 234, 0.22);
}

.ud-ob-oauth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ud-ob-oauth-row .ob-welcome-provider {
  min-height: 44px;
  padding: 0 10px;
  font-size: 13.5px;
}

/* 6. 設定頁通用設計群組標題 */
.ud-settings-group-title {
  margin: 0 0 8px 4px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-on-canvas);
  opacity: 0.92;
}

.ud-settings-font-row {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ud-settings-row-desc {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* 8. WCAG 2.2 AA 鍵盤跳轉與高可見焦點框（2.4.1 / 2.4.7 / 1.4.3 對比強化） */
.ud-skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: #0D1F17;
  color: #E2F03B;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid #E2F03B;
}
.ud-skip-link:focus {
  top: 12px;
}

.phone-frame :is(button, a, input, select, textarea, [tabindex="0"]):focus-visible {
  outline: 2.5px solid #E2F03B !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(13, 31, 23, 0.72) !important;
}

/* 強化次要文字在淺色卡片上的 WCAG AA 對比度（>= 5.2:1） */
html[data-theme="club-classic"] {
  --text-muted: #425B4F;
}
html[data-theme="aus-blue"] {
  --text-muted: #3A5A78;
}
html[data-theme="club-night"] {
  --text-muted: #AEC4B9;
}
html[data-theme="rooftop-twilight"] {
  --text-muted: #5B3F2E;
}

/* ==========================================================================
   2026 三好 AI 創新應用競賽 — 好球好話・網球咖 Edge AI 元件樣式
   遵循 8pt 網格、>=44px 觸控熱區、建築微圓角 (4/8/12px)、高對比卡底濃 (>=92%)
   ========================================================================== */
.scenario-chip.is-goodai-highlight {
  background: #163A2A;
  color: #F6F2EA;
  border-color: #E2F03B;
  font-weight: 700;
}

.goodai-card {
  border: 1.5px solid rgba(22, 58, 42, 0.28);
  background: rgba(249, 247, 241, 0.96);
  box-shadow: 0 8px 22px rgba(9, 22, 16, 0.08);
}

[data-theme="club-night"] .goodai-card,
[data-theme="rooftop-twilight"] .goodai-card {
  background: rgba(18, 36, 28, 0.94);
  border-color: rgba(226, 240, 59, 0.36);
}

.goodai-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.goodai-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #163A2A;
  background: rgba(226, 240, 59, 0.45);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

[data-theme="club-night"] .goodai-eyebrow,
[data-theme="rooftop-twilight"] .goodai-eyebrow {
  color: #0D1F17;
  background: #E2F03B;
}

.goodai-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--text-primary);
}

.goodai-model-pill {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  background: #163A2A;
  color: #E2F03B;
  white-space: nowrap;
}

.goodai-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.goodai-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.goodai-preset-chip {
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(22, 58, 42, 0.25);
  background: var(--surface-card, #fff);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.goodai-preset-chip:hover,
.goodai-preset-chip:focus-visible {
  border-color: #163A2A;
  background: rgba(226, 240, 59, 0.24);
}

.goodai-textarea {
  min-height: 84px;
  font-size: 14px;
  line-height: 1.5;
}

.goodai-run-btn {
  width: 100%;
  min-height: 48px;
  font-weight: 800;
  background: #163A2A;
  color: #F6F2EA;
  border-color: #163A2A;
}

[data-theme="club-night"] .goodai-run-btn,
[data-theme="rooftop-twilight"] .goodai-run-btn {
  background: #E2F03B;
  color: #0D1F17;
  border-color: #E2F03B;
}

.goodai-status {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.goodai-result-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(22, 58, 42, 0.16);
}

.goodai-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.goodai-live-tag {
  font-size: 12px;
  font-weight: 700;
  color: #163A2A;
  opacity: 0.85;
}

[data-theme="club-night"] .goodai-live-tag,
[data-theme="rooftop-twilight"] .goodai-live-tag {
  color: #E2F03B;
}

.goodai-spirit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.goodai-spirit-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(22, 58, 42, 0.12);
  color: var(--text-primary);
}

[data-theme="club-night"] .goodai-spirit-pill,
[data-theme="rooftop-twilight"] .goodai-spirit-pill {
  background: rgba(226, 240, 59, 0.22);
  color: #F6F2EA;
}

.goodai-mini-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.goodai-boost-banner {
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 4px solid #E2F03B;
  background: rgba(22, 58, 42, 0.08);
}

.goodai-boost-banner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--text-primary);
}

.goodai-parsed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.goodai-kv {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-muted, rgba(22, 58, 42, 0.05));
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.goodai-kv span {
  font-size: 12px;
  color: var(--text-secondary);
}

.goodai-kv strong {
  font-size: 14px;
  color: var(--text-primary);
}

.goodai-kv small {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.goodai-invite-preview {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(22, 58, 42, 0.18);
  background: var(--surface-card, #fff);
}

.goodai-invite-preview strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.goodai-invite-preview p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-primary);
}

.goodai-court-reason {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.goodai-court-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.goodai-court-item {
  width: 100%;
  min-height: 48px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(22, 58, 42, 0.2);
  background: var(--surface-card, #fff);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.goodai-court-item.is-picked {
  border-color: #163A2A;
  background: rgba(226, 240, 59, 0.26);
}

[data-theme="club-night"] .goodai-court-item.is-picked,
[data-theme="rooftop-twilight"] .goodai-court-item.is-picked {
  border-color: #E2F03B;
  background: rgba(226, 240, 59, 0.18);
}

.goodai-court-name {
  font-size: 14px;
  font-weight: 700;
}

.goodai-court-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.goodai-apply-btn {
  min-height: 48px;
  font-weight: 800;
  border: 2px solid #163A2A;
}

/* 賽後說好話 AI 讚許區塊 */
.goodai-praise-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(22, 58, 42, 0.22);
  background: rgba(22, 58, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.goodai-praise-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.goodai-praise-btn {
  min-height: 46px;
  font-weight: 700;
}

.goodai-praise-output {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-card, #fff);
  border-left: 4px solid #E2F03B;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goodai-praise-msg {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text-primary);
}

.goodai-praise-quote {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.goodai-copy-btn {
  align-self: flex-start;
  min-height: 40px;
}

.goodai-result-praise-card {
  margin-top: 8px;
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid #E2F03B;
  background: rgba(22, 58, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goodai-result-praise-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
}

/* AI 2.5D 隱私守護立繪工作坊 */
.goodai-studio {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goodai-studio-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(155deg, #163A2A 0%, #0D1F17 100%);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goodai-studio-preview.has-image img {
  width: 100%;
  max-height: 310px;
  object-fit: cover;
  display: block;
}

.goodai-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  color: #F6F2EA;
  font-size: 13px;
}

.goodai-preview-placeholder img {
  height: 156px;
  width: auto;
  object-fit: contain;
}

.goodai-preview-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(13, 31, 23, 0.88);
  color: #E2F03B !important;
  padding: 4px 8px;
  border-radius: 4px;
}

.goodai-studio-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.goodai-studio-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* AI 架構與三好四給對照總覽 */
.goodai-overview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goodai-health-row {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(22, 58, 42, 0.1);
  color: var(--text-primary);
}

.goodai-health-row.is-ok {
  background: #163A2A;
  color: #E2F03B;
}

.goodai-matrix {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goodai-matrix-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(22, 58, 42, 0.16);
  background: var(--surface-card, #fff);
}

.goodai-matrix-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
  color: var(--text-primary);
}

.goodai-matrix-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.goodai-tech-block {
  padding: 12px;
  border-radius: 8px;
  background: rgba(22, 58, 42, 0.06);
}

.goodai-tech-block ul {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-primary);
}

.goodai-tech-block li + li {
  margin-top: 6px;
}
