:root {
  --bg1: #071225;
  --bg2: #0e1b2a;
  --accent: #f6c358;
  --text: #f8fafc;
  --muted: rgba(248, 250, 252, 0.65);
  --item-bg-blur: rgba(255, 255, 255, 0.02);
}

/* Reset & body */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Arial;
}
body {
  background: radial-gradient(
      1200px 800px at 10% 20%,
      rgba(246, 195, 88, 0.06),
      transparent 8%
    ),
    radial-gradient(
      900px 600px at 90% 80%,
      rgba(96, 165, 250, 0.03),
      transparent 12%
    ),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  color: var(--text);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* Stage fills viewport */
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  user-select: none;
  touch-action: none; /* we'll handle pointer events */
}

/* Items (buttons) */
.item {
  position: absolute;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: clamp(8px, 1.2vw, 14px);
  border-radius: 12px;
  cursor: grab;
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1), text-shadow 220ms,
    filter 220ms;
  will-change: transform, left, top;
  text-align: center;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.035);
  background: var(--item-bg-blur);
  backdrop-filter: blur(6px) saturate(120%);
  user-select: none;
  min-width: max-content;
  max-width: 46vw;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.45);
}
.item:active {
  cursor: grabbing;
}

.item .lang {
  font-size: clamp(10px, 0.9vw, 12px);
  letter-spacing: 0.6px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.95;
}
.item .text {
  font-weight: 800;
  line-height: 1;
  font-size: clamp(14px, 2.4vw, 28px); /* responsive text size */
  text-wrap: balance;
  word-break: break-word;
}

/* Hover / focus */
.item:focus,
.item:hover {
  transform: translateY(-6px) scale(1.06) rotate(-0.6deg);
  z-index: 1000;
  filter: drop-shadow(0 12px 26px rgba(2, 6, 23, 0.6));
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 14px rgba(246, 195, 88, 0.08);
  outline: none;
}

/* Dragging */
.dragging {
  transition: none !important;
  transform: scale(1.02) !important;
  z-index: 9999 !important;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.7);
}

/* Brand watermark fixed center */
.brand {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  opacity: 0.06;
  font-weight: 900;
  font-size: clamp(36px, 12vw, 120px);
  color: var(--text);
  letter-spacing: 8px;
  user-select: none;
  z-index: 50;
  white-space: nowrap;
}

/* Hint */
.hint {
  position: fixed;
  left: 12px;
  bottom: 12px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 10px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
  z-index: 200;
}

/* Small screens: increase hit target and spacing, hide some items via JS */
@media (max-width: 420px) {
  .item {
    max-width: 82vw;
    padding: 12px;
    border-radius: 10px;
  }
  .item .text {
    font-size: clamp(14px, 5.2vw, 22px);
  }
  .hint {
    font-size: 12px;
    padding: 10px 12px;
    bottom: 10px;
    left: 10px;
  }
}

/* Landscape phones: make brand smaller */
@media (max-height: 420px) and (orientation: landscape) {
  .brand {
    font-size: clamp(20px, 8vw, 60px);
    opacity: 0.05;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .item,
  .brand {
    transition: none !important;
    animation: none !important;
  }
}
