/* Solada game UI layer: game search popup, SPA 404 view, legacy game-route guard.
   Loaded at the end of <body> so it wins the cascade over modern-ui / solada-layout injected styles.
   Tokens (--sd-*) come from solada-layout.js; fallbacks are given where it matters. */

/* modern-ui injects a debug "background:red" on body for the legacy SPA route named "game". */
html body { background: var(--sd-bg, #0b0b14) !important; }

/* ───────────────────────── search popup ───────────────────────── */

body.sd-search-open .v-overlay--active { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
/* Sit above the fixed header balance pill (z 1001) while the search is open; the cashier modal (z 10000) stays on top. */
body.sd-search-open .v-overlay--active { z-index: 1002 !important; }
#sd-search-dlg.v-dialog__content { z-index: 1003 !important; }
#sd-search-menu.v-menu__content { z-index: 1004 !important; }
body.sd-search-open .v-overlay--active .v-overlay__scrim { background: #05050b !important; background-color: #05050b !important; opacity: .72 !important; }

#sd-search-dlg.v-dialog__content { align-items: flex-start !important; }
#sd-search-dlg > .v-dialog {
  max-width: 640px !important;
  width: calc(100% - 32px) !important;
  margin: 10vh auto 24px !important;
  border-radius: 22px !important;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .03) !important;
}
#sd-search-dlg .v-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px !important;
  border: 1px solid var(--sd-line2, rgba(255,255,255,.12)) !important;
  background:
    radial-gradient(80% 110% at 100% 0%, rgba(153, 69, 255, .18) 0%, rgba(15, 15, 26, 0) 55%),
    radial-gradient(60% 80% at 0% 100%, rgba(20, 241, 149, .06) 0%, rgba(15, 15, 26, 0) 60%),
    var(--sd-bg2, #0f0f1a) !important;
}
#sd-search-dlg .v-card::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 2;
  background: var(--sd-grad, linear-gradient(90deg, #9945ff 0%, #4a9fe0 55%, #14f195 100%));
}

#sd-search-dlg header.v-toolbar { height: auto !important; background: transparent !important; box-shadow: none !important; }
#sd-search-dlg header.v-toolbar .v-toolbar__content {
  height: auto !important;
  padding: 24px 18px 6px 24px !important;
  gap: 14px;
  align-items: center !important;
}
#sd-search-dlg header.v-toolbar .v-toolbar__content::before {
  content: "";
  flex: 0 0 44px; width: 44px; height: 44px;
  border-radius: 13px;
  border: 1px solid rgba(167, 123, 255, .28);
  background: rgba(153, 69, 255, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a77bff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / 21px no-repeat;
  box-shadow: 0 8px 24px rgba(153, 69, 255, .2);
}
#sd-search-dlg .v-toolbar__title {
  display: block !important;
  min-width: 0;
  flex: 1 1 auto;
  font-family: var(--sd-display, "Sora", sans-serif) !important;
  font-size: 21px !important;
  font-weight: 700 !important;
  letter-spacing: -.02em !important;
  line-height: 1.2 !important;
  color: var(--sd-text, #f4f3fa) !important;
  white-space: normal !important;
  overflow: visible !important;
  padding: 0 !important;
}
#sd-search-dlg .v-toolbar__title::after {
  content: "Slots and table games in one wallet";
  display: block;
  margin-top: 3px;
  font-family: var(--sd-font, "Geist", sans-serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--sd-muted, #8b8ca3);
}
#sd-search-dlg header.v-toolbar .v-btn--icon {
  width: 38px !important; height: 38px !important;
  align-self: flex-start;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, .05) !important;
  border: 1px solid var(--sd-line2, rgba(255,255,255,.12)) !important;
  color: var(--sd-muted, #8b8ca3) !important;
}
#sd-search-dlg header.v-toolbar .v-btn--icon:hover { background: rgba(255, 255, 255, .09) !important; color: var(--sd-text, #f4f3fa) !important; }
#sd-search-dlg header.v-toolbar .v-btn--icon .v-icon { font-size: 20px !important; color: inherit !important; }

#sd-search-dlg .v-card__text { padding: 16px 24px 24px !important; }
#sd-search-dlg .v-card__text > .v-input { padding: 0 !important; margin: 0 !important; }
#sd-search-dlg .v-text-field--outlined > .v-input__control > .v-input__slot {
  min-height: 56px !important;
  padding: 0 18px !important;
  border-radius: 14px !important;
  background: var(--sd-surface, #14141f) !important;
}
#sd-search-dlg .v-text-field--outlined fieldset {
  border: 1px solid var(--sd-line2, rgba(255,255,255,.12)) !important;
  border-radius: 14px !important;
  transition: border-color .15s, box-shadow .15s;
}
#sd-search-dlg .v-input--is-focused fieldset {
  border-color: rgba(167, 123, 255, .75) !important;
  box-shadow: 0 0 0 4px rgba(153, 69, 255, .16);
}
#sd-search-dlg .v-input__prepend-inner { margin-top: 0 !important; align-self: center !important; padding-right: 10px !important; }
#sd-search-dlg .v-input__prepend-inner .v-icon { color: var(--sd-violet, #a77bff) !important; caret-color: var(--sd-violet, #a77bff) !important; font-size: 22px !important; }
#sd-search-dlg .v-select__slot input { color: var(--sd-text, #f4f3fa) !important; caret-color: var(--sd-violet, #a77bff) !important; }
#sd-search-dlg .v-select__slot input::placeholder { color: var(--sd-dim, #6f7184) !important; opacity: 1 !important; font-weight: 500 !important; }

