body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f7f7fa;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.container {
  background: #fff;
  margin-top: 40px;
  padding: 32px 24px 24px 24px;
  border-radius: 18px;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 420px;
}

h1 {
  font-size: 2rem;
  margin-bottom: 18px;
  color: #333;
}

.controls {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

#colorPicker {
  width: 48px;
  height: 48px;
  border: none;
  background: none;
  cursor: pointer;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.07);
  border-radius: 8px;
  transition: box-shadow 0.2s;
}

#switchCameraBtn {
  padding: 12px 24px;
  font-size: 1rem;
  border: none;
  background-color: #5c67f2;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.07);
}


#colorPicker:focus {
  outline: 2px solid #407dd0;
}

button {
  background: linear-gradient(90deg, #407dd0 0%, #ac8bc4 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.07);
  transition: background 0.2s, box-shadow 0.2s;
}

button:hover {
  background: linear-gradient(90deg, #ac8bc4 0%, #407dd0 100%);
  box-shadow: 0 4px 16px 0 rgba(64, 125, 208, 0.12);
}

.color-table {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 10px 12px;
  background: #f9f9fb;
  border-radius: 12px;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.color-table td {
  padding: 0;
}

.colorCell {
  width: 48px;
  height: 48px;
  border: 2px solid #0000;
  border-radius: 8px;
  transition: border 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.06);
}

.colorCell.active {
  border: 3px solid #407dd0;
  box-shadow: 0 0 0 4px #407dd033;
}

@media (max-width: 600px) {
  .container {
    padding: 16px 4px 16px 4px;
    margin-top: 12px;
  }

  h1 {
    font-size: 1.3rem;
  }

  .color-table {
    max-width: 98vw;
  }

  .colorCell {
    width: 36px;
    height: 36px;
  }

  #colorPicker {
    width: 36px;
    height: 36px;
  }

  button {
    padding: 10px 18px;
    font-size: 0.95rem;
  }
}

video,
canvas {
  width: 100%;
  aspect-ratio: 1280/720;
}

table {
  display: none;
}