/* Prevent iOS bounce and enable fixed layout */
html, body {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
}

/* Fast taps - no 300ms delay */
*, *::before, *::after {
  touch-action: manipulation;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  /* Safe area handling */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

header {
  text-align: center;
  padding: 16px;
  flex-shrink: 0;
}

header h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
}

header p {
  margin: 0;
  font-size: 14px;
  opacity: 0.7;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 20px;
  overflow: hidden;
}

/* Draggable items container */
.draggables-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  min-height: 80px;
}

/* Draggable items */
.draggable {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.draggable.dragging {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0.9;
  cursor: grabbing;
}

.draggable.in-zone {
  width: 50px;
  height: 50px;
  font-size: 11px;
}

/* Drop zones container */
.drop-zones-container {
  display: flex;
  gap: 16px;
  flex: 1;
}

/* Drop zones */
.drop-zone {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 12px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.drop-zone.drag-over {
  background: rgba(46, 204, 113, 0.2);
  border-color: #2ecc71;
}

.zone-label {
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.7;
  margin-bottom: 12px;
}

.dropped-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  justify-content: center;
}

/* Reset button */
#reset-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

#reset-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

footer {
  text-align: center;
  padding: 12px;
  font-size: 12px;
  opacity: 0.5;
  flex-shrink: 0;
}

/* Placeholder for empty draggables container */
.draggables-container:empty::after {
  content: 'All items dropped!';
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}
