/* Shared roll-zone ownership
   Landing ends with discovery tiles. The shared dice surface is reserved for
   tool and game views that explicitly own dice gameplay. */

.landing:has(> .discovery:not(.is-game-view)) {
  grid-template-rows: minmax(0, 1fr) 0;
}

.landing > .discovery:not(.is-game-view) {
  padding-bottom: clamp(18px, 4vh, 32px);
  overflow-y: auto;
}

.discovery:not(.is-game-view) + .roll-zone {
  display: none;
}

.discovery.is-game-view + .roll-zone {
  display: none;
}

/* Standalone tool views that explicitly own the shared roll zone. */
.discovery.is-dice-tool-view + .roll-zone {
  display: flex;
}

.discovery.is-coin-tool-view + .roll-zone {
  display: flex;
}

/* Coin owns a full-size stage even when the viewport is short. Allocate the
   stage from the real viewport height, let the Coin UI use/scroll the remainder,
   and keep any spare space below the action as an AdSpace safety reserve. */
.landing:has(> .discovery.is-coin-tool-view) {
  grid-template-rows: minmax(0, 1fr) clamp(370px, 44dvh, 390px);
}

.discovery.is-coin-tool-view + .roll-zone {
  justify-content: flex-start;
  gap: clamp(8px, 1.25vh, 13px);
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.discovery.is-coin-tool-view + .roll-zone .coin-flip-button {
  width: clamp(220px, 54vw, 285px) !important;
  height: clamp(220px, 54vw, 285px) !important;
}

/* Lift the rendered coin exposure across the catalog. Darker source strikes
   (notably CZK) otherwise lose face detail against Cubiri's black stage.
   Presentation-only: geometry, PBR materials and maps stay untouched. */
.discovery.is-coin-tool-view + .roll-zone .coin-real-v2-canvas {
  filter: brightness(2);
}

/* Dice-driven game components that explicitly own the shared roll zone. */
.landing:has(.game-tab-content[data-game-component="autoscoring"]) .roll-zone,
.landing:has(.game-tab-content[data-game-component="monopoly-roll"]) .roll-zone,
.landing:has(.game-tab-content[data-game-component="farkle-scoring"]) .roll-zone,
.landing:has(.game-tab-content[data-game-component="jamb-scoring"]) .roll-zone,
.landing:has(.game-tab-content[data-game-component="roll"]) .roll-zone {
  display: flex;
}

/* MAGDAGDON owns its four Cubiri 3D dice inside the game component itself.
   Its D1 module intentionally uses the generic `roll` module id only as a
   Game Page host, so the shared bottom roller must never be exposed here. */
.landing:has(.game-tab-content[data-game-id="magdagdon"][data-game-component="roll"]) .roll-zone,
.roll-zone.is-magdagdon-suppressed {
  display: none !important;
}
