/* سلطنت 0.3.69 — سیستم رابط مشترک «بازی کارتی سلطنتی لوکس» */
:root {
  --royal-green: #073B2A;
  --royal-green-deep: #03261b;
  --royal-green-black: #01150f;
  --royal-gold: #D4AF37;
  --royal-gold-light: #ead17a;
  --royal-gold-dark: #96731e;
  --royal-charcoal: #0B0B0B;
  --royal-cream: #F8EFD8;
  --royal-red: #9B1C31;
  --royal-muted: #afc1b9;
  --royal-line: rgba(212, 175, 55, .3);
  --royal-line-soft: rgba(212, 175, 55, .16);
  --royal-glass: rgba(3, 31, 23, .86);
  --royal-glass-strong: rgba(2, 22, 16, .94);
  --royal-shadow: 0 18px 48px rgba(0, 0, 0, .38);
  --royal-shadow-soft: 0 10px 26px rgba(0, 0, 0, .25);
  --royal-inset: inset 0 1px 0 rgba(255,255,255,.04), inset 0 0 0 1px rgba(212,175,55,.035);
  --royal-radius: 18px;
  --bg: var(--royal-green-black);
  --felt: var(--royal-green);
  --felt2: var(--royal-green-deep);
  --felt-deep: var(--royal-green-deep);
  --gold: var(--royal-gold);
  --gold2: var(--royal-gold-dark);
  --gold-bright: var(--royal-gold-light);
  --cream: var(--royal-cream);
  --muted: var(--royal-muted);
  --red: var(--royal-red);
  --panel: var(--royal-glass);
  --line: var(--royal-line);
  --border: var(--royal-line);
  --shadow: var(--royal-shadow);
}

html { color-scheme: dark; }
body {
  color: var(--royal-cream);
  background:
    radial-gradient(circle at 50% -12%, rgba(28, 106, 77, .24), transparent 40%),
    radial-gradient(circle at 0 100%, rgba(212, 175, 55, .055), transparent 33%),
    linear-gradient(155deg, #010806, #06271d 58%, #010907);
}

.ui-icon, .icon {
  display: inline-block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.16em;
}
[data-ui-icon], [data-static-icon] { color: var(--royal-gold-light); }

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:not(.playing-card), a[class] {
  transition: transform 180ms ease, filter 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, opacity 180ms ease;
}
@media (hover:hover) and (pointer:fine) {
  button:not(.playing-card):not(:disabled):hover, a[class]:hover {
    filter: brightness(1.07);
  }
  :where(.primary,.primary-button,.entry-auth-submit,.home-online,.action-button,.new-game-button,a.primary):not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 13px 27px rgba(0,0,0,.34), 0 0 0 1px rgba(234,209,122,.15), inset 0 1px 0 rgba(255,255,255,.18);
  }
  :where(.ghost,.secondary-button,.icon-btn,.icon-button,.menu-action,.home-start,.home-rules,.home-install,.profile-pill,.home-profile-entry,.home-settings,.match-mode,.lobby-tool-btn,.friend-action-card button):not(:disabled):hover {
    transform: translateY(-1px);
    border-color: rgba(234, 209, 122, .48) !important;
    background-color: rgba(212,175,55,.09) !important;
  }
}
button:not(.playing-card):not(:disabled):active, a[class]:active {
  transform: translateY(1px) scale(.985) !important;
  transition-duration: 90ms;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--royal-gold-light) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(212,175,55,.16) !important;
}
button:disabled, button[aria-disabled="true"], .disabled {
  opacity: .42 !important;
  filter: grayscale(.35) saturate(.55) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}
[aria-busy="true"], .loading {
  cursor: progress !important;
  opacity: .78;
}

