/* WoCircle shared game chrome: back button + language toggle */
.wc-chrome {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.wc-chrome a,
.wc-chrome button {
  pointer-events: auto;
  appearance: none;
  text-decoration: none;
  border: 1px solid rgba(248, 250, 252, 0.2);
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.wc-back {
  padding: 10px 14px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wc-back:hover,
.wc-lang button:hover {
  background: rgba(249, 115, 22, 0.92);
  border-color: #f97316;
  color: #fff;
}
.wc-lang {
  pointer-events: auto;
  display: inline-flex;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(248, 250, 252, 0.2);
  border-radius: 999px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.wc-lang button {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  min-height: 40px;
  padding: 0 11px;
  font-size: 12px;
}
.wc-lang button[aria-pressed="true"] {
  background: #f97316;
  color: #fff;
}
.wc-portal-lang {
  display: inline-flex;
  margin-left: 8px;
  background: var(--surface, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 999px;
  overflow: hidden;
}
.wc-portal-lang button {
  background: transparent;
  color: var(--text-sub, #94a3b8);
  border: 0;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 28px;
}
.wc-portal-lang button[aria-pressed="true"] {
  background: var(--primary, #f97316);
  color: #fff;
}
.navbar .nav-brand {
  flex-wrap: wrap;
}
.btn-like-card.is-liked,
.btn-like.is-liked {
  border-color: #f97316;
  color: #fdba74;
}
.roast-feedback {
  font-size: 12px;
  color: #94a3b8;
  margin: -6px 0 10px;
  min-height: 1em;
}
.liked-hint { color: #fdba74; }

/* Keep the chrome from covering ring-toss left stats */
body.wc-game-ring-toss header.top-bar {
  padding-left: 168px;
}
@media (max-width: 640px) {
  /* Reserve a strip above the full-width game so the chip does not cover the HUD.
     (Header padding alone lost to later .top-bar shorthand in the game stylesheet.) */
  body.wc-game-ring-toss {
    padding-top: calc(env(safe-area-inset-top, 0px) + 52px);
    box-sizing: border-box;
  }
  body.wc-game-ring-toss header.top-bar {
    padding-left: 14px;
    padding-top: 10px;
  }
  body.wc-game-ring-toss .wc-chrome {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
  }
  .wc-chrome {
    top: max(6px, env(safe-area-inset-top));
    left: max(6px, env(safe-area-inset-left));
  }
  /* Shooters: lift chrome slightly and shrink so HUD stays usable */
  body.wc-game-flash-strike .wc-chrome,
  body.wc-game-tactical-rescue .wc-chrome,
  body.wc-game-neon-void .wc-chrome,
  body.wc-game-cyber-bastion .wc-chrome {
    top: max(6px, env(safe-area-inset-top));
  }
}

/* Aetheria: sit below the fixed top biome panel so the chip does not cover HUD */
body.wc-game-aetheria .wc-chrome {
  top: max(148px, calc(env(safe-area-inset-top) + 136px));
  left: max(16px, env(safe-area-inset-left));
}

/* Start-overlay typography only: stack control legends on narrow phones */
@media (max-width: 720px) {
  body.wc-game-flash-strike .controls-grid,
  body.wc-game-tactical-rescue .controls-grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    padding: 12px 14px;
    box-sizing: border-box;
  }
  body.wc-game-flash-strike .ctrl-item,
  body.wc-game-tactical-rescue .ctrl-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    line-height: 1.45;
  }
}

html.wc-await-i18n body { visibility: hidden; }
html.wc-i18n-ready body { visibility: visible; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  background: #f97316;
  color: #fff;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 2147483001;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}
.nav-home {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.nav-home:hover .logo-text {
  filter: brightness(1.08);
}
:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

/* Fit the fixed 1100x700 shooter frames to small viewports and let start overlays scroll */
@media (max-width: 1100px) {
  body.wc-game-flash-strike #game-container,
  body.wc-game-tactical-rescue #game-container {
    width: min(1100px, 100vw - 8px);
    height: min(700px, 100vh - 8px);
    max-width: 100vw;
    max-height: 100vh;
  }
  body.wc-game-flash-strike .overlay,
  body.wc-game-tactical-rescue .overlay {
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 58px 16px 24px;
    box-sizing: border-box;
  }
  body.wc-game-flash-strike .overlay h1,
  body.wc-game-tactical-rescue .overlay h1 {
    margin-top: 0;
    font-size: clamp(26px, 7vw, 42px);
  }
  body.wc-game-flash-strike .controls-grid,
  body.wc-game-tactical-rescue .controls-grid {
    margin-bottom: 16px;
  }
  body.wc-game-flash-strike .overlay .btn,
  body.wc-game-tactical-rescue .overlay .btn {
    flex-shrink: 0;
    margin-top: 4px;
  }
}
