/* Compact first-party controls and reserved, non-overlapping ad placements. */
.ena-ad-slot, .ena-welcome, .ena-ad-preferences {
  box-sizing: border-box;
  color: #e8e7ef;
  font: 400 12px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: left;
  letter-spacing: normal;
  user-select: text;
}
.ena-ad-slot[hidden], .ena-ad-anchor[hidden],
.ena-privacy-choice[hidden], .ena-ad-status[hidden], .ena-welcome:not([open]) { display: none !important; }
.ena-ad-anchor { display: block; width: 100%; height: 1px; padding: 0; margin: 0; pointer-events: none; }
.ena-ad-slot { width: min(100%, 970px); max-width: 100%; margin: 14px auto 22px; overflow: hidden; }
.ena-ad-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 30px; padding: 4px 2px; }
.ena-ad-label { color: #85828f; font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.ena-privacy-link { color: #b9b1cf !important; font: 400 10px/1.4 Inter, system-ui, sans-serif; text-decoration: underline; text-underline-offset: 3px; }
.ena-ad-surface { position: relative; display: block; box-sizing: content-box; max-width: 100%; margin-inline: auto; padding: 0; border: 0; overflow: hidden; }
.ena-ad-surface > iframe { display: block; margin: 0; border: 0; }
.ena-ad-status { display: block; padding: 5px 2px; color: #96919e; font-size: 10px; }
.ena-ad-slot--home-rectangle, .ena-ad-slot--welcome { width: 300px; }
body > .ena-ad-anchor--setup, body > .ena-ad-slot--setup { width: min(970px, calc(100% - 24px)); margin-inline: auto; }
body > .ena-ad-anchor--setup { margin-top: 16px; }
body > .ena-ad-slot--setup { margin-bottom: max(20px, env(safe-area-inset-bottom, 0px)); }
.ena-ad-slot--welcome { margin: 12px auto 10px; }

.ena-privacy-copy { margin: 0; color: #d2cedf; font-size: 12px; line-height: 1.55; font-weight: 400; letter-spacing: normal; }
.ena-privacy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ena-privacy-choice .ena-privacy-button, .ena-welcome-continue {
  appearance: none; display: inline-flex; justify-content: center; align-items: center;
  box-sizing: border-box; min-width: 106px; min-height: 40px; margin: 0; padding: 9px 15px;
  border: 1px solid #74688e; border-radius: 8px; color: #f3edff; background: #292333;
  font: 600 12px/1.4 Inter, system-ui, sans-serif; letter-spacing: normal; text-transform: none;
  box-shadow: none; transform: none; cursor: pointer;
}
.ena-privacy-choice .ena-privacy-button:hover:not(:disabled), .ena-welcome-continue:hover { background: #393044; border-color: #a697c2; transform: none; }
.ena-privacy-choice .ena-privacy-button[aria-pressed="true"] { border-color: #bcabda; }
.ena-privacy-choice .ena-privacy-button:disabled { opacity: .5; cursor: not-allowed; }
.ena-privacy-choice :focus-visible, .ena-welcome :focus-visible, .ena-ad-heading :focus-visible { outline: 3px solid #b6a3f4; outline-offset: 3px; }
.ena-welcome {
  position: fixed; z-index: 110; inset: auto 22px 22px auto; display: block;
  width: min(368px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow: auto;
  margin: 0; padding: 24px 22px 18px; border: 1px solid #685b7e; border-radius: 18px;
  background: linear-gradient(145deg, #211b2c, #121018); box-shadow: 0 16px 60px #0008;
}
.ena-welcome-close { position: absolute; top: 6px; right: 7px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; color: #c8c0d7; background: transparent; font: 400 24px/1 system-ui; cursor: pointer; }
.ena-welcome-close:hover { background: #ffffff0c; }
.ena-welcome-kicker { display: block; margin: 1px 20px 10px 0; color: #b9e477; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.ena-welcome .ena-welcome-title { margin: 0 16px 14px 0; color: #faf8ff; font: 650 22px/1.15 Inter, system-ui, sans-serif; letter-spacing: -.035em; }
.ena-welcome-continue { width: 100%; margin-top: 12px; color: #bcb4ca; background: transparent; border-color: #ffffff1a; font-weight: 500; }
.ena-welcome .ena-privacy-actions { gap: 8px; }
.ena-welcome .ena-privacy-link { flex-basis: 100%; margin-top: 2px; }
.ena-ad-preferences { padding: 15px; margin-top: 18px; border: 1px solid #645473; border-radius: 12px; background: #1b1722; }

/* Rail coordinates are measured in the viewport, outside boards and controls.
   Never add grid tracks, shrink a game, or move its existing controls. */
.ena-ad-anchor--chess-rail, .ena-ad-slot--chess-rail,
.ena-ad-anchor--game-rail, .ena-ad-slot--game-rail { position: fixed; z-index: 6; margin: 0; }
.ena-ad-slot--chess-rail, .ena-ad-slot--game-rail, .ena-ad-slot--game-pause { background: #201a2c; border-radius: 7px; }
.ena-ad-slot--game-pause { position: relative; grid-column: 1 / -1; flex: 0 0 auto; max-width: 100%; margin: 12px auto 0; }
/* A pause slot lives inside the real dialog, including native top-layer dialogs.
   Its observation marker must not create a second grid row or extra height. */
.ena-ad-anchor--game-pause { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; }
.ena-ad-slot--chess-rail .ena-ad-heading,
.ena-ad-slot--game-rail .ena-ad-heading,
.ena-ad-slot--game-pause .ena-ad-heading {
  box-sizing: border-box; height: 38px; min-height: 38px; max-height: 38px;
  padding: 4px 5px; gap: 4px; overflow: hidden;
}
.ena-ad-slot--chess-rail .ena-ad-label,
.ena-ad-slot--game-rail .ena-ad-label,
.ena-ad-slot--game-pause .ena-ad-label { flex: 1 1 auto; min-width: 0; font-size: 7px; line-height: 1.2; letter-spacing: .03em; }
.ena-ad-slot--chess-rail .ena-privacy-link,
.ena-ad-slot--game-rail .ena-privacy-link,
.ena-ad-slot--game-pause .ena-privacy-link { flex: 0 1 auto; min-width: 0; font-size: 8px; line-height: 1.2; }
.ena-ad-slot .ena-ad-heading > .ena-ad-close[data-ena-ad-close] {
  appearance: none; box-sizing: border-box; position: static; display: inline-flex;
  flex: 0 0 24px; align-items: center; justify-content: center;
  width: 24px; min-width: 24px; max-width: 24px; height: 24px; min-height: 24px; max-height: 24px;
  margin: 0; padding: 0; border: 1px solid #796b8c; border-radius: 5px;
  color: #f2edf9; background: #352c43; box-shadow: none; transform: none;
  font: 400 18px/1 Inter, system-ui, sans-serif; letter-spacing: normal;
  text-transform: none; cursor: pointer; touch-action: manipulation;
}
.ena-ad-slot .ena-ad-heading > .ena-ad-close[data-ena-ad-close]:hover { color: #fff; background: #4a3e5b; box-shadow: none; transform: none; }
.ena-ad-slot .ena-ad-heading > .ena-ad-close[data-ena-ad-close]:active { transform: none; box-shadow: none; }
.ena-ad-slot .ena-ad-status--game {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Setup-only scrolling while ads are on; gameplay stays full-size. */
html.ena-ads-menu { height: auto !important; min-height: 100%; overflow-x: hidden !important; overflow-y: auto !important; }
body.ena-ads-menu { height: auto !important; min-height: 100vh; min-height: 100dvh; overflow-x: hidden !important; overflow-y: visible !important; }
body.ena-ads-menu > [data-ena-ad-viewport-root] { height: 100vh !important; height: 100dvh !important; }
@media (max-width: 700px) {
  .ena-welcome { right: 12px; bottom: 12px; padding-inline: 20px; }
}
