/* Shared chrome for Hexsweeper skins + lab */
*, *::before, *::after { box-sizing: border-box; }

.skin-nav {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  pointer-events: none;
}
.skin-nav a, .skin-nav button {
  pointer-events: auto;
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--nav-ink, #4a5568) 35%, transparent);
  background: color-mix(in srgb, var(--nav-bg, #e0e5ec) 88%, transparent);
  color: var(--nav-ink, #4a5568);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 8px 12px;
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.skin-nav a:hover, .skin-nav button:hover { transform: translateY(-1px); }
.skin-nav a:active, .skin-nav button:active { transform: scale(0.96); }
.skin-nav .meta {
  pointer-events: none;
  opacity: 0.7;
  padding: 0 4px;
  max-width: min(42vw, 220px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skin-nav .tag {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
}

.settings-btn {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  color: var(--text-main, #4a5568);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  z-index: 20;
  border-radius: 12px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
}
.settings-btn svg { width: 26px; height: 26px; stroke-width: 2; }
.settings-btn:hover { opacity: 0.75; }
.settings-btn:active { transform: scale(0.88); }
.settings-btn:focus-visible {
  outline: 2px solid var(--text-main, #4a5568);
  outline-offset: 2px;
}
.canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 1;
}
canvas { display: block; cursor: crosshair; max-width: 100%; }

.bottom-bar {
  position: absolute;
  bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 10px;
  z-index: 10;
  pointer-events: none;
}
.stat-item {
  font-family: "Segoe UI Mono", "Roboto Mono", monospace;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-main, #4a5568);
  min-width: 40px;
  width: auto;
  padding: 0 4px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
  /* Endless scores can climb past 999 */
  font-variant-numeric: tabular-nums;
}
.stat-item.visible { opacity: 1; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg-color, #e0e5ec) 90%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(8px);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-content {
  background: var(--bg-color, #e0e5ec);
  color: var(--text-main, #4a5568);
  padding: 30px;
  border-radius: 30px;
  width: 280px;
  text-align: center;
  border: 2px solid var(--text-main, #4a5568);
  transform: scale(0.95);
  transition: transform 0.2s ease;
  position: relative;
}
.modal-overlay.open .modal-content { transform: scale(1); }
.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-sub, #a0aec0);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close-btn:hover { color: var(--text-main, #4a5568); }
.modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  padding: 0 10px;
}
.icon-label {
  color: var(--text-main, #4a5568);
  display: flex;
  align-items: center;
  justify-content: center;
}
.diff-selector { display: flex; gap: 5px; }
.diff-option {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--text-sub, #a0aec0);
  border-radius: 8px;
  color: var(--text-sub, #a0aec0);
  background: transparent;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 0;
  line-height: 1;
}
.diff-option:hover {
  border-color: var(--text-main, #4a5568);
  color: var(--text-main, #4a5568);
}
.diff-option.active,
.diff-option[aria-pressed="true"] {
  background: var(--text-main, #4a5568);
  border-color: var(--text-main, #4a5568);
  color: var(--bg-color, #e0e5ec);
}
.diff-option:focus-visible {
  outline: 2px solid var(--text-main, #4a5568);
  outline-offset: 2px;
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: transparent;
  border: 2px solid var(--text-sub, #a0aec0);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.toggle-switch.active {
  background: var(--text-main, #4a5568);
  border-color: var(--text-main, #4a5568);
}
.toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: var(--text-sub, #a0aec0);
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch.active .toggle-knob {
  background: var(--bg-color, #e0e5ec);
  transform: translateX(20px);
}
.refresh-btn {
  width: 60px;
  height: 60px;
  margin: 10px auto 0 auto;
  border: none;
  border-radius: 50%;
  background: var(--text-main, #4a5568);
  color: var(--bg-color, #e0e5ec);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.refresh-btn:active { transform: scale(0.9); opacity: 0.9; }
.instructions-text {
  margin-top: 25px;
  font-size: 11px;
  color: var(--text-sub, #a0aec0);
  line-height: 1.5;
  text-align: center;
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
