/* Shared materials for website, Windows and Android. Screen only: print stays flat. */
@media screen {
  :is(#dk-site,#dk-native) {
    --dk-e-accent:var(--gold,var(--amber,#ffbf32));
    --dk-e-bg:var(--background,var(--bg,#08131b));
    --dk-e-light:#e8f6ff24;
    --dk-e-rim:#f1faff42;
    --dk-e-dark:#0009;
    --dk-e-lift:#0006;
    --dk-e-button-shade:#59370055;
    --dk-e-card:8px 12px 24px var(--dk-e-lift),-3px -3px 8px var(--dk-e-light),inset 1px 1px 1px var(--dk-e-rim),inset -2px -3px 5px var(--dk-e-dark);
    --dk-e-field:inset 4px 4px 8px var(--dk-e-dark),inset -2px -2px 5px var(--dk-e-light),0 1px 0 var(--dk-e-light);
    --dk-e-button:inset 1px 1px 2px var(--dk-e-rim),inset -2px -2px 4px var(--dk-e-dark),3px 4px 8px var(--dk-e-lift);
    --dk-e-primary:inset 1px 2px 2px #ffffff9c,inset -2px -3px 5px var(--dk-e-button-shade),0 3px 0 color-mix(in srgb,var(--dk-e-accent) 48%,var(--dk-e-bg)),0 8px 16px var(--dk-e-lift);
    --dk-e-pressed:inset 2px 3px 6px var(--dk-e-dark),inset -1px -1px 2px var(--dk-e-light),0 1px 2px var(--dk-e-lift);
    --dk-e-primary-face:linear-gradient(145deg,color-mix(in srgb,var(--dk-e-accent) 76%,white),var(--dk-e-accent) 65%,color-mix(in srgb,var(--dk-e-accent) 90%,var(--dk-e-bg)));
  }
  html:is([data-site-design="studio"],[data-app-design="studio"]) :is(#dk-site,#dk-native) {
    --dk-e-light:#ffffffd9;
    --dk-e-rim:#fff;
    --dk-e-dark:#193b322b;
    --dk-e-lift:#193b3224;
    --dk-e-button-shade:#073b2e55;
    --dk-e-primary-face:linear-gradient(145deg,color-mix(in srgb,var(--dk-e-accent) 92%,white),var(--dk-e-accent));
  }

  /* Layout remains with the existing components; this layer only adds relief. */
  :is(#dk-site,#dk-native) :is(
    .panel,.tournament-card,.registration-card,.search-bar,.admin-panel,.admin-stats,.admin-access,
    .download-app,.download-release,.download-status,.license-card,.license-request-card,.license-code-box,
    .site-design-option,.app-design-choice,.design-option,.announcement-fieldset,.announcement-aside>div,
    .concept-feature-strip,.goldglas-feature-grid>a,.feature-row,.mode-item,.screenshot-image,.preview-stage,
    .site-account,.account-link-panel,.account-dialog,.modal-card,.tournament-window,.update-dialog,
    .license-activation,.setup-form,.setup-registrations,.score-stage,.forecast-summary,.tournament-qr-content,
    .tournament-publication,.live-link-settings,.bracket-match,.live-board,.scratch-live-board,
    .live-history-panel,.live-standings,.live-bracket-scroll,.live-winner-card,.live-table,
    .hobby-hero,.hobby-panel,.hobby-overview article,.hobby-empty,.hobby-live-scoreboard,
    .hobby-live-personal,.hobby-live-match,.hobby-live-history,.hobby-live-finished,.hobby-live-empty
  ) { box-shadow:var(--dk-e-card); }

  :is(#dk-site,#dk-native) dialog { box-shadow:inset 1px 1px 2px var(--dk-e-rim),inset -2px -3px 6px var(--dk-e-dark),0 22px 70px var(--dk-e-lift); }
  :is(#dk-site,#dk-native) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="color"]):not([type="button"]):not([type="submit"]),select,textarea) {
    box-shadow:var(--dk-e-field);
  }
  :is(#dk-site,#dk-native) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="color"]):not([type="button"]):not([type="submit"]),select,textarea):focus-visible {
    outline:2px solid var(--dk-e-accent);
    outline-offset:3px;
    box-shadow:var(--dk-e-field),0 0 16px color-mix(in srgb,var(--dk-e-accent) 18%,transparent);
  }

  /* Image previews stay image previews; their real controls and cards get depth. */
  :is(#dk-site,#dk-native) :where(button:not(.product-preview):not(.goldglas-phone):not(.screenshot-card):not(.hobby-overview-open),.button,.quiet-button,.close-dialog,input[type="button"],input[type="submit"]) {
    box-shadow:var(--dk-e-button);
  }
  :is(#dk-site,#dk-native) :is(.button-primary,button.primary,input[type="submit"]) {
    background:var(--dk-e-primary-face);
    box-shadow:var(--dk-e-primary);
  }
  :is(#dk-site,#dk-native) :where(button:not(.product-preview):not(.goldglas-phone):not(.screenshot-card):not(.hobby-overview-open),.button,.quiet-button,.close-dialog,input[type="button"],input[type="submit"]):active:not(:disabled):not([aria-disabled="true"]) {
    box-shadow:var(--dk-e-pressed);
  }
  :is(#dk-site,#dk-native) :is(.button-primary,button.primary,input[type="submit"]):active:not(:disabled):not([aria-disabled="true"]) {
    box-shadow:inset 2px 3px 6px var(--dk-e-button-shade),inset -1px -1px 2px #ffffff60,0 1px 0 color-mix(in srgb,var(--dk-e-accent) 48%,var(--dk-e-bg)),0 3px 7px var(--dk-e-lift);
  }
  :is(#dk-site,#dk-native) :is(button:disabled,input[type="button"]:disabled,input[type="submit"]:disabled,[aria-disabled="true"]) {
    box-shadow:inset 1px 1px 2px var(--dk-e-light),inset -1px -1px 2px var(--dk-e-dark);
  }

  /* Keep selected options and navigation clear alongside the relief. */
  :is(#dk-site,#dk-native) :is(button[aria-pressed="true"],.main-nav button.active,.hobby-steps button.active,.design-option.selected,.site-design-option:has(input:checked),.app-design-choice:has(input:checked),.rail-match.selected) {
    box-shadow:inset 0 0 0 1px var(--dk-e-accent),var(--dk-e-button);
  }
  /* The green recent-game frame has its own pseudo-element; retain active brackets too. */
  :is(#dk-site,#dk-native) .bracket-match.active { box-shadow:var(--dk-e-card),0 0 18px color-mix(in srgb,var(--dk-e-accent) 20%,transparent); }

  /* All action controls share the account link's hover/focus response. */
  :is(#dk-site,#dk-native) :where(button:not(.product-preview):not(.goldglas-phone):not(.screenshot-card):not(.hobby-overview-open),.button,.quiet-button,.site-account,.close-dialog,input[type="button"],input[type="submit"]) {
    --dk-e-control-rest:var(--dk-e-button);
    transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease;
  }
  :is(#dk-site,#dk-native) :is(.button-primary,button.primary,input[type="submit"]) { --dk-e-control-rest:var(--dk-e-primary); }
  #dk-site .site-account { --dk-e-control-rest:var(--dk-e-card); }
  :is(#dk-site,#dk-native) :is(button[aria-pressed="true"],.main-nav button.active,.hobby-steps button.active,.rail-match.selected) {
    --dk-e-control-rest:inset 0 0 0 1px var(--dk-e-accent),var(--dk-e-button);
  }
  :is(#dk-site,#dk-native) :is(button:not(.product-preview):not(.goldglas-phone):not(.screenshot-card):not(.hobby-overview-open),.button,.quiet-button,.site-account,.close-dialog,input[type="button"],input[type="submit"]):focus-visible:not(:disabled):not([aria-disabled="true"]) {
    border-color:var(--dk-e-accent);
    box-shadow:var(--dk-e-control-rest),0 0 20px color-mix(in srgb,var(--dk-e-accent) 30%,transparent);
  }
  @media (hover:hover) and (pointer:fine) {
    :is(#dk-site,#dk-native) :is(button:not(.product-preview):not(.goldglas-phone):not(.screenshot-card):not(.hobby-overview-open),.button,.quiet-button,.site-account,.close-dialog,input[type="button"],input[type="submit"]):hover:not(:active):not(:disabled):not([aria-disabled="true"]) {
      border-color:var(--dk-e-accent);
      box-shadow:var(--dk-e-control-rest),0 0 20px color-mix(in srgb,var(--dk-e-accent) 30%,transparent);
      transform:translateY(var(--dk-e-hover-offset,-2px));
    }
  }
  @media (prefers-reduced-motion:reduce) {
    :is(#dk-site,#dk-native) { --dk-e-hover-offset:0px; }
    :is(#dk-site,#dk-native) :is(button,.button,.quiet-button,.site-account,.close-dialog,input[type="button"],input[type="submit"]) { transition:none; }
  }

  /* Separate rounded navigation buttons instead of a full-height strip. */
  :is(#dk-site,#dk-native) .main-nav { align-items:center;gap:6px;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin; }
  :is(#dk-site,#dk-native) .main-nav button {
    height:auto;
    min-height:44px;
    margin-block:8px;
    padding:10px 12px;
    border:1px solid transparent;
    border-radius:12px;
    white-space:nowrap;
    flex-shrink:0;
  }
  :is(#dk-site,#dk-native) .main-nav button.active { border-color:var(--dk-e-accent); }
  :is(#dk-site,#dk-native) .main-nav button.active::after { display:none; }
}

@media screen and (min-width:901px){:is(#dk-site,#dk-native) .topbar .main-nav button,:is(#dk-site,#dk-native) .topbar .top-actions>button{height:36px;min-height:36px;margin-block:0;padding-block:6px;line-height:1.35;font-size:13px;border-radius:7px;box-shadow:inset 0 1px #ffffff12,0 2px 4px #0003}:is(#dk-site,#dk-native) .topbar .top-actions>button :is(svg,.gold-icon){width:18px;height:18px}}