:where(.primary,.primary-button,.entry-auth-submit,.home-online,.action-button,.new-game-button,a.primary,.ranking-tabs button.active,.private-score-btn.active,.segmented-control button.active) {
  color: #171207 !important;
  border-color: var(--royal-gold-light) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.14), transparent 42%),
    linear-gradient(135deg, #e0c15a 0%, var(--royal-gold) 48%, #b78f29 100%) !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.29), inset 0 1px 0 rgba(255,255,255,.25), inset 0 -1px 0 rgba(74,49,4,.18) !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.18);
}
:where(.primary,.primary-button,.entry-auth-submit,.home-online,.action-button,.new-game-button,a.primary) .icon,
:where(.primary,.primary-button,.entry-auth-submit,.home-online,.action-button,.new-game-button,a.primary) .ui-icon { color: #201706; }

:where(.ghost,.secondary-button,.icon-btn,.icon-button,.menu-action,.home-start,.home-rules,.home-install,.profile-pill,.home-profile-entry,.home-settings,.profile-back-button,.offline-stop-btn,.offline-history-btn,.network-retry,.tab,.entry-auth-tab,.private-score-btn,.ranking-tabs button,.quick-chat-grid button,.chat-settings-row button) {
  color: var(--royal-cream) !important;
  border-color: rgba(212,175,55,.25) !important;
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(0,0,0,.12)) !important;
  box-shadow: var(--royal-inset), 0 7px 18px rgba(0,0,0,.16);
}
:where(.danger,.danger-action,.profile-page-action.danger) {
  color: #ffe9e9 !important;
  border-color: rgba(155,28,49,.65) !important;
  background: linear-gradient(145deg, rgba(155,28,49,.36), rgba(58,5,14,.65)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 8px 20px rgba(0,0,0,.2) !important;
}

:where(.panel,.entry-auth-card,.home-card,.profile-page-card,.profile-panel,.profile-card,.match-card,.friend-action-card,.dialog-card,.modal-card,.pause-card,.resume-card,.offline-settings-card,.last-trick-card,.score-history-card,.result-card,.box,.page) {
  border-color: var(--royal-line) !important;
  background-color: var(--royal-glass-strong) !important;
  background-image:
    radial-gradient(circle at 50% 0, rgba(24,96,69,.18), transparent 38%),
    linear-gradient(155deg, rgba(7,59,42,.9), rgba(2,26,19,.94)) !important;
  box-shadow: var(--royal-shadow), var(--royal-inset) !important;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :where(.panel,.entry-auth-card,.home-card,.profile-page-card,.profile-panel,.profile-card,.match-card,.friend-action-card,.dialog-card,.modal-card,.pause-card,.resume-card,.offline-settings-card,.last-trick-card,.score-history-card,.result-card,.topbar,.top,.round-panel,.trick-score,.choice-panel,.player-badge,.player-info) {
    background-color: rgba(3,31,23,.78) !important;
    -webkit-backdrop-filter: blur(13px) saturate(112%);
    backdrop-filter: blur(13px) saturate(112%);
  }
  :where(.ghost,.secondary-button,.icon-btn,.icon-button,.menu-action,.home-start,.home-rules,.home-install,.profile-pill,.home-profile-entry,.home-settings,.profile-back-button,.offline-stop-btn,.offline-history-btn,.network-retry,.tab,.entry-auth-tab,.private-score-btn,.ranking-tabs button,.quick-chat-grid button,.chat-settings-row button) {
    background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(0,0,0,.18)) !important;
    -webkit-backdrop-filter: blur(10px) saturate(110%);
    backdrop-filter: blur(10px) saturate(110%);
  }
}

:where(.panel,.entry-auth-card,.home-card,.profile-page-card,.profile-panel,.profile-card,.match-card,.friend-action-card,.dialog-card,.modal-card,.pause-card,.resume-card,.offline-settings-card,.last-trick-card,.score-history-card,.result-card) h1,
:where(.panel,.entry-auth-card,.home-card,.profile-page-card,.profile-panel,.profile-card,.match-card,.friend-action-card,.dialog-card,.modal-card,.pause-card,.resume-card,.offline-settings-card,.last-trick-card,.score-history-card,.result-card) h2,
:where(.panel,.entry-auth-card,.home-card,.profile-page-card,.profile-panel,.profile-card,.match-card,.friend-action-card,.dialog-card,.modal-card,.pause-card,.resume-card,.offline-settings-card,.last-trick-card,.score-history-card,.result-card) h3 { color: var(--royal-cream); }
:where(.panel,.entry-auth-card,.home-card,.profile-page-card,.profile-panel,.profile-card,.match-card,.friend-action-card,.dialog-card,.modal-card,.pause-card,.resume-card,.offline-settings-card,.last-trick-card,.score-history-card,.result-card) p,
:where(.panel,.entry-auth-card,.home-card,.profile-page-card,.profile-panel,.profile-card,.match-card,.friend-action-card,.dialog-card,.modal-card,.pause-card,.resume-card,.offline-settings-card,.last-trick-card,.score-history-card,.result-card) small { color: var(--royal-muted); }

