body.mode-lobby,
body.mode-game {
  overflow: hidden;
  height: 100vh;
}

body.mode-lobby .shell,
body.mode-game .shell {
  height: 100vh;
  overflow: hidden;
}

#play-view {
  --play-shell-min-height: calc(100vh - 60px);
  background: transparent;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  position: relative;
  overflow-x: hidden;
  overflow-y: hidden;
}

body.mode-intent-loading #play-view .play-topbar,
body.mode-intent-loading #play-view .play-stage {
  visibility: hidden;
}

body.mode-intent-loading #play-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(255, 214, 156, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(16, 19, 28, 0.96) 0%, rgba(18, 22, 31, 0.98) 100%);
  z-index: 4;
}

body.mode-intent-loading #play-view::after {
  content: attr(data-loading-label);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 280px;
  max-width: min(520px, calc(100vw - 48px));
  padding: 16px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 22, 31, 0.88);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  color: #f3efe6;
  text-align: center;
  font: 700 1rem/1.35 var(--hybrid-font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 5;
}

.play-topbar {
  height: 60px;
  min-height: 60px;
  display: grid !important;
  grid-template-columns: auto 140px minmax(0, 1fr) auto;
  background: rgba(18, 22, 28, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 100;
  overflow: clip;
}

.topbar-block {
  height: 60px;
  min-height: 60px;
  overflow: hidden;
  border-right: 1px solid rgba(0, 0, 0, 0.26);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
}

.topbar-block-room {
  gap: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 20px;
  text-align: center;
  border-left: none;
  border-right: none;
  min-width: 300px;
}

.topbar-block-room strong {
  max-width: 100%;
  font-size: 1.05rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  white-space: nowrap;
  font-weight: 800;
}

.topbar-room-count {
  font-size: 0.72rem;
  line-height: 1.2;
  color: #8b9aa7;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}

.hybrid-topbar-meta {
  display: inline-flex;
  gap: 8px;
  color: #bfac7d;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0;
}

.hybrid-topbar-subtitle {
  font-size: 0.72rem;
  line-height: 1.4;
  color: #8b9aa7;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
  text-align: center;
}

.hybrid-topbar-separator-kicker,
.hybrid-topbar-separator-scene {
  opacity: 0.5;
}

.topbar-block:last-child {
  border-right: none;
}

.topbar-histo        { grid-column: 1; }
.hybrid-topbar-clock { grid-column: 2; }
.topbar-block-room   { grid-column: 3; }
.topbar-block-icons  { grid-column: 4; }

.hybrid-topbar-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 0 6px;
  gap: 2px;
  white-space: nowrap;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Caché : rendre le texte transparent sans toucher au layout ni créer de couche GPU */
.hybrid-topbar-clock.hidden .topbar-timer-label,
.hybrid-topbar-clock.hidden .topbar-timer-value {
  color: transparent !important;
  text-shadow: none !important;
  pointer-events: none;
}

.topbar-timer-label {
  font-family: var(--hybrid-font-ui);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hybrid-muted);
  line-height: 1;
  transition: color 0.2s ease;
}

.topbar-timer-value {
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 0.92rem;
  color: var(--hybrid-text);
  line-height: 1;
  transition: color 0.2s ease;
}

.hybrid-topbar-clock.is-urgent .topbar-timer-value {
  color: #ff4757;
  text-shadow: 0 0 8px rgba(255, 71, 87, 0.4);
}

.hybrid-phase-masthead {
  display: none !important;
}

.play-stage {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  height: var(--play-shell-min-height);
  align-items: stretch;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.play-grid {
  display: grid;
  flex: 1 1 auto;
  width: calc(100% - 16px);
  height: 100%;
  padding: 6px 0;
  margin: 0 auto;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: 276px minmax(0, 1fr) 308px;
  gap: 8px;
  align-self: stretch;
  align-items: stretch;
}

.play-column {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.play-column-center {
  display: flex;
  flex-direction: column;
  align-self: start;
  min-height: 0;
  height: 100%;
}

.play-column-center .legacy-center-board {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  gap: 0 !important;
  padding-bottom: 0 !important;
}

.play-column-left,
.play-column-right {
  align-self: start;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.play-column-left::-webkit-scrollbar,
.play-column-right::-webkit-scrollbar {
  display: none;
}

.play-column-left,
.play-column-right {
  padding-bottom: 6px;
  box-sizing: border-box;
}

.topbar-icon-btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  background-size: 18px 18px;
}

@media (min-width: 1900px) {
  #play-view {
    --play-shell-min-height: calc(100vh - 62px);
  }

  .play-topbar {
    min-height: 54px;
    grid-template-columns: 170px 140px minmax(0, 1fr) auto;
  }

  .topbar-block {
    min-height: 54px;
  }

  .topbar-block-room {
    gap: 4px;
    padding: 6px 14px;
  }

  .topbar-block-room strong {
    font-size: 1rem;
  }

  .topbar-room-count {
    font-size: 0.76rem;
  }

  .play-grid {
    flex: 0 0 auto;
    width: min(1416px, calc(100% - 24px));
    padding: 8px 0;
    margin: 0 auto;
    grid-template-columns:
      clamp(320px, 24vw, 348px)
      minmax(0, 1fr)
      clamp(320px, 24vw, 344px);
    gap: 12px;
  }

  body.history-open .play-grid {
    width: min(1416px, calc(100% - 284px));
    margin-left: 260px;
    margin-right: 12px;
  }

  .play-column {
    gap: 8px;
  }

  .play-column-left,
  .play-column-right {
    padding-bottom: 8px;
  }

  .topbar-icon-btn {
    width: 41px;
    min-width: 41px;
    height: 41px;
    background-size: 20px 20px;
  }
}

.hybrid-phase-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--hybrid-border-strong);
  border-radius: var(--hybrid-radius-lg);
  background: var(--hybrid-bg-panel);
  backdrop-filter: var(--hybrid-glass-blur);
  box-shadow: var(--hybrid-shadow-md);
}

