/* Reference UI. Layered important rules supersede legacy ID-specific theme fixes. */
@layer durak-reference {
  :root {
    --reference-page: #000;
    --reference-card: #0e0f13;
    --reference-text: #f5f5f7;
    --reference-muted: #85868f;
    --reference-gold: #f0bc53;
    --reference-line: rgba(255,255,255,.06);
    --reference-win: #50df83;
    --reference-loss: #f16a74;
    --reference-draw: #e8b954;
  }
  :root[data-game-theme="light"] {
    color-scheme: light !important;
    --reference-page: #f5f6f8;
    --reference-card: #fff;
    --reference-text: #191c22;
    --reference-muted: #626975;
    --reference-gold: #956719;
    --reference-line: #e2e5ea;
    --reference-win: #177844;
    --reference-loss: #b92d40;
    --reference-draw: #8b620d;
    --game-bg: #f5f6f8 !important;
    --game-panel: #fff !important;
    --game-panel-solid: #fff !important;
    --game-glass: #fff !important;
    --game-glass-strong: #fff !important;
    --game-theme-image: none !important;
    --game-text: #191c22 !important;
    --game-muted: #626975 !important;
    --game-border: #e2e5ea !important;
    --game-shadow: rgba(30,40,55,.08) !important;
    --game-primary: #176be5 !important;
    --game-primary-text: #fff !important;
    --game-accent: #176be5 !important;
    --game-accent-text: #fff !important;
    --bg-deep: #f5f6f8 !important;
    --panel: #fff !important;
    --panel-strong: #fff !important;
    --text: #191c22 !important;
    --muted: #626975 !important;
    --line: #e2e5ea !important;
    --gold: #956719 !important;
    --green: #177844 !important;
    --red: #b92d40 !important;
    --shadow: 0 5px 20px rgba(30,40,55,.07) !important;
  }
  /* Rating geometry follows the supplied 2-1-3 reference, without chevrons. */
  #profileModal:has(.profile-card--rating),
  #profileModal .profile-card--rating,
  #profileModal .profile-card--rating .profile-card__scroll {
    background: var(--reference-page) !important;
    color: var(--reference-text) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  #profileModal .profile-card--rating .profile-card__scroll {
    width: min(100%, 620px) !important;
    container-type: inline-size;
    padding: max(12px, var(--durak-safe-top,0px)) 15px calc(96px + var(--durak-safe-bottom,0px)) !important;
    overflow-x: hidden !important;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif !important;
  }
  .profile-card--rating .profile-rating-sticky {
    background: var(--reference-page) !important;
    padding: 0 0 8px !important; margin:0 !important; width:100% !important;
    box-shadow: none !important;
    border: 0 !important;
  }
  .profile-card--rating .profile-rating-sticky::before { background:var(--reference-page) !important; }
  .profile-card--rating .profile-rating-toolbar {
    min-height: 42px !important; margin: 0 0 12px !important;
    background: transparent !important; border: 0 !important;
  }
  .profile-card--rating .profile-rating-title {
    color: var(--reference-text) !important;
    font-size: 22px !important; font-weight: 700 !important;
    letter-spacing: -.025em !important;
  }
  .profile-card--rating .profile-rating-title b {
    display: inline-grid !important; width: 27px !important; height: 27px !important;
    min-width: 27px !important; margin-left: 6px !important;
    font: 700 17px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important;
    border: 0 !important; border-radius: 50% !important;
    background: var(--reference-card) !important; color: var(--reference-text) !important;
  }
  .profile-card--rating .profile-rating-tabs {
    display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important;
    width: 100% !important; min-height: 40px !important;
    padding: 0 !important; margin: 0 !important;
    border: 0 !important; border-radius: 0 !important;
    background: transparent !important; box-shadow: none !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  }
  .profile-card--rating .profile-rating-tabs button {
    min-height: 40px !important; padding: 6px 10px !important;
    border: 1px solid transparent !important; border-radius: 13px !important;
    background: transparent !important; color: var(--reference-muted) !important;
    font-size: 14px !important; font-weight: 650 !important;
    box-shadow: none !important;
  }
  .profile-card--rating .profile-rating-tabs button.is-active {
    background: #24252a !important; color: #f5f5f7 !important;
    border-color: #3c3d43 !important; box-shadow: inset 0 1px 1px rgba(255,255,255,.04) !important;
  }
  :root[data-game-theme="light"] .profile-card--rating .profile-rating-tabs button.is-active {
    color: var(--reference-text) !important; background: #fff !important;
    border-color: #d9dee6 !important; box-shadow: 0 2px 6px rgba(25,35,50,.05) !important;
  }
  .profile-card--rating .profile-leaderboard {
    border: 0 !important; background: transparent !important;
    padding: 0 !important; margin: 8px 0 0 !important;
  }
  .profile-rating-podium {
    display: grid !important; grid-template-columns: 252fr 282fr 252fr !important;
    align-items: end !important; gap: clamp(8px,2.4cqw,12px) !important;
    margin: 0 0 10px !important; width: 100% !important;
  }
  .profile-rating-podium__card,
  .profile-rating-podium__card.is-place-1,
  .profile-rating-podium__card.is-place-2,
  .profile-rating-podium__card.is-place-3 {
    position: relative !important; display: flex !important; flex-direction: column !important;
    align-items: center !important; justify-content: flex-start !important;
    min-width: 0 !important; width: 100% !important;
    height: clamp(172px,50.6cqw,268px) !important; min-height: 0 !important;
    padding: 5px 7px 8px !important; gap: 0 !important;
    border: 1px solid var(--reference-line) !important; border-radius: 16px !important;
    background: var(--reference-card) !important; color: var(--reference-text) !important;
    box-shadow: inset 0 0 0 3px rgba(255,255,255,.015) !important;
    overflow: visible !important;
  }
  .profile-rating-podium__card.is-place-1 {
    height: clamp(200px,56.1cqw,298px) !important;
    border-color: rgba(201,152,59,.58) !important;
    background: linear-gradient(150deg,#171612,#101113 65%) !important;
    box-shadow: inset 0 0 12px rgba(229,176,73,.16), 0 0 2px rgba(229,176,73,.25) !important;
  }
  .profile-rating-podium__card.is-place-2 { box-shadow:inset 0 0 0 3px rgba(142,159,185,.025) !important; }
  .profile-rating-podium__card.is-place-3 { border-color:rgba(169,109,57,.16) !important; }
  .profile-rating-podium__card::before { content:none !important; display:none !important; }
  .profile-rating-podium__visual {
    position: static !important; display: flex !important; flex-direction: column !important;
    align-items: center !important; width: 100% !important;
    padding: 0 !important; margin: 0 0 7px !important; gap: clamp(7px,2.1cqw,12px) !important;
    flex: 0 0 auto !important;
  }
  .profile-rating-podium__medal-slot {
    display: flex !important; align-items:center !important; justify-content:center !important;
    width:100% !important; height:clamp(30px,8.7cqw,46px) !important;
    flex:0 0 auto !important; margin:0 !important; padding:0 !important;
  }
  .profile-rating-podium__medal-slot .profile-rating-podium__medal {
    position:static !important; inset:auto !important; transform:none !important;
    width:clamp(30px,8.7cqw,46px) !important; height:clamp(30px,8.7cqw,46px) !important;
    min-width:0 !important; max-width:none !important; flex:0 0 auto !important;
    margin:0 !important; object-fit:contain !important;
  }
  .profile-rating-podium__visual .profile-rating-podium__avatar {
    width:clamp(52px,17.35cqw,92px) !important; height:clamp(52px,17.35cqw,92px) !important;
    min-width:0 !important; margin:0 !important; border:0 !important;
    border-radius:50% !important; box-shadow:none !important;
    background-position:center !important; background-size:cover !important;
  }
  .profile-rating-podium__card.is-place-1 .profile-rating-podium__avatar {
    width:clamp(64px,21cqw,110px) !important; height:clamp(64px,21cqw,110px) !important;
  }
  .profile-rating-podium__name {
    width:100% !important; min-height:26px !important; margin:0 !important;
    display:-webkit-box !important; -webkit-line-clamp:2 !important; -webkit-box-orient:vertical !important;
    overflow:hidden !important; overflow-wrap:anywhere !important; white-space:normal !important;
    color:var(--reference-text) !important;
    font-size:clamp(11px,3.3cqw,17px) !important; font-weight:650 !important;
    line-height:1.13 !important; text-align:center !important;
  }
  .profile-rating-podium__card.is-place-1 .profile-rating-podium__visual { margin-bottom:14px !important; }
  .profile-rating-podium__score {
    margin:auto 0 4px !important; color:var(--reference-gold) !important;
    font-size:clamp(19px,4.8cqw,27px) !important; font-weight:700 !important; line-height:1 !important;
  }
  .profile-rating-podium__card > small {
    color:var(--reference-muted) !important; font-size:clamp(9px,2.4cqw,12px) !important;
    font-weight:500 !important; line-height:1.2 !important;
  }
  .profile-rating-list--top { display:grid !important; gap:5px !important; margin:0 !important; }
  .profile-rating-row.profile-rating-row--redesign {
    display:grid !important; grid-template-columns:minmax(0,1fr) clamp(98px,29cqw,148px) clamp(45px,13cqw,68px) !important;
    align-items:center !important; gap:6px !important;
    width:100% !important; min-height:clamp(48px,12.7cqw,66px) !important;
    padding:5px 10px !important; border:0 !important; border-radius:11px !important;
    color:var(--reference-text) !important; background:var(--reference-card) !important;
    box-shadow:none !important; overflow:visible !important;
    backdrop-filter:none !important; -webkit-backdrop-filter:none !important;
  }
  .profile-rating-row__profile {
    appearance:none !important; display:grid !important;
    grid-template-columns:20px clamp(32px,9.9cqw,48px) minmax(0,1fr) !important;
    gap:7px !important; align-items:center !important; min-width:0 !important;
    min-height:38px !important; margin:0 !important; padding:0 !important; border:0 !important;
    background:transparent !important; color:var(--reference-text) !important; text-align:left !important;
    font:inherit !important; cursor:pointer !important;
  }
  .profile-rating-row__place {
    display:block !important; min-width:0 !important; color:var(--reference-gold) !important;
    font-size:clamp(12px,3.3cqw,17px) !important; font-weight:700 !important; text-align:center !important;
  }
  .profile-rating-row__avatar {
    width:clamp(32px,9.9cqw,48px) !important; height:clamp(32px,9.9cqw,48px) !important;
    min-width:0 !important; border:0 !important; box-shadow:none !important;
    border-radius:50% !important; font-size:13px !important;
    background-size:cover !important; background-position:center !important;
  }
  .profile-rating-row__avatar, .profile-rating-podium__avatar { position:relative !important; }
  .rating-reference-avatar-photo { position:absolute !important; inset:0 !important; width:100% !important; height:100% !important; object-fit:cover !important; border-radius:inherit !important; z-index:1 !important; }
  .rating-reference-avatar-photo[hidden] { display:none !important; }
  .profile-rating-row__identity { padding:0 !important; min-width:0 !important; display:grid !important; gap:2px !important; }
  .profile-rating-row__identity strong {
    display:block !important; overflow:hidden !important; text-overflow:ellipsis !important;
    white-space:nowrap !important; color:var(--reference-text) !important;
    font-size:clamp(10.5px,3.2cqw,16px) !important; font-weight:600 !important;
  }
  .profile-rating-row__eyebrow { color:var(--reference-muted) !important; font-size:8px !important; }
  .profile-rating-row__score {
    appearance:none !important; min-width:0 !important; min-height:36px !important;
    display:flex !important; align-items:center !important; justify-content:flex-end !important;
    padding:0 !important; border:0 !important; background:transparent !important;
    color:var(--reference-text) !important; cursor:pointer !important;
  }
  .profile-rating-row__score strong {
    white-space:nowrap !important; color:var(--reference-text) !important;
    font-size:clamp(9.5px,2.7cqw,13px) !important; font-weight:600 !important;
  }
  .profile-rating-row__chevron { display:none !important; }
  .profile-rating-row.profile-rating-row--continued { box-shadow:inset 2px 0 var(--reference-gold) !important; }
  .profile-rating-row__matchup {
    --rivalry-color:var(--reference-muted); --rivalry-bg:rgba(128,131,140,.11);
    appearance:none !important; display:grid !important; grid-template-columns:clamp(28px,7.7cqw,40px) minmax(0,1fr) !important;
    gap:8px !important; align-items:center !important; width:100% !important; min-width:0 !important;
    min-height:38px !important; padding:0 !important; border:0 !important; background:transparent !important;
    color:var(--rivalry-color) !important; font:inherit !important; text-align:left !important; cursor:pointer !important;
  }
  .profile-rating-row__matchup.is-win { --rivalry-color:var(--reference-win); --rivalry-bg:rgba(52,197,102,.11); }
  .profile-rating-row__matchup.is-loss { --rivalry-color:var(--reference-loss); --rivalry-bg:rgba(227,67,84,.12); }
  .profile-rating-row__matchup.is-draw { --rivalry-color:var(--reference-draw); --rivalry-bg:rgba(210,161,45,.12); }
  .profile-rating-row__matchup-icon {
    width:clamp(28px,7.7cqw,40px) !important; height:clamp(28px,7.7cqw,40px) !important;
    display:grid !important; place-items:center !important; border-radius:9px !important;
    color:var(--rivalry-color) !important; background:var(--rivalry-bg) !important;
  }
  .profile-rating-row__matchup-icon svg, .profile-rating-matchup-popover svg {
    width:20px !important; height:20px !important; fill:none !important; stroke:currentColor !important;
    stroke-width:2.2 !important; stroke-linecap:round !important; stroke-linejoin:round !important;
  }
  .profile-rating-row__matchup-copy { display:grid !important; min-width:0 !important; gap:3px !important; }
  .profile-rating-row__matchup-copy strong {
    color:var(--rivalry-color) !important; font-size:clamp(8px,2.4cqw,12px) !important;
    font-weight:600 !important; line-height:1.1 !important; white-space:nowrap !important;
  }
  .profile-rating-row__matchup-copy small {
    color:var(--reference-muted) !important; font-size:clamp(8px,2.3cqw,11px) !important;
    font-weight:500 !important; line-height:1 !important;
  }
  .profile-rating-row__matchup--self { width:100% !important; }
  .profile-rating-matchup-popover {
    position:fixed !important; z-index:11050 !important;
    width:225px !important; max-width:calc(100vw - 24px) !important;
    display:grid !important; gap:7px !important; padding:14px !important;
    border:1px solid var(--reference-line) !important; border-radius:14px !important;
    background:var(--reference-card) !important; color:var(--reference-text) !important;
    box-shadow:0 10px 35px rgba(0,0,0,.25) !important;
    font:500 12px/1.35 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif !important;
    transform:none !important;
  }
  .profile-rating-matchup-popover[hidden] { display:none !important; }
  .profile-rating-matchup-popover::before {
    content:"" !important; position:absolute !important; top:-6px !important;
    left:var(--tip-x,50%) !important; width:10px !important; height:10px !important;
    background:inherit !important; border:inherit !important; border-right:0 !important; border-bottom:0 !important;
    transform:translateX(-50%) rotate(45deg) !important;
  }
  .profile-rating-matchup-popover.is-above::before { top:auto !important; bottom:-6px !important; transform:translateX(-50%) rotate(225deg) !important; }
  .profile-rating-matchup-popover__line { display:grid !important; grid-template-columns:22px 1fr auto !important; align-items:center !important; gap:7px !important; }
  .profile-rating-matchup-popover__line i { display:flex !important; color:var(--reference-muted) !important; }
  .profile-rating-matchup-popover__line.is-win i { color:var(--reference-win) !important; }
  .profile-rating-matchup-popover__line.is-loss i { color:var(--reference-loss) !important; }
  .profile-rating-matchup-popover__line.is-draw i { color:var(--reference-draw) !important; }
  .profile-rating-matchup-popover b { color:var(--reference-text) !important; }
  .profile-rating-matchup-popover__total { display:flex !important; justify-content:space-between !important; border-top:1px solid var(--reference-line) !important; padding-top:9px !important; margin-top:3px !important; }
  .profile-rating-row button:focus-visible,.profile-rating-podium__card:focus-visible { outline:2px solid var(--game-primary) !important; outline-offset:2px !important; }
  :root[data-game-theme="light"] .profile-rating-podium__card.is-place-1 { background:linear-gradient(155deg,#fff9ea,#fff 75%) !important; border-color:#d6b15f !important; box-shadow:inset 0 0 10px rgba(215,171,64,.10) !important; }
  :root[data-game-theme="light"] .profile-rating-podium__card.is-place-2 { border-color:#dfe3e9 !important; }
  :root[data-game-theme="light"] .profile-rating-podium__card.is-place-3 { border-color:#eadbc9 !important; }
  /* Light surfaces, including previously hard-coded black lazy views. */
  :root[data-game-theme="light"],
  :root[data-game-theme="light"] :is(body,.page,.app-shell,.lobby-content,.lobby-plain-header,#roomsPane,#tournamentsPane,.lobby-menu-backdrop,.lobby-menu-screen,.lobby-menu-content,.lobby-menu-view,.profile-backdrop,.profile-card.panel,.profile-card__scroll,.profile-rating-sticky,.profile-background-zone,.account-profile-panel,.lobby-subpage,.lobby-subpage__inner,.settings-screen,.settings-content,.tournament-shell,.tournament-page,.shop-panel,.slots-carousel,.slot-game-stage,[data-lazy-feature]) {
    color:var(--game-text) !important; background:var(--game-bg) !important; background-image:none !important;
    text-shadow:none !important;
  }
  :root[data-game-theme="light"] :is(body,.page,.app-shell,.profile-card,.profile-card__scroll,.lobby-menu-screen,.lobby-menu-content,.lobby-menu-view,[data-lazy-feature])::before { background:transparent !important; background-image:none !important; box-shadow:none !important; }
  :root[data-game-theme="light"] :is(.lobby-menu-topbar,.settings-header,.profile-card__topbar) { background:var(--game-bg) !important; color:var(--game-text) !important; border-color:var(--game-border) !important; box-shadow:none !important; }
  :root[data-game-theme="light"] :is(h1,h2,h3,h4,strong,legend) { color:var(--game-text) !important; text-shadow:none !important; }
  :root[data-game-theme="light"] :is(p,small,.eyebrow,.muted) { color:var(--game-muted) !important; text-shadow:none !important; }
  :root[data-game-theme="light"] :is(.settings-card,.settings-group,.panel:not(.profile-card),.empty-state,.room-card,.profile-stats>div,.profile-overview-rank,.profile-overview-stats article,.profile-matchup-row,.menu-stat-grid>div,.menu-matchup-row,.menu-social-row,.menu-language-option,.social-friend-card,.profile-friend-row,.profile-friends-card,.account-id-card,.lobby-menu-item,.referral-link-card,.referral-stat-grid article,.gift-product,.gift-modal,.profile-gift-item,.tournament-panel,.tournament-person,.tournament-bracket-match,.tournament-details>div,.shop-tabs,.shop-balance-card,.shop-video-card,.shop-product-card,.shop-empty-state,.premium-feature-card,.premium-benefits,.slot-game-info-card,.create-mode-dialog,.create-mode-choice,.create-reference-card,.create-config-card,.room-filter-reference-card,.friends-page-card) {
    background:var(--game-panel-solid) !important; color:var(--game-text) !important;
    border-color:var(--game-border) !important; background-image:none !important;
    box-shadow:0 3px 14px rgba(30,40,55,.04) !important;
    backdrop-filter:none !important; -webkit-backdrop-filter:none !important;
  }
  :root[data-game-theme="light"] .menu-settings-stack--reference { gap:16px !important; }
  :root[data-game-theme="light"] .menu-settings-stack--reference>.settings-card {
    border:1px solid var(--game-border) !important; border-radius:20px !important; overflow:hidden !important;
  }
  :root[data-game-theme="light"] .menu-settings-stack--reference :is(.settings-group,.settings-list-row,.appearance-reference-row,.settings-row,.appearance-name-form) {
    background:transparent !important; color:var(--game-text) !important;
    border:0 !important; box-shadow:none !important; border-radius:0 !important;
  }
  :root[data-game-theme="light"] .settings-card>.settings-list-row+.settings-list-row::before,
  :root[data-game-theme="light"] .settings-card>.appearance-reference-row+.appearance-reference-row::before { background:var(--game-border) !important; }
  :root[data-game-theme="light"] :is(.settings-row__copy,.settings-list-icon,.appearance-name-form,.profile-name-editor__field,.lobby-profile-button,.lobby-balance,.create-config-icon,.create-config-main,.create-toggle-title,.create-mode-choice__icon,.room-filter-row__title,.room-filter-row__icon,.profile-friends-title,.profile-matchup-row__player,.profile-level-badge-button,.menu-list-heading,.shop-balance-card,.shop-section-caption,.shop-balance-card__value,.premium-info-head) { color:var(--game-text) !important; text-shadow:none !important; }
  :root[data-game-theme="light"] :is(.settings-list-icon,.create-config-icon,.create-mode-choice__icon,.room-filter-row__icon) svg { stroke:currentColor !important; fill:none !important; }
  :root[data-game-theme="light"] :is(.settings-list-value,.settings-list-value small,.settings-nav-chevron,.create-toggle-state,.shop-balance-card__label,.shop-section-caption>span,.profile-matchups-all,.profile-friends-count,.profile-username-row #profileUsername) { color:var(--game-muted) !important; }
  :root[data-game-theme="light"] :is(.settings-segmented,.game-theme-selector,.account-profile-tabs,.account-reward-tabs,.lobby-kind-tabs,.tournament-tabs,.tournament-currency,.room-filter-segmented,.create-choice-row,.shop-tabs,.gift-filter) {
    background:#e9edf2 !important; border:0 !important; box-shadow:none !important;
  }
  :root[data-game-theme="light"] :is(.settings-segmented,.account-profile-tabs,.account-reward-tabs,.lobby-kind-tabs,.tournament-tabs,.tournament-currency,.room-filter-segmented,.create-choice-row,.shop-tabs,.gift-filter) button {
    background:transparent !important; color:var(--game-muted) !important; border:0 !important; box-shadow:none !important;
  }
  :root[data-game-theme="light"] :is(.settings-segmented,.account-profile-tabs,.account-reward-tabs,.lobby-kind-tabs,.tournament-tabs,.tournament-currency,.room-filter-segmented,.create-choice-row,.shop-tabs,.gift-filter) button:is(.is-active,.is-selected,[aria-pressed="true"]) {
    background:#fff !important; color:var(--game-text) !important; box-shadow:0 1px 4px rgba(30,40,55,.13) !important;
  }
  :root[data-game-theme="light"] :is(.ios-switch,.cheat-mode-switch,.private-toggle__switch) { background:#cbd1da !important; box-shadow:none !important; }
  :root[data-game-theme="light"] :is(.ios-switch i,.cheat-mode-switch i,.private-toggle__knob) { background:#fff !important; box-shadow:0 2px 5px rgba(20,25,35,.18) !important; }
  :root[data-game-theme="light"] .ios-switch__input:checked+.ios-switch,
  :root[data-game-theme="light"] .create-toggle-row[aria-pressed="true"] .cheat-mode-switch,
  :root[data-game-theme="light"] .cheat-mode-row.is-active .cheat-mode-switch { background:var(--game-primary) !important; }
  :root[data-game-theme="light"] :is(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),textarea,select,.appearance-name-field,.social-search-box) {
    color:var(--game-text) !important; background:#f0f2f5 !important; border-color:var(--game-border) !important;
    box-shadow:none !important; caret-color:var(--game-text) !important;
  }
  :root[data-game-theme="light"] :is(input,textarea)::placeholder { color:#757d8a !important; }
  :root[data-game-theme="light"] :is(.appearance-name-save,.profile-name-editor__save,.profile-action-button,.game-profile-friend-button,.custom-card-back__trash,.button--ghost,.settings-back,.menu-view-back,.icon-button) {
    color:var(--game-text) !important; background:#e9edf2 !important; border-color:var(--game-border) !important; box-shadow:none !important;
  }
  :root[data-game-theme="light"] :is(.profile-action-label,.game-profile-rating,.game-profile-duel,.table-topbar__rules,.table-param strong,.seat__name,.turn-helper strong,.profile-matchup-row__number) { color:var(--game-text) !important; text-shadow:none !important; }
  :root[data-game-theme="light"] :is(.button--primary,.create-fab,.join-button,.lobby-filter-button,.messages-compose button,.shop-product-card>button,.shop-video-card__button,.premium-buy-button,.slot-spin-button,.gift-pin-button,.invite-primary) {
    color:#fff !important; background:var(--game-primary) !important; background-image:none !important;
    border-color:transparent !important; box-shadow:none !important;
  }
  :root[data-game-theme="light"] :is(.button--primary,.create-fab,.join-button,.shop-product-card>button,.invite-primary) :is(strong,span,small) { color:inherit !important; }
  :root[data-game-theme="light"] .lobby-filter-button svg { stroke:#fff !important; }
  :root[data-game-theme="light"] :is(.game-bottom-menu,.profile-actions--inline) { background:transparent !important; box-shadow:none !important; }
  :root[data-game-theme="light"] .game-bottom-menu::before,
  :root[data-game-theme="light"] .game-bottom-menu__item[data-bottom-nav="lobby"] {
    background:rgba(255,255,255,.97) !important; border-color:#dce1e8 !important; box-shadow:0 5px 20px rgba(30,40,55,.08) !important;
  }
  :root[data-game-theme="light"] .game-bottom-menu__item { color:var(--game-muted) !important; }
  :root[data-game-theme="light"] .game-bottom-menu__item.active { color:var(--game-primary) !important; }
  :root[data-game-theme="light"] .game-bottom-menu__label { color:inherit !important; }
  :root[data-game-theme="light"] :is(.room-filter-backdrop,.rating-info-backdrop,.confirm-backdrop,.result-backdrop,.table-chat-backdrop,.game-profile-backdrop,.gift-modal-backdrop,.profile-level-backdrop,.notification-detail-backdrop,.referral-help-backdrop,.referral-withdrawal-backdrop,.create-mode-backdrop) {
    background:rgba(29,39,54,.24) !important; backdrop-filter:blur(7px) !important; -webkit-backdrop-filter:blur(7px) !important;
  }
  :root[data-game-theme="light"] :is(.room-filter-card,.rating-info-card,.confirm-card,.result-card,.table-chat-card,.game-profile-card,.profile-level-modal-card,.profile-level-modal-summary,.profile-level-modal-help,.notification-detail-card,.referral-help-card,.referral-withdrawal-card,.gift-detail-list,.gift-detail-list>div,.game-profile-collection,.game-profile-rating,.game-profile-duel,.game-profile-stats>div) {
    background:#fff !important; color:var(--game-text) !important; border-color:var(--game-border) !important;
    background-image:none !important; box-shadow:0 6px 24px rgba(30,40,55,.08) !important;
  }
  :root[data-game-theme="light"] :is(.rating-info-content,.notification-detail-message,.profile-level-modal-help,.gift-detail-list dt,.gift-detail-list dd,.gift-sender,.gift-detail-cost,.referral-help-card li,.referral-help-card p,.game-profile-collection) { color:var(--game-text) !important; text-shadow:none !important; }
  :root[data-game-theme="light"] :is(.rating-info-close,.table-modal-close,.profile-level-modal-close,.gift-modal__close,.notification-detail-close,.referral-help-close) { background:#edf0f4 !important; color:var(--game-text) !important; }
  :root[data-game-theme="light"] :is(.page--table,.table-shell,.game-board) { background:#edf0f4 !important; background-image:none !important; }
  :root[data-game-theme="light"] .table-surface { background:#e4e9ef !important; border-color:#d7dee7 !important; box-shadow:none !important; }
  :root[data-game-theme="light"] :is(.turn-helper,.seat__name,.waiting-ready-row,.result-rank) { background:#fff !important; color:var(--game-text) !important; border-color:var(--game-border) !important; text-shadow:none !important; }
  :root[data-game-theme="light"] :is(.account-profile-progress,.account-profile-progress.profile-overview-rank__progress,.profile-overview-rank__progress>i) { background:#dde3eb !important; box-shadow:none !important; }
  :root[data-game-theme="light"] .account-profile-progress>i::before { background:var(--game-primary) !important; box-shadow:none !important; }
  :root[data-game-theme="light"] :is(.profile-background-zone,.game-profile-card__hero).has-profile-background::before {
    display:block !important; opacity:1 !important;
  }
  :root[data-game-theme="light"] .profile-background-zone.has-profile-background::before { background-image:linear-gradient(rgba(255,255,255,.7),rgba(255,255,255,.88)),var(--profile-background-image) !important; }
  :root[data-game-theme="light"] .game-profile-card__hero { background:var(--game-bg) !important; }
  :root[data-game-theme="light"] .game-profile-card__hero::after { background:rgba(255,255,255,.72) !important; }
  /* Semantic colors override generic typography in light mode. */
  :root[data-game-theme="light"] .profile-rating-row__matchup-copy strong { color:var(--rivalry-color) !important; }
  :root[data-game-theme="light"] .profile-rating-row__place,
  :root[data-game-theme="light"] .profile-rating-podium__score { color:var(--reference-gold) !important; }
  @media(max-width:350px) {
    .profile-card--rating .profile-card__scroll { padding-inline:10px !important; }
    .profile-rating-row.profile-rating-row--redesign { gap:4px !important; padding-inline:6px !important; grid-template-columns:minmax(0,1fr) 94px 44px !important; }
    .profile-rating-row__profile { grid-template-columns:17px 30px minmax(0,1fr) !important; gap:5px !important; }
    .profile-rating-row__avatar { width:30px !important; height:30px !important; }
    .profile-rating-row__matchup { gap:5px !important; grid-template-columns:26px minmax(0,1fr) !important; }
    .profile-rating-row__matchup-icon { width:26px !important; height:28px !important; }
  }
  button.profile-rating-row.profile-rating-row--redesign { grid-template-columns:20px 36px minmax(0,1fr) auto !important; }
  :root[data-game-theme="light"] .lobby-menu-back-button { background:#e9edf2 !important; color:var(--game-text) !important; border:0 !important; box-shadow:none !important; }
  :root[data-game-theme="light"] .shop-video-card__icon { background:#e9f0fc !important; color:var(--game-primary) !important; border-color:var(--game-border) !important; }
  :root[data-game-theme="light"] .shop-video-card__icon svg { fill:currentColor !important; }
  :root[data-game-theme="light"] .shop-balance-card :is(span,small) { color:var(--game-muted) !important; }

}

@layer durak-reference {
  :root[data-game-theme="light"] :is(.premium-rules,.premium-rules__content,.premium-rules__content li,.premium-target-modal,.premium-friend-picker,.premium-friend-list,.premium-target-actions button,.slot-cabinet,.slots-slide__info,.slot-cabinet__marquee,.slot-cabinet__reels,.slot-cabinet__jackpot,.slot-game-summary>span,.slot-bet-card,.slot-paytable-card,.slot-paytable-card>div,.slot-result,.slot-info-card,.slot-info-list li,.slot-jackpot-chance-table>div) {
    background:#fff !important; background-image:none !important;
    color:var(--game-text) !important; border-color:var(--game-border) !important;
    box-shadow:0 3px 14px rgba(30,40,55,.06) !important;
  }
  :root[data-game-theme="light"] :is(.premium-rules summary,.premium-rules summary span,.premium-rules__content li b,.premium-rules__content li span,.slot-cabinet__jackpot b,.slot-result,.slot-info-list b,.slot-jackpot-chance-table span,.slot-jackpot-chance-table b) {
    color:var(--game-text) !important; text-shadow:none !important;
  }
  :root[data-game-theme="light"] :is(.premium-rules summary i,.premium-target-modal__close,.slot-title-help,.slot-bet-control button,.slots-carousel__arrow) {
    background:#e8edf4 !important; color:var(--game-text) !important; border-color:var(--game-border) !important;
    box-shadow:none !important;
  }
  :root[data-game-theme="light"] :is(.slot-cabinet__marquee,.slot-cabinet__reels,.slot-cabinet__jackpot,.slots-info-grid>span,.slots-win-strip span) {
    background:#edf1f6 !important; color:var(--game-text) !important; border-color:var(--game-border) !important; box-shadow:none !important;
  }
  :root[data-game-theme="light"] :is(.slots-slide__eyebrow,.slots-slide__eyebrow b,.slot-cabinet__jackpot>span,.slot-bet-scale,.slot-bet-scale span,.slot-odds span) { color:var(--game-muted) !important; }
  :root[data-game-theme="light"] .slots-play-button { background:var(--game-primary) !important; color:#fff !important; border:0 !important; box-shadow:none !important; }
  :root[data-game-theme="light"] .slots-play-button:disabled { background:#dfe5ef !important; color:#737d8f !important; opacity:1 !important; }
  :root[data-game-theme="light"] .slot-cabinet__reels>span { background:linear-gradient(#fff,#f2f4f8) !important; box-shadow:0 1px 3px rgba(30,40,55,.1) !important; border-color:#d8dfe8 !important; }
  :root[data-game-theme="light"] .slot-suit--black { color:#252934 !important; text-shadow:none !important; }
  :root[data-game-theme="light"] .slot-suit--red { color:#c02c49 !important; text-shadow:none !important; }
  :root[data-game-theme="light"] .slots-carousel__dots button { background:#c6ceda !important; }
  :root[data-game-theme="light"] .slots-carousel__dots button.is-active { background:var(--game-primary) !important; }
  /* Do not let min-content widths of inactive flex slides enlarge the carousel. */
  .lobby-menu-view.slots-view,.lobby-menu-view.slot-game-view,.slots-carousel,.slots-carousel__viewport,.slots-carousel__track,.slots-slide,.slots-slide__info,.slot-game-shell {
    min-width:0 !important; max-width:100% !important; box-sizing:border-box !important;
  }
  .lobby-menu-view.slots-view,.slots-carousel,.slots-carousel__viewport,.slots-carousel__track { width:100% !important; }
  .slots-carousel__track { display:flex !important; }
  .slots-slide { flex:0 0 100% !important; width:100% !important; grid-template-columns:minmax(0,1fr) !important; }
  .slot-cabinet { max-width:100% !important; box-sizing:border-box !important; }
  :root[data-game-theme="light"] .slot-bet-control input[type="range"]::-webkit-slider-runnable-track { background:#bcc8d8 !important; }
  :root[data-game-theme="light"] .slot-bet-control input[type="range"]::-webkit-slider-thumb { background:var(--game-primary) !important; }
  :root[data-game-theme="light"] .slot-bet-control input[type="range"]::-moz-range-track { background:#bcc8d8 !important; }
  :root[data-game-theme="light"] .slot-bet-control input[type="range"]::-moz-range-thumb { background:var(--game-primary) !important; }
}

@layer durak-reference {
  :root[data-game-theme="light"] :is(#createModal .modal-actions,#roomFilters .room-filter-actions,.tournament-page-actions,.lobby-subpage__footer) {
    background:var(--game-bg) !important; background-image:none !important;
    border-color:var(--game-border) !important; box-shadow:none !important;
  }
  :root[data-game-theme="light"] #createModal .stake-slider__range::-webkit-slider-thumb {
    background:var(--game-primary) !important; border-color:#fff !important; box-shadow:0 1px 5px rgba(20,35,50,.15) !important;
  }
  :root[data-game-theme="light"] #createModal .stake-slider__range::-moz-range-thumb {
    background:var(--game-primary) !important; border-color:#fff !important; box-shadow:0 1px 5px rgba(20,35,50,.15) !important;
  }
}
