*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: #f6f7fb;
  color: #223047;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.game-root {
  width: 100%;
  max-width: 1200px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 35, 52, 0.06);
}

.title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.level-indicator {
  font-size: 16px;
  font-weight: 500;
  color: #4c7bd9;
}

.game-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#gameCanvas {
  width: 100%;
  flex: 1;
  border-radius: 16px;
  background: radial-gradient(circle at top, #ffffff 0, #eef2fb 65%, #dde3f4 100%);
  box-shadow: 0 8px 24px rgba(21, 35, 56, 0.16);
}

.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 35, 52, 0.08);
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feed-label {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7b8799;
}

.feed-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bubble-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bubble-caption {
  font-size: 11px;
  color: #9aa5b8;
}

.ui-bubble {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, #ffeaa7 0, #f9c74f 35%, #f39c12 80%);
  color: #1d2935;
  font-weight: 600;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(240, 180, 60, 0.4);
}

.ui-bubble-next {
  opacity: 0.6;
  transform: scale(0.88);
}

.swap-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #edf2ff;
  color: #4c6fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(46, 67, 144, 0.25);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out,
    background 0.1s ease-out;
}

.swap-button:active {
  transform: scale(0.93);
  box-shadow: 0 1px 4px rgba(46, 67, 144, 0.18);
  background: #dde6ff;
}

.session-controls {
  display: flex;
  gap: 8px;
}

.primary-button,
.secondary-button {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: transform 0.08s ease-out, box-shadow 0.1s ease-out,
    background 0.1s ease-out;
}

.primary-button {
  background: linear-gradient(135deg, #4c6fff, #6c8cff);
  color: white;
  box-shadow: 0 3px 10px rgba(54, 84, 211, 0.4);
}

.primary-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(54, 84, 211, 0.35);
}

.secondary-button {
  background: #f1f4ff;
  color: #4c6fff;
  box-shadow: 0 2px 8px rgba(69, 88, 170, 0.18);
}

.secondary-button:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 48, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  min-width: 260px;
  padding: 20px 24px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(10, 24, 48, 0.35);
  text-align: center;
}

.overlay-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.overlay-message {
  font-size: 14px;
  margin-bottom: 16px;
  color: #64748b;
}

.overlay-actions {
  display: flex;
  justify-content: center;
}

@media (max-width: 900px) {
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .session-controls {
    justify-content: flex-end;
  }
}


