/* The same bright club materials carry through every overlay. Only the middle
   panel scrolls: close, save and confirm always stay inside the visible area. */
body dialog:is(.bright-dialog,#platform-dialog,#wallet-dialog) {
  --dialog-ink:#51246e;
  --dialog-muted:#80598f;
  --dialog-line:#dcb4e8;
  --social-cream:#51246e;
  --social-muted:#80598f;
  color-scheme:light;
  color:var(--dialog-ink);
  border:2px solid #f4caee;
  background:linear-gradient(160deg,#fff8ff,#f3e3ff 62%,#edd4ff);
  box-shadow:inset 0 2px 0 #fff,0 7px 0 #6e2cad,0 24px 60px #47177455;
  border-radius:26px;
}
body dialog:is(.bright-dialog,#platform-dialog,#wallet-dialog)::backdrop {
  background:#4d157769;backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);
}
body dialog:is(#settings-dialog,#rules-dialog,#history-dialog,#confirm-dialog,#social-profile-dialog,#social-player-dialog) {
  position:fixed;top:calc(var(--dialog-vtop,0px) + var(--dialog-vheight,100dvh)/2);left:50%;right:auto;bottom:auto;
  transform:translate(-50%,-50%);margin:0;padding:0;width:min(480px,calc(100% - 24px));
  max-width:none;max-height:calc(var(--dialog-vheight,100dvh) - 24px);overflow:hidden;
}
body dialog.bright-dialog[open] { display:flex;flex-direction:column; }
body dialog.bright-dialog>.bright-dialog-scroll,
body #social-player-dialog [data-player-profile-body] {
  flex:1 1 auto;min-height:0;padding:18px 20px;overflow-y:auto;overflow-x:hidden;
  overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c88cda transparent;-webkit-overflow-scrolling:touch;
}
body dialog:is(.bright-dialog,#wallet-dialog) :is(.dialog-top,.social-dialog-header,.lobby-wallet-top),
body #platform-dialog .platform-header {
  position:relative;top:auto;display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;
  min-height:70px;margin:0;padding:14px 20px;border:0;border-bottom:1px solid #efb7e6;
  border-radius:0;background:linear-gradient(115deg,#a447e5,#c458e2 58%,#e680d2);
  color:#fff5fc;box-shadow:inset 0 2px 0 #ffffff75,0 2px 6px #ac65c514;
}
body dialog:is(.bright-dialog,#wallet-dialog) :is(.dialog-top,.social-dialog-header,.lobby-wallet-top) :is(h2,.section-index),
body #platform-dialog .platform-header h2 {
  margin:0;color:#fff8fe;font-size:23px;font-weight:900;line-height:1.3;letter-spacing:0;text-shadow:0 2px 0 #7e35a85c;
}
body #platform-dialog .platform-header small { display:none; }
body dialog:is(.bright-dialog,#platform-dialog,#wallet-dialog) :is(.close-button,.social-close,.platform-close,.lobby-wallet-close) {
  display:grid;place-items:center;position:relative;flex:0 0 42px;width:42px;height:42px;min-width:42px;min-height:42px;
  margin:0;padding:0;border:1px solid #ffe2fa;border-radius:14px;background:linear-gradient(#fba5e9,#d86bdb);
  color:#fff;font:500 30px/1 sans-serif;box-shadow:inset 0 2px 0 #ffffff80,0 3px 0 #9240b3;text-shadow:0 1px 1px #8e3682;
}
body dialog:is(.bright-dialog,#platform-dialog,#wallet-dialog) :is(button,summary,input,select,textarea):focus-visible {
  outline:3px solid #8354da;outline-offset:3px;
}
body dialog.bright-dialog>.bright-dialog-footer,
body .bright-dialog-footer,
body #platform-dialog .platform-footer {
  flex:none;position:relative;z-index:2;margin:0;padding:13px 20px max(14px,env(safe-area-inset-bottom));
  border-top:1px solid #dbb8e9;background:linear-gradient(#fff6ff,#f3e1fc);box-shadow:0 -5px 12px #7f3faf09;
}
body .bright-dialog-footer:has(>button[hidden]:only-child) { display:none; }
body dialog.bright-dialog .bright-dialog-footer>button,
body #platform-dialog .platform-footer-actions>button { width:100%;min-height:48px;margin:0; }
body dialog:is(.bright-dialog,#platform-dialog,#wallet-dialog) :is(.primary-button,.social-primary-button,.platform-primary,.player-profile-return) {
  display:inline-flex;align-items:center;justify-content:center;border:1px solid #ffe9c0;border-radius:15px;
  background:linear-gradient(#ffe393,#ffbb55);color:#75440a;font-size:16px;font-weight:900;line-height:1.25;
  box-shadow:inset 0 2px 0 #fff5da,0 4px 0 #d99239,0 5px 10px #d6942630;text-shadow:0 1px 0 #ffffff8c;
}
body dialog:is(.bright-dialog,#platform-dialog,#wallet-dialog) :is(.challenge-button,.social-soft-button,.platform-secondary),
body #settings-dialog .feedback-settings button {
  border:1px solid #d9ace9;background:linear-gradient(#fffaff,#eddbfb);color:#743994;
  border-radius:13px;box-shadow:inset 0 1px 0 #fff,0 2px 0 #d4afe2;
}
body dialog:is(.bright-dialog,#platform-dialog,#wallet-dialog) button:disabled { opacity:.48;box-shadow:none; }
body #settings-dialog .settings-options { gap:10px;margin:0 0 15px; }
body #settings-dialog .settings-options>button { min-height:44px;font-size:13px; }
body #settings-dialog .feedback-settings { margin:12px 0 0;padding:14px;border:1px solid #dbb7eb;border-radius:17px;background:#ffffff78; }
body #settings-dialog .feedback-settings h3 { color:#633087;font-size:16px; }
body #settings-dialog .feedback-settings p,
body #settings-dialog .settings-note,
body #settings-dialog .voice-controls label { color:#80638e;font-size:11px; }
body #settings-dialog .feedback-settings button[aria-pressed=true] { color:#633482;background:linear-gradient(#edc9ff,#d5aff5);border-color:#c691e3; }
body #settings-dialog :is(select,input:not([type=range])) { color:#572979;background:#fff9ff;border:1px solid #d9afe6; }
body #settings-dialog :is(.music-volume-control,output) { color:#835397; }
body #rules-dialog .bright-dialog-scroll>h2 { color:#69318c;font-size:21px;margin:0 0 16px; }
body #rules-dialog .rules-list { color:#5f327b; }
body #rules-dialog .rules-list strong { color:#642c83; }
body #rules-dialog .rules-list p { color:#846190; }
body #rules-dialog .solo-link { color:#8455a1;background:#ffffff73;border-color:#dcb9ec; }
body #confirm-dialog { width:min(420px,calc(100% - 28px)); }
body #confirm-dialog .dialog-top { min-height:70px; }
body #confirm-dialog .dialog-top h2 { font-size:23px; }
body #confirm-description { margin:0;font-size:15px;line-height:1.65;color:#6c497e; }
body #confirm-dialog .bright-confirm-actions { display:grid;grid-template-columns:1fr 1fr;gap:12px;padding-top:16px; }
body #confirm-dialog #confirm-yes { grid-column:2;grid-row:1; }
body #confirm-dialog #confirm-no { grid-column:1;grid-row:1; }
body #history-dialog { height:min(710px,calc(var(--dialog-vheight,100dvh) - 24px)); }
body #history-dialog .activity-tabs { flex:none;margin:14px 18px 10px; }
body #history-dialog .activity-tabs button { color:#866296;background:#ffffff89;border:1px solid #dcb6ea;border-radius:13px; }
body #history-dialog .activity-tabs button[aria-pressed=true] { color:#753694;background:#edcbfa;border-color:#cf96df; }
body #history-dialog :is(.history-panel,.result-panel,#result-content) { min-height:0;flex:1 1 auto;margin:0; }
body #history-dialog .history-panel { padding:6px 20px 20px;overflow:auto; }
body #history-dialog :is(.result-panel,#result-content):not([hidden]) { display:flex;flex-direction:column;overflow:hidden; }
body #history-dialog .bright-result-scroll { flex:1 1 auto;min-height:0;padding:10px 20px 18px;overflow:auto; }
body #history-dialog #result-empty { padding:20px; }
body #history-dialog :is(h2,.panel-heading,#result-title) { color:#652788; }
body #history-dialog :is(p,#history,.all-hands,.match-score) { color:#855d96; }
body #history-dialog .result-summary { color:#623b76;border-color:#d4afe4;background:#fff8ff; }
body #history-dialog #history li { border-color:#ddc1e9; }
body #history-dialog .bright-dialog-footer { padding-inline:20px; }
/* Compact optional explanations use native details: keyboard and screen-reader
   behavior works without hover, and essential errors remain outside them. */
.bright-help { position:relative;flex:none;color:#785286;font-size:12px;line-height:1.55; }
.bright-help>summary { display:grid;place-items:center;list-style:none;cursor:pointer;width:30px;height:30px;border:1px solid #d9aee8;border-radius:50%;background:#f0dcfa;color:#8a56a9;font-weight:900;font-size:17px; }
.bright-help>summary::-webkit-details-marker { display:none; }
.bright-help>p { margin:8px 0 0;padding:12px;border:1px solid #d4ace2;border-radius:12px;background:#fff9ff;color:#785286; }
.bright-help:not(.bright-help-row)>p { position:absolute;right:0;top:100%;z-index:6;width:min(285px,calc(100vw - 80px));box-shadow:0 8px 20px #72249426; }
.bright-help-row>summary { display:flex;width:auto;gap:8px;padding:0 9px;border:0;border-radius:9px;background:none;justify-content:flex-start; }
.bright-help-row>summary>span { font-size:11px;font-weight:500; }
body #social-profile-dialog { width:min(420px,calc(100% - 24px)); }
body #social-profile-dialog .bright-dialog-scroll { padding-top:14px;padding-bottom:14px; }
body #social-profile-dialog .social-profile-preview { gap:14px;padding:0 0 13px; }
body #social-profile-dialog .social-profile-avatar { width:72px;height:72px;border:3px solid #fff0c4;background:#f6d690;box-shadow:0 3px 0 #d2a1dd,0 0 0 2px #d999e7; }
body #social-profile-dialog .social-profile-preview strong { font-size:19px;color:#6b3088; }
body #social-profile-dialog .social-profile-preview p { font-size:12px;color:#98749f; }
.social-field-heading { display:flex;align-items:center;justify-content:space-between;margin-bottom:7px; }
body #social-profile-dialog .social-name-label { margin:0;color:#74448e;font-size:13px; }
body #social-profile-dialog .social-name-input { height:54px;padding:12px 15px;border:2px solid #d2a2e4;border-radius:14px;background:#fff;color:#633180;font-size:20px;font-weight:750;box-shadow:inset 0 2px 4px #ab6dc30b; }
body #social-profile-dialog .social-name-input:focus { border-color:#bf6bdd;box-shadow:0 0 0 3px #d391ee23; }
body #social-profile-dialog .social-name-input::placeholder { color:#b096bd;font-size:17px;font-weight:500; }
body #social-profile-dialog .social-upload-row { margin-top:12px;justify-content:flex-start; }
body #social-profile-dialog .social-text-button { color:#aa5da4; }
body #social-profile-dialog .bright-help-inline { margin-left:auto; }
body #social-profile-dialog .social-avatar-fieldset { margin-top:16px; }
body #social-profile-dialog .social-avatar-fieldset legend { margin-bottom:9px;color:#74448e;font-size:13px; }
body #social-profile-dialog .social-avatar-options { gap:8px; }
body #social-profile-dialog .social-avatar-option { padding:8px 4px 6px;gap:4px;border:1px solid #e0c0ed;border-radius:14px;background:#fff9ff;color:#86589b; }
body #social-profile-dialog .social-avatar-option .social-avatar { width:48px;height:48px; }
body #social-profile-dialog .social-avatar-option[aria-pressed=true] { border-color:#d472ce;background:linear-gradient(#ffe4f8,#f1d5fd);box-shadow:0 0 0 1px #dc9cd5;color:#844291; }
body #social-profile-dialog .social-avatar-check { background:#d36cce;color:#fff; }
body #social-profile-dialog .social-outfit-details { margin-top:15px;border-top:1px solid #e0c6eb;padding-top:11px; }
.social-outfit-details>summary { display:flex;justify-content:space-between;cursor:pointer;list-style:none;min-height:30px;color:#825091;font-size:13px;font-weight:700; }
.social-outfit-details>summary::-webkit-details-marker { display:none; }
body #social-profile-dialog .social-dice-fieldset { margin-top:8px; }
body #social-profile-dialog .social-dice-option { color:#80508e;border-color:#d9b8e8;background:#fff8ff; }
body #social-profile-dialog .social-dice-option[aria-pressed=true] { color:#773a86;background:#f6dcfa;border-color:#d395d9; }
body #social-profile-dialog .social-dice-option>span:not(.dice-skin-sample) { color:#9a7ba3; }
body #social-profile-dialog .social-feedback { color:#745086;margin:0 0 8px;min-height:0;font-size:12px; }
body #social-profile-dialog .social-feedback:empty { display:none; }
body #social-profile-dialog .social-feedback.is-error { color:#bd3f70; }
body #social-player-dialog :is(.player-profile-name,.player-profile-section-title,.player-profile-stats strong) { color:#743994; }
body #social-player-dialog :is(.player-profile-identity p,.player-profile-identity>span,.player-profile-section>p,.player-profile-stats span,.player-profile-footer) { color:#936e9c; }
body #social-player-dialog :is(.player-profile-preview,.player-profile-chips) { background:#fff8ff;color:#9265a3;border-color:#e1c6ed; }
body #social-player-dialog .player-profile-chips strong { color:#b78029; }
body #social-player-dialog .player-profile-result.is-win { color:#358b7d;background:#baf4d943; }
body #social-player-dialog .player-profile-result.is-loss { color:#b35488;background:#f9cbeb66; }
body #social-player-dialog .player-profile-equipped { color:#815194; }
body #social-chat-dialog.social-compact-chat { background:linear-gradient(145deg,#fff4ff,#f0dcfa);border-color:#dbafea;box-shadow:0 8px 30px #73299a38;color:#74458c; }
body #social-chat-dialog .social-dialog-header h2 { color:#753b94; }
body #social-chat-dialog .social-close { background:#e9c8f8;border-color:#d6a2e8;color:#8c47a6; }
body #social-chat-dialog .social-bubble-switch,body #social-chat-dialog .social-character-count { color:#9c75aa; }
body #social-chat-dialog .social-messages { background:#fff9ff;border-color:#e2c3ef; }
body #social-chat-dialog .social-chat-toolbar .social-soft-button { color:#9061a2;background:#f4e2fe;border-color:#dfb7eb; }
body #social-chat-dialog .social-chat-toolbar .social-soft-button[aria-expanded=true] { color:#9445a4;background:#f4d2ef;border-color:#d899d4; }
body #social-chat-dialog .social-message-body { color:#83578e;background:#f3e4fb;border-color:#e4c6ef; }
body #social-chat-dialog .social-message.is-mine .social-message-body:not(.is-sticker) { color:#864774;background:#fde0ee;border-color:#e8b6cf; }
body #social-chat-dialog :is(.social-message-meta,.social-chat-empty,.social-chat-empty strong) { color:#9363a2; }
body #social-chat-dialog :is(.social-sticker-panel,.social-quick-panel) { color:#865994;background:#fff7ff;border-color:#e1c2ec; }
body #social-chat-dialog .social-quick-panel button { background:#f0daf9;border-color:#d4ace3;color:#84559c; }
body #social-chat-dialog .social-composer input { color:#704086;background:#fff;border-color:#d4a9e7; }
body #social-chat-dialog .social-composer .social-primary-button { color:#855d1f;background:linear-gradient(#ffe3a0,#ffc665);border-color:#f1c77f; }
body #social-chat-dialog .social-feedback { color:#985592; }
@media(max-width:480px) {
  body dialog:is(#settings-dialog,#rules-dialog,#history-dialog,#confirm-dialog,#social-profile-dialog,#social-player-dialog) { max-height:calc(var(--dialog-vheight,100dvh) - 18px);border-radius:23px; }
  body dialog.bright-dialog>.bright-dialog-scroll,body #social-player-dialog [data-player-profile-body] { padding:15px 17px; }
  body dialog:is(.bright-dialog,#wallet-dialog) :is(.dialog-top,.social-dialog-header,.lobby-wallet-top) { padding:12px 17px;min-height:65px; }
  body dialog.bright-dialog .bright-dialog-footer { padding:12px 17px max(14px,env(safe-area-inset-bottom)); }
}
@media(max-height:460px) {
  body dialog:is(.bright-dialog,#wallet-dialog) :is(.dialog-top,.social-dialog-header,.lobby-wallet-top) { min-height:52px;padding-block:7px; }
  body dialog.bright-dialog .bright-dialog-footer { padding-top:9px;padding-bottom:10px; }
  body dialog.bright-dialog .bright-dialog-footer>button { min-height:43px; }
}