input, textarea, select {
  color: var(--royal-cream) !important;
  caret-color: var(--royal-gold-light);
  border-color: rgba(212,175,55,.25) !important;
  background: rgba(0,11,8,.5) !important;
  box-shadow: inset 0 1px 8px rgba(0,0,0,.24), inset 0 0 0 1px rgba(255,255,255,.02);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
input::placeholder, textarea::placeholder { color: rgba(248,239,216,.46); }
input:focus, textarea:focus, select:focus {
  border-color: var(--royal-gold-light) !important;
  background: rgba(0,16,11,.72) !important;
  box-shadow: 0 0 0 3px rgba(212,175,55,.12), inset 0 1px 8px rgba(0,0,0,.22) !important;
}

:where(.tabs,.entry-auth-tabs,.segmented-control,.ranking-tabs,.private-score-picker) {
  padding: 4px;
  border: 1px solid var(--royal-line-soft);
  border-radius: 15px;
  background: rgba(0,0,0,.18);
  box-shadow: inset 0 1px 8px rgba(0,0,0,.18);
}
:where(.tab.active,.entry-auth-tab.active,.segmented-control button.active,.private-score-btn.active,.ranking-tabs button.active) { font-weight: 900; }

:where(dialog.modal,dialog.dialog,dialog.pause-dialog,dialog.resume-dialog,dialog.offline-settings-dialog,dialog.last-trick-dialog,.card-settings-dialog)::backdrop {
  background: rgba(0, 8, 6, .78) !important;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :where(dialog.modal,dialog.dialog,dialog.pause-dialog,dialog.resume-dialog,dialog.offline-settings-dialog,dialog.last-trick-dialog,.card-settings-dialog)::backdrop {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}
:where(.modal-heading,.menu-heading,.history-heading,.friend-action-head,.match-heading,.profile-section-title,.card-settings-brand) > :first-child:not(div) {
  color: var(--royal-gold-light) !important;
}
:where(.modal-icon,.found-check,.result-crown,.status-icon,.ui-section-emblem,.profile-heading-icon,.profile-stat-icon,.profile-item-icon,.mode-icon,.icon-wrap) {
  color: #201706 !important;
  border-color: var(--royal-gold-light) !important;
  background: linear-gradient(145deg, #dfc25e, #ad8428) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 9px 21px rgba(0,0,0,.25) !important;
}

/* صفحه اصلی و ورود */
.entry-auth-screen, .home-screen, .profile-screen { background-color: transparent !important; }
.entry-auth-card { border-radius: 28px !important; }
.entry-auth-title, .home-action-copy strong { letter-spacing: -.15px; }
.home-online { border-width: 1px !important; }
.home-start { border-color: rgba(212,175,55,.34) !important; }
.home-secondary-actions button { min-height: 48px; }
.home-top-actions button { border-color: rgba(212,175,55,.26) !important; }
.home-suit { border-color: rgba(212,175,55,.18) !important; background: rgba(0,0,0,.16) !important; box-shadow: var(--royal-inset); }
.home-suit small { color: var(--royal-gold-light) !important; }

/* پروفایل */
.profile-overview { border-color: var(--royal-line-soft) !important; background: linear-gradient(145deg, rgba(212,175,55,.075), rgba(0,0,0,.12)) !important; }
.profile-page-stat, .profile-mode-card, .profile-mission, .profile-achievement, .profile-detail-row {
  border-color: rgba(212,175,55,.18) !important;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(0,0,0,.11)) !important;
  box-shadow: var(--royal-inset);
}
.profile-page-stat.featured { border-color: rgba(212,175,55,.44) !important; }
.profile-xp-track, .profile-mini-track { background: rgba(0,0,0,.3) !important; }
.profile-xp-track i, .profile-mini-track i { background: linear-gradient(90deg, var(--royal-gold-dark), var(--royal-gold-light)) !important; }
.profile-frame-btn.active { border-color: var(--royal-gold-light) !important; box-shadow: 0 0 0 2px rgba(212,175,55,.12), var(--royal-inset) !important; }

/* لابی و منوهای آنلاین */
.shell:not(.game-active) > .top, .topbar {
  border-color: var(--royal-line) !important;
  background: linear-gradient(155deg, rgba(7,59,42,.88), rgba(2,25,18,.94)) !important;
  box-shadow: var(--royal-shadow-soft), var(--royal-inset) !important;
}
.lobby-hero, .network-banner, .private-room-panel, .chat-settings-row {
  border-color: var(--royal-line-soft) !important;
  background: linear-gradient(145deg, rgba(212,175,55,.065), rgba(0,0,0,.13)) !important;
  box-shadow: var(--royal-inset);
}
.lobby-badge, .match-target-badge, .trump-pill, .history-multiplier, .round-ribbon {
  color: #211705 !important;
  border-color: var(--royal-gold-light) !important;
  background: linear-gradient(135deg, var(--royal-gold-light), var(--royal-gold-dark)) !important;
}
.match-mode, .lobby-tool-btn, .friend-action-card {
  border-color: rgba(212,175,55,.22) !important;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(0,0,0,.13)) !important;
  box-shadow: var(--royal-inset), 0 8px 18px rgba(0,0,0,.14);
}
.match-mode.featured { border-color: rgba(212,175,55,.52) !important; }
.match-mode .mode-arrow { color: var(--royal-gold-light) !important; }
.connection { color: var(--royal-muted) !important; }

/* امتیازات و منوی داخل بازی */
.round-panel, .trick-score, .choice-panel, .trump-picker, .table-status, .game-reconnect-banner {
  border-color: var(--royal-line) !important;
  box-shadow: var(--royal-shadow-soft), var(--royal-inset) !important;
}
.royal-scoreboard {
  border-color: var(--royal-line) !important;
  box-shadow: none !important;
}
.score-wing, .score-core, .trump-medallion {
  background-color: rgba(2,24,17,.88) !important;
  border-color: rgba(212,175,55,.23) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
#gameScreen .royal-scoreboard,
#gameScreen .score-wing,
#gameScreen .score-core,
#gameScreen .trump-medallion,
#gameScreen .round-ribbon,
#gameScreen .table-status {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}
.score-wing strong, .trick-score strong { color: var(--royal-gold-light) !important; }
.menu-action { border-radius: 15px !important; }
.menu-action > [data-static-icon], .menu-action > .icon { color: var(--royal-gold-light) !important; }
.quick-chat-bubble { color: #171207 !important; background: linear-gradient(135deg, var(--royal-gold-light), var(--royal-gold)) !important; }

/* بازی آفلاین */
.offline-stop-btn, .offline-history-btn { color: var(--royal-gold-light) !important; }
.setting-group { border-color: var(--royal-line-soft) !important; background: rgba(0,0,0,.13) !important; }
.last-trick-item, .history-row, .found-player, .ranking-row, .stat {
  border-color: rgba(212,175,55,.16) !important;
  background: rgba(255,255,255,.035) !important;
  box-shadow: var(--royal-inset);
}

/* تنظیمات کارت */
.card-settings-dialog { border-color: var(--royal-line) !important; background: transparent !important; box-shadow: var(--royal-shadow) !important; }
.card-settings-shell { background: linear-gradient(155deg, rgba(7,59,42,.98), rgba(2,24,17,.99)) !important; }
.ui-section-emblem { width: 52px; height: 52px; display: grid; place-items: center; flex: none; border: 1px solid var(--royal-gold-light); border-radius: 16px; }
.ui-section-emblem svg { width: 25px; height: 25px; }
.card-theme-option { border-color: rgba(212,175,55,.18) !important; background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(0,0,0,.12)) !important; box-shadow: var(--royal-inset); }
.card-theme-option.selected { border-color: var(--royal-gold-light) !important; box-shadow: 0 0 0 2px rgba(212,175,55,.12), var(--royal-inset) !important; }
.card-theme-option.selected::after { color:#171207 !important; background:linear-gradient(135deg,var(--royal-gold-light),var(--royal-gold-dark)) !important; }

@media (max-width: 600px) {
  :root { --royal-shadow: 0 14px 34px rgba(0,0,0,.34); --royal-shadow-soft: 0 8px 18px rgba(0,0,0,.22); }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :where(.panel,.entry-auth-card,.home-card,.profile-page-card,.profile-panel,.profile-card,.match-card,.friend-action-card,.dialog-card,.modal-card,.pause-card,.resume-card,.offline-settings-card,.last-trick-card,.score-history-card,.result-card,.topbar,.top,.round-panel,.trick-score,.choice-panel,.player-badge,.player-info) {
      -webkit-backdrop-filter: blur(7px) saturate(106%);
      backdrop-filter: blur(7px) saturate(106%);
    }
  }
  button:not(.playing-card), a[class] { transition-duration: 160ms; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* تراز لوگو و متن صفحه ورود در ارتفاع‌های رایج موبایل */
.entry-auth-visual { height: 214px !important; margin: -4px 0 12px !important; }
.entry-auth-logo { width: min(232px, 74%) !important; }
.entry-auth-copy { position: relative; z-index: 2; }
@media (max-height: 720px) {
  .entry-auth-visual { height: 154px !important; margin: -10px 0 5px !important; }
  .entry-auth-logo { width: 188px !important; }
}
.match-mode .mode-arrow {
  color: #171207 !important;
  border: 1px solid var(--royal-gold-light) !important;
  background: linear-gradient(135deg, var(--royal-gold-light), var(--royal-gold-dark)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 5px 12px rgba(0,0,0,.18);
}

/* سلطنت 0.3.70 — بازبینی کنتراست و خوانایی */
:root {
  --royal-text-primary: #F8EFD8;
  --royal-text-secondary: #D4E0DB;
  --royal-text-tertiary: #BDCEC7;
  --royal-text-on-gold: #120E04;
  --royal-text-danger: #FFE2E6;
  --royal-text-success: #A7F0CC;
  --royal-muted: var(--royal-text-secondary);
  --muted: var(--royal-text-secondary);
}

/* متن پایه روی سطوح تیره */
body,
:where(.panel,.entry-auth-card,.home-card,.profile-page-card,.profile-panel,.profile-card,.match-card,.friend-action-card,.dialog-card,.modal-card,.pause-card,.resume-card,.offline-settings-card,.last-trick-card,.score-history-card,.result-card,.topbar,.top,.round-panel,.trick-score,.choice-panel,.player-badge,.player-info) {
  color: var(--royal-text-primary);
}

/* متن‌های توضیحی؛ همه این موارد روی پنل تیره قرار دارند. */
:where(
  .entry-auth-copy p,.entry-auth-field label,.entry-auth-message,
  .home-action-copy small,.home-action-copy p,.home-profile-hint,.home-status,.pwa-status,
  .profile-page-account,.profile-page-type,.profile-page-username,.profile-xp-text,
  .profile-section-subtitle,.profile-mode-card span,.profile-mode-record span,
  .profile-mission small,.profile-achievement small,.profile-detail-row span,
  .mode-copy small,.lobby-copy p,.lobby-subtitle,.friend-action-head p,.friend-action-card p,
  .connection,.network-banner p,.network-banner small,.found-subtitle,.found-loading,
  .private-room-meta small,.private-room-note,.ranking-row small,.ranking-empty,
  .history-heading p,.history-row span,.history-empty,.dialog-card p,
  .pause-card p,.resume-card p,.offline-settings-card p,.last-trick-card p,.score-history-card p,
  .card-settings-brand p,.card-theme-copy p,.card-theme-copy small,.card-settings-note,
  .player-info small,.player-badge small,.profile-copy small,.round-row,.round-panel span,
  .trick-score span,.score-wing span,.score-core small,.choice-panel-head small,
  .choice-btn.secondary-choice small,.table-status,.game-reconnect-banner p,.status-pill,
  .bot-wait-note,.searching p,.match-card p,.profile-row p,.stat span
) {
  color: var(--royal-text-secondary) !important;
  opacity: 1 !important;
  text-shadow: none;
}

/* متن کم‌اهمیت همچنان خوانا، ولی از متن اصلی متمایز است. */
:where(.profile-item-side b,.profile-achievement > b,.profile-mission-meta,.mission-date,.achievement-note,.version,.footer-note) {
  color: var(--royal-text-tertiary) !important;
  opacity: 1 !important;
}

/* تمام سطوح طلایی باید فقط متن زغالی داشته باشند؛ رنگ فرزندها نباید از CSS قدیمی نشت کند. */
:where(
  .primary,.primary-button,.entry-auth-submit,.home-online,.action-button,.new-game-button,a.primary,
  .ranking-tabs button.active,.private-score-btn.active,.segmented-control button.active,
  .tab.active,.entry-auth-tab.active,.choice-btn.primary-choice,
  .match-mode .mode-arrow,.lobby-badge,.match-target-badge,.trump-pill,.history-multiplier,.round-ribbon,
  .quick-chat-bubble,.toast.strong,.modal-icon,.found-check,.result-crown,.status-icon,
  .ui-section-emblem,.profile-heading-icon,.profile-stat-icon,.profile-item-icon.gold,
  .mode-icon,.icon-wrap,.avatar,.profile-page-avatar,.pause-icon,
  .card-theme-option.selected::after
),
:where(
  .primary,.primary-button,.entry-auth-submit,.home-online,.action-button,.new-game-button,a.primary,
  .ranking-tabs button.active,.private-score-btn.active,.segmented-control button.active,
  .tab.active,.entry-auth-tab.active,.choice-btn.primary-choice,
  .match-mode .mode-arrow,.lobby-badge,.match-target-badge,.trump-pill,.history-multiplier,.round-ribbon,
  .quick-chat-bubble,.toast.strong
) :where(span,strong,small,p,b,.icon,.ui-icon,svg) {
  color: var(--royal-text-on-gold) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* دکمه‌های اصلی دارای متن چندخطی */
:where(.home-online,.primary,.primary-button,.entry-auth-submit,.action-button,.new-game-button) :where(.home-action-copy, .home-action-copy strong, .home-action-copy small) {
  color: var(--royal-text-on-gold) !important;
}

/* آیکون طلایی روی دکمه‌های تیره، بدون کم‌رنگ شدن متن کنار آن. */
:where(.ghost,.secondary-button,.icon-btn,.icon-button,.menu-action,.home-start,.home-rules,.home-install,.profile-pill,.home-profile-entry,.home-settings,.profile-back-button,.offline-stop-btn,.offline-history-btn,.network-retry) {
  color: var(--royal-text-primary) !important;
}
:where(.ghost,.secondary-button,.menu-action,.home-start,.home-rules,.home-install,.home-profile-entry,.home-settings) :where(strong,small,p) {
  color: inherit !important;
  opacity: 1 !important;
}
:where(.ghost,.secondary-button,.menu-action,.home-start,.home-rules,.home-install,.home-profile-entry,.home-settings) :where([data-ui-icon],[data-static-icon],.icon,.ui-icon) {
  color: var(--royal-gold-light) !important;
}

/* تب‌های غیرفعال و کنترل‌های انتخابی */
:where(.tab,.entry-auth-tab,.private-score-btn,.ranking-tabs button,.segmented-control button) {
  color: var(--royal-text-secondary) !important;
  opacity: 1 !important;
}
:where(.tab.active,.entry-auth-tab.active,.private-score-btn.active,.ranking-tabs button.active,.segmented-control button.active) {
  color: var(--royal-text-on-gold) !important;
}

/* فیلدها و placeholder در نور کم نیز خوانا بمانند. */
input::placeholder, textarea::placeholder {
  color: #AFC2BA !important;
  opacity: 1 !important;
}
input:disabled, textarea:disabled, select:disabled {
  color: #B7C7C0 !important;
  -webkit-text-fill-color: #B7C7C0 !important;
}

/* وضعیت‌های غیرفعال و درحال‌بارگذاری قابل تشخیص، اما ناخوانا نشوند. */
button:disabled, button[aria-disabled="true"], .disabled {
  opacity: .62 !important;
  filter: grayscale(.12) saturate(.72) !important;
}
[aria-busy="true"], .loading {
  opacity: .88 !important;
}

/* پیام‌های وضعیت و خطا */
:where(.message,.entry-auth-message,.form-message,.error-message,.network-error) {
  color: #FFB9C3 !important;
  opacity: 1 !important;
}
:where(.success-message,.connection.ok,.network-banner.ok) {
  color: var(--royal-text-success) !important;
}
.connection::before { filter: brightness(1.22); }

/* پنل‌های اطلاعاتی نباید متن را زیر گرادیان یا شیشه محو کنند. */
:where(.network-banner,.lobby-hero,.private-room-panel,.chat-settings-row,.profile-overview) {
  background-color: rgba(2, 28, 20, .94) !important;
}

/* کارت‌های آماری و پروفایل */
.profile-page-stat strong,.profile-mode-card strong,.profile-mission strong,.profile-achievement strong,
.profile-detail-row strong,.history-totals strong,.stat strong,.score-wing strong,.trick-score strong {
  color: var(--royal-text-primary) !important;
  text-shadow: none !important;
}
.profile-page-stat.featured strong,.profile-mode-card .rating,.profile-level strong,
.profile-mission.done b,.profile-achievement.done > b {
  color: var(--royal-gold-light) !important;
}

/* برچسب‌های طلایی کوچک */
:where(.profile-role-badge,.profile-rank-badge,.profile-mode-range,.card-theme-badge,.svg-badge) {
  color: var(--royal-gold-light) !important;
  background-color: rgba(0, 18, 13, .82) !important;
  border-color: rgba(234, 209, 122, .42) !important;
}

/* منوی داخل بازی، امتیازها و انتخاب دوبل */
.choice-btn.primary-choice,
.choice-btn.primary-choice :where(strong,small,span) {
  color: var(--royal-text-on-gold) !important;
  opacity: 1 !important;
}
.choice-btn.secondary-choice,
.choice-btn.secondary-choice :where(strong,small,span) {
  color: var(--royal-text-primary) !important;
  opacity: 1 !important;
}

/* سطح سفید کارت انتخاب خال باید متن تیره داشته باشد. */
.suit-button,.suit-button :where(strong,small,span) {
  color: #171717 !important;
  opacity: 1 !important;
}
.suit-button.red,.suit-button.red :where(strong,span) { color: #8E1428 !important; }

/* بهبود خوانایی متن‌های خیلی کوچک بدون تغییر اندازه چیدمان */
:where(.home-action-copy small,.mode-copy small,.profile-copy small,.player-info small,.player-badge small,.connection,.card-theme-copy p,.card-settings-note) {
  font-weight: 500;
}

@media (max-width: 600px) {
  /* روی موبایل blur کمتر و پس‌زمینه تیره‌تر است تا متن از تصویر پشت جدا بماند. */
  :where(.panel,.entry-auth-card,.home-card,.profile-page-card,.profile-panel,.profile-card,.match-card,.friend-action-card,.dialog-card,.modal-card,.pause-card,.resume-card,.offline-settings-card,.last-trick-card,.score-history-card,.result-card,.topbar,.top,.round-panel,.trick-score,.choice-panel,.player-badge,.player-info) {
    background-color: rgba(2, 27, 20, .91) !important;
  }
}



/* سلطنت 0.3.74 — اتصال امتیازها به حکم، قاب میز، تاج حاکم و کنتراست طلایی */
#gameScreen .score-core{
  position:relative!important;
  z-index:5!important;
}
#gameScreen .score-wing{
  position:relative!important;
  z-index:2!important;
  min-width:74px!important;
  overflow:visible!important;
}
#gameScreen .score-wing-left{
  margin-right:-21px!important;
}
#gameScreen .score-wing-right{
  margin-left:-21px!important;
}
#gameScreen .trump-medallion{
  z-index:7!important;
}
#gameScreen .round-ribbon{
  z-index:8!important;
}

#gameScreen .player-avatar-wrap{
  position:relative;
  width:31px;
  height:31px;
  display:grid;
  place-items:center;
  flex:none;
  overflow:visible;
}
#gameScreen .player-avatar-wrap > .avatar{
  width:29px!important;
  height:29px!important;
  box-sizing:border-box!important;
}
#gameScreen .player-info .avatar.frame-bronze{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.24),0 0 0 2px #b87333,0 0 0 3px rgba(64,30,7,.8)!important;
}
#gameScreen .player-info .avatar.frame-silver{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.28),0 0 0 2px #d5dce2,0 0 0 3px rgba(72,83,92,.8)!important;
}
#gameScreen .player-info .avatar.frame-gold{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.3),0 0 0 2px #e3b746,0 0 0 3px rgba(92,59,5,.86)!important;
}
#gameScreen .player-info .avatar.frame-royal{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.32),0 0 0 2px #f0c85d,0 0 0 4px #7c1830,0 0 13px rgba(240,200,93,.62)!important;
}
#gameScreen .hakem-crown-badge{
  position:absolute;
  z-index:6;
  top:-10px;
  right:-7px;
  width:21px;
  height:21px;
  display:grid;
  place-items:center;
  border:1px solid #ffe9a7;
  border-radius:8px 8px 9px 9px;
  color:#171207!important;
  background:linear-gradient(145deg,#f4d77a,#b88322)!important;
  box-shadow:0 4px 9px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.3);
  pointer-events:none;
}
#gameScreen .hakem-crown-badge .icon{
  color:#171207!important;
  width:13px!important;
  height:13px!important;
  stroke-width:2.4;
}
#gameScreen .player-info.is-hakem{
  border-color:rgba(244,215,122,.6)!important;
}