.hybrid-phase-kicker {
  margin-bottom: 4px;
  color: var(--hybrid-gold);
  font: 700 0.73rem/1 var(--hybrid-font-ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hybrid-phase-title {
  color: var(--hybrid-ink);
  font: 400 1.6rem/1 var(--hybrid-font-title);
}

.hybrid-phase-subtitle {
  margin-top: 6px;
  color: var(--hybrid-muted);
  font-size: 1rem;
}

.hybrid-phase-clock {
  min-width: 128px;
  padding: 12px 14px;
  border-radius: var(--hybrid-radius-md);
  background: rgba(12, 8, 7, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: right;
}

.hybrid-phase-clock-label {
  display: block;
  color: var(--hybrid-muted);
  font: 700 0.72rem/1 var(--hybrid-font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hybrid-phase-clock-value {
  display: block;
  margin-top: 6px;
  color: var(--hybrid-gold-soft);
  font: 700 1.6rem/1 var(--hybrid-font-ui);
}

.hybrid-phase-masthead.is-urgent .hybrid-phase-clock-value {
  color: #ffd8cf;
}

body.mode-lobby .hybrid-phase-masthead {
  display: none;
}

/* New action group for the role card */
.play-column-center .hybrid-game-action-group {
  display: none !important;
}

/* Ensure children are properly sized */
.legacy-action-card {
  min-width: 0;
  min-height: 0;
}

/* Classic theme: Acme is wider than Montserrat — scale down the topbar headline */
body[data-theme="classic"] .topbar-block-room strong {
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

/* Classic theme: compact clock label to fit in 140px fixed block */
body[data-theme="classic"] .hybrid-topbar-clock {
  gap: 5px;
}
body[data-theme="classic"] .topbar-timer-label {
  letter-spacing: 0.03em;
}
