* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  --ui-glass-bg: rgba(12, 36, 24, 0.42);
  --ui-glass-blur: blur(24px) saturate(1.5);
  --ui-glass-border: rgba(255, 209, 102, 0.18);
  --ui-glass-highlight: rgba(255, 255, 255, 0.12);
  --ui-gold: #ffd166;
  --ui-gold-deep: #c9a227;
  --ui-text: #f5e6c8;
  --ui-text-muted: rgba(245, 230, 200, 0.72);
  --ui-text-soft: #b7e4c7;
  --ui-radius-lg: 22px;
  --ui-radius-md: 14px;
  --ui-shadow-panel:
    0 20px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --ui-shadow-glow: 0 0 24px rgba(255, 209, 102, 0.12);
  --ui-overlay-bg: rgba(8, 22, 14, 0.58);
  --ui-ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --hud-glass-bg: var(--ui-glass-bg);
  --hud-glass-blur: var(--ui-glass-blur);
  --hud-glass-border: var(--ui-glass-border);
  --hud-accent-gold: var(--ui-gold);
  --hud-accent-green: #52b788;
  --hud-text: var(--ui-text);
  --hud-text-muted: var(--ui-text-soft);
}

html {
  height: -webkit-fill-available;
}

html,
body,
#app {
  width: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #0f2f1f;
  color: #f8f9fa;
}

body,
#app {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  height: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#game-stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  height: -webkit-fill-available;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  min-width: 0;
}

#lightfall-root {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#lightfall-root.lightfall-interactive {
  pointer-events: auto;
}

#pixi-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  overflow: hidden;
  z-index: 1;
  background: #0f2f1f;
}

#pixi-container canvas {
  display: block;
  touch-action: none;
}

#table-magnifier-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  overflow: hidden;
  background: #0f2f1f;
  will-change: opacity;
}

#table-magnifier-overlay canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ui-glass-panel {
  position: relative;
  background: var(--ui-glass-bg);
  backdrop-filter: var(--ui-glass-blur);
  -webkit-backdrop-filter: var(--ui-glass-blur);
  border: 1px solid var(--ui-glass-border);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-panel);
  color: var(--ui-text);
  transform: scale(0.97);
  opacity: 0;
  animation: ui-panel-enter 0.42s var(--ui-ease-out) forwards;
}

.ui-glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(255, 209, 102, 0.28),
    rgba(255, 255, 255, 0.06) 40%,
    rgba(255, 209, 102, 0.12)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes ui-panel-enter {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.user-error-toast {
  position: fixed;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: min(92vw, 420px);
  padding: 0.75rem 1rem;
  border-radius: var(--ui-radius-md);
  background: rgba(120, 24, 32, 0.94);
  border: 1px solid rgba(255, 120, 120, 0.35);
  color: #fff5f5;
  font-family: "Lora", Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.4;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.user-error-toast__dismiss {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.user-error-toast__dismiss:hover {
  opacity: 1;
}