/* هر سطح طلایی، همراه با تمام فرزندان متنی، باید زغالی بماند. */
:where(
  .primary,.primary-button,.entry-auth-submit,.home-online,.action-button,.new-game-button,a.primary,
  .search-btn,.network-retry,.create-private-btn,.join-private-btn,
  .ranking-tabs button.active,.private-score-btn.active,.segmented-control button.active,
  .tab.active,.entry-auth-tab.active,.avatar-option.active,.profile-frame-btn.active,
  .choice-btn.primary-choice,.match-mode .mode-arrow,.lobby-badge,.match-target-badge,
  .history-multiplier,.round-ribbon,.quick-chat-bubble,.toast.strong,.modal-icon,
  .found-check,.result-crown,.status-icon,.ui-section-emblem,.profile-heading-icon,
  .profile-stat-icon,.profile-item-icon.gold,.mode-icon,.icon-wrap,.pause-icon,
  .queue-dot.filled,.match-seat.me,.card-theme-option.selected::after
),
:where(
  .primary,.primary-button,.entry-auth-submit,.home-online,.action-button,.new-game-button,a.primary,
  .search-btn,.network-retry,.create-private-btn,.join-private-btn,
  .ranking-tabs button.active,.private-score-btn.active,.segmented-control button.active,
  .tab.active,.entry-auth-tab.active,.avatar-option.active,.profile-frame-btn.active,
  .choice-btn.primary-choice,.match-mode .mode-arrow,.lobby-badge,.match-target-badge,
  .history-multiplier,.round-ribbon,.quick-chat-bubble,.toast.strong,.modal-icon,
  .found-check,.result-crown,.status-icon,.ui-section-emblem,.profile-heading-icon,
  .profile-stat-icon,.profile-item-icon.gold,.mode-icon,.icon-wrap,.pause-icon,
  .queue-dot.filled,.match-seat.me
) :where(*){
  color:#171207!important;
  text-shadow:none!important;
}
@media(max-width:360px){
  #gameScreen .score-wing-left{margin-right:-18px!important}
  #gameScreen .score-wing-right{margin-left:-18px!important}
  #gameScreen .score-wing{min-width:70px!important}
}


/* سلطنت 0.3.85 — حذف سایه پنل بالای بازی */
#gameScreen .royal-scoreboard { box-shadow: none !important; }


/* Saltanat 0.3.106 — consistent black profile glyphs */
.home-profile-entry>b .ui-icon,.home-top-profile>b .ui-icon,.home-profile-avatar .ui-icon{color:#171005!important;stroke:#171005!important}