.sd-sw-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.sd-sw-picks > span {
  margin-right: 2px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sd-dim, #6f7184);
}
.sd-sw-picks button {
  height: 32px; padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--sd-line, rgba(255,255,255,.07));
  background: rgba(255, 255, 255, .04);
  color: var(--sd-text, #f4f3fa);
  font-family: var(--sd-font, "Geist", sans-serif);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.sd-sw-picks button:hover { background: rgba(153, 69, 255, .14); border-color: rgba(167, 123, 255, .4); }

/* results menu (Vuetify renders it outside the dialog) */
#sd-search-menu.v-menu__content {
  margin-top: 8px;
  border-radius: 16px !important;
  border: 1px solid var(--sd-line2, rgba(255,255,255,.12)) !important;
  background: var(--sd-surface, #14141f) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6) !important;
}
#sd-search-menu.v-menu__content .v-list { background: transparent !important; padding: 6px !important; }
#sd-search-menu.v-menu__content .v-list-item {
  min-height: 60px !important;
  margin: 2px 0;
  padding: 6px 12px 6px 8px !important;
  border-radius: 12px !important;
  transition: background .12s;
}
#sd-search-menu.v-menu__content .v-list-item::before { opacity: 0 !important; }
#sd-search-menu.v-menu__content .v-list-item:hover,
#sd-search-menu.v-menu__content .v-list-item--highlighted { background: var(--sd-surface2, #1a1a28) !important; }
#sd-search-menu.v-menu__content .v-list-item::after {
  content: "Play";
  min-height: 0 !important;
  margin-left: auto;
  display: inline-flex; align-items: center;
  height: 28px; padding: 0 12px;
  border-radius: 9px;
  background: var(--sd-cta, linear-gradient(135deg, #9945ff 0%, #6d5cff 100%));
  color: #fff;
  font-family: var(--sd-font, "Geist", sans-serif);
  font-size: 12px; font-weight: 700;
  opacity: 0;
  transition: opacity .12s;
}
#sd-search-menu.v-menu__content .v-list-item:hover::after,
#sd-search-menu.v-menu__content .v-list-item--highlighted::after { opacity: 1; }
#sd-search-menu.v-menu__content .v-list-item__icon { margin: 0 14px 0 0 !important; align-self: center !important; }
#sd-search-menu.v-menu__content .game-banner {
  width: 46px !important;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--sd-line, rgba(255,255,255,.07));
}
#sd-search-menu.v-menu__content .v-list-item__title,
#sd-search-menu.v-menu__content .v-list-item__title .subtitle-1 {
  font-family: var(--sd-font, "Geist", sans-serif) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -.01em !important;
  color: var(--sd-text, #f4f3fa) !important;
}

@media (max-width: 600px) {
  #sd-search-dlg > .v-dialog { width: calc(100% - 24px) !important; margin: 12px auto !important; border-radius: 20px !important; }
  #sd-search-dlg .v-card { border-radius: 20px !important; }
  #sd-search-dlg header.v-toolbar .v-toolbar__content { padding: 20px 14px 4px 18px !important; }
  #sd-search-dlg header.v-toolbar .v-toolbar__content::before { flex-basis: 40px; width: 40px; height: 40px; }
  #sd-search-dlg .v-card__text { padding: 14px 18px 20px !important; }
  #sd-search-dlg .v-toolbar__title { font-size: 19px !important; }
}

/* ───────────────────────── SPA 404 view ───────────────────────── */

#app.view-404 .v-main #content { min-height: calc(100vh - 160px); align-items: center; }
#app.view-404 .sd-404-host > :not(#sd-404) { display: none !important; }
#sd-404 { width: 100%; max-width: 660px; margin: 24px auto 40px; text-align: center; }
#sd-404 .sd-404-card {
  position: relative;
  overflow: hidden;
  padding: 44px 36px 36px;
  border-radius: 24px;
  border: 1px solid var(--sd-line, rgba(255,255,255,.07));
  background:
    radial-gradient(70% 90% at 50% 0%, rgba(153, 69, 255, .22) 0%, rgba(15, 15, 26, 0) 65%),
    var(--sd-bg2, #0f0f1a);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
#sd-404 .sd-404-card::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1.2px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 30%, #000 0%, transparent 80%);
  mask-image: radial-gradient(70% 70% at 50% 30%, #000 0%, transparent 80%);
}
#sd-404 .sd-404-card::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--sd-grad, linear-gradient(90deg, #9945ff 0%, #4a9fe0 55%, #14f195 100%));
  opacity: .85;
}
#sd-404 .sd-404-card > * { position: relative; }
#sd-404 .sd-404-orb {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--sd-surface, #14141f);
  border: 1px solid var(--sd-line2, rgba(255,255,255,.12));
  box-shadow: 0 0 0 8px rgba(153, 69, 255, .06), 0 16px 40px rgba(153, 69, 255, .25);
}
#sd-404 .sd-404-orb img { width: 38px; height: 38px; display: block; }
#sd-404 .sd-404-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--sd-line2, rgba(255,255,255,.12));
  color: var(--sd-muted, #8b8ca3);
  font-family: var(--sd-mono, "Geist Mono", monospace);
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
#sd-404 .sd-404-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--sd-violet, #a77bff); box-shadow: 0 0 0 4px rgba(167, 123, 255, .18); }
#sd-404 .sd-404-code {
  display: table;
  margin: 14px auto 0;
  font-family: var(--sd-display, "Sora", sans-serif);
  font-size: 104px; font-weight: 800; line-height: 1; letter-spacing: -.06em;
  background: var(--sd-grad, linear-gradient(90deg, #9945ff 0%, #4a9fe0 55%, #14f195 100%));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 12px 40px rgba(153, 69, 255, .35));
}
#sd-404 .sd-404-title {
  margin: 12px 0 10px;
  font-family: var(--sd-display, "Sora", sans-serif) !important;
  font-size: 28px; font-weight: 700; letter-spacing: -.02em;
  color: var(--sd-text, #f4f3fa);
}
#sd-404 .sd-404-text { margin: 0 auto; max-width: 440px; color: var(--sd-muted, #8b8ca3); font-size: 15px; line-height: 1.6; }
#sd-404 .sd-404-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
#sd-404 .sd-404-popular { margin-top: 22px; text-align: left; }
#sd-404 .sd-404-popular[hidden] { display: none; }
#sd-404 .sd-404-head { margin: 0 2px 12px; font-family: var(--sd-display, "Sora", sans-serif); font-size: 16px; font-weight: 700; color: var(--sd-text, #f4f3fa); }
#sd-404 .sd-404-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#sd-404 .sd-404-game { display: block; text-decoration: none !important; color: inherit; }
#sd-404 .sd-404-art {
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  border: 1px solid var(--sd-line, rgba(255,255,255,.07));
  background: var(--sd-surface, #14141f) center / cover no-repeat;
  transition: transform .2s, box-shadow .2s;
}
#sd-404 .sd-404-game:hover .sd-404-art { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0, 0, 0, .5); }
#sd-404 .sd-404-name {
  display: block;
  padding: 8px 2px 0;
  font-size: 13px; font-weight: 600;
  color: var(--sd-text, #f4f3fa);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 600px) {
  #sd-404 { margin: 12px auto 28px; }
  #sd-404 .sd-404-card { padding: 32px 20px 28px; border-radius: 20px; }
  #sd-404 .sd-404-code { font-size: 80px; }
  #sd-404 .sd-404-title { font-size: 23px; }
  #sd-404 .sd-404-actions .sd-btn { flex: 1 1 100%; }
  #sd-404 .sd-404-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
