body {
  background: #ffefba;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 40px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #5a4d4d;
  min-height: 100vh;
}

.project-title {
  font-weight: 900;
  font-size: 2.5rem;
  margin: 0 0 25px 0;
  text-align: center;
  user-select: none;
  color: #a47474;
}

.title-glow {
  position: relative;
  font-weight: 900;
  font-size: 2rem;
  color: #a47474;
  display: inline-block;
  cursor: default;
  transition: color 0.3s ease;
  user-select: none;
}

.title-glow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #f6b6b6, #fbd7ce);
  box-shadow: 0 0 10px rgba(246, 182, 182, 0.5);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: opacity 0.3s ease, transform 0.3s ease;
  border-radius: 2px;
}

.title-glow:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.container {
  background: #ffffff;
  max-width: 420px;
  width: 100%;
  padding: 30px 35px;
  border-radius: 25px;
  box-shadow: 8px 8px 20px rgba(229, 213, 204, 0.7), -8px -8px 20px rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

label {
  font-weight: 600;
  font-size: 1rem;
  color: #a47474;
  user-select: none;
  margin-bottom: 4px;
}

input[type="number"],
input[type="text"] {
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 14px;
  border: 2px solid #f1d5d5;
  background: #fff6f6;
  box-shadow: inset 3px 3px 6px #e7cfcf, inset -3px -3px 6px #ffffff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
  color: #5a4d4d;
  width: 100%;
  box-sizing: border-box;
}

input::placeholder {
  color: #ccbebe;
  font-style: italic;
}

input:focus {
  border-color: #f6b6b6;
  box-shadow: 0 0 12px 2px rgba(246, 182, 182, 0.6);
  background: #fff0f0;
}

.error {
  color: #b04a4a;
  font-size: 0.85rem;
  margin-top: -10px;
  margin-bottom: 10px;
  min-height: 18px;
  user-select: none;
}

.checkbox-label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a47474;
  cursor: pointer;
  user-select: none;
}

.small-text {
  font-size: 0.85rem;
  color: #b9a6a6;
  margin-bottom: 10px;
}

.btn-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

button {
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
  padding: 12px 18px;
  min-width: 90px;
  transition: background 0.4s ease, transform 0.15s ease;
  border: none;
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #f6b6b6, #f9d8d8);
  color: #7a3f3f;
  box-shadow: 5px 5px 10px rgba(246, 182, 182, 0.5), -5px -5px 10px #fff0f0;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: linear-gradient(135deg, #f9d8d8, #f6b6b6);
  outline: none;
  transform: scale(1.05);
}

.btn-primary:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 18px rgba(246, 182, 182, 0.8);
  animation: pulse-glow 1.6s infinite;
  z-index: -1;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0px rgba(246, 182, 182, 0.6);
  }

  50% {
    box-shadow: 0 0 20px rgba(246, 182, 182, 0.9);
  }

  100% {
    box-shadow: 0 0 0px rgba(246, 182, 182, 0.6);
  }
}

.btn-secondary {
  background-color: #f4c7c3;
  color: #7a4d49;
  box-shadow: 5px 5px 10px rgba(210, 150, 150, 0.5), -5px -5px 10px #f7e6e6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background-color: #e6b0aa;
  color: #7a4d49;
  outline: none;
}

.btn-outline-dark {
  border: 2px solid #7a4d49;
  background: transparent;
  color: #7a4d49;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus-visible {
  background-color: #7a4d49;
  color: #fff6f6;
  outline: none;
}

.btn-glow {
  background: linear-gradient(135deg, #f9c9b6, #fbd7ce);
  color: #7a4d49;
  font-weight: 700;
  border-radius: 30px;
  padding: 15px 30px;
  font-size: 1.2rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 8px #fbd7ce, 0 0 16px #f9c9b6;
  transition: box-shadow 0.4s ease;
  user-select: none;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-glow::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 180deg, #f9c9b6, #fbd7ce, #f9c9b6, #fbd7ce, #f9c9b6);
  animation: rotateGlow 4s linear infinite;
  z-index: -1;
  opacity: 0.3;
}

@keyframes rotateGlow {
  to {
    transform: rotate(360deg);
  }
}

.btn-glow:hover,
.btn-glow:focus-visible {
  box-shadow: 0 0 14px #fbd7ce, 0 0 28px #f9c9b6;
  outline: none;
}

.result-box {
  max-height: 160px;
  overflow-y: auto;
  background: #fff6f6;
  border-left: 6px solid #f6b6b6;
  padding: 15px 20px;
  border-radius: 18px;
  color: #7a3f3f;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 3px 3px 8px rgba(246, 182, 182, 0.25);
  user-select: text;
  white-space: pre-line;
  margin-top: 10px;
}

canvas {
  margin-top: 28px;
  border-radius: 18px;
  box-shadow: 8px 8px 25px rgba(246, 182, 182, 0.3);
  width: 100% !important;
  height: auto !important;
  transition: transform 0.3s ease;
}

canvas:hover,
canvas:focus-visible {
  transform: scale(1.05);
  outline: none;
  box-shadow: 0 0 20px 4px rgba(246, 182, 182, 0.6);
}

footer {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

@media (max-width: 480px) {
  .container {
    max-width: 280px;
    padding: 15px 15px;
  }

  button {
    font-size: 1rem;
    min-width: 70px;
    padding: 8px 10px;
  }

  .btn-glow {
    font-size: 0.9rem;
    padding: 10px 20px;
  }
}


body.dark-mode {
  background: #222;
  color: #ccc;
}

body.dark-mode .container,
body.dark-mode .result-box {
  background: rgba(51, 51, 51, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ccc;
}

body.dark-mode input[type="number"],
body.dark-mode input[type="text"] {
  background: #444;
  border: 2px solid #666;
  color: #f3dede;
  box-shadow: none;
}

body.dark-mode input::placeholder {
  color: #d1bcbc;
}

body.dark-mode input:focus {
  border-color: #a67c7c;
  box-shadow: 0 0 12px 2px rgba(166, 124, 124, 0.6);
  background: #5a3f3f;
}

body.dark-mode .btn-primary {
  background: linear-gradient(135deg, #a67c7c, #7d5858);
  color: #f3dede;
  box-shadow: 5px 5px 10px rgba(90, 63, 63, 0.5), -5px -5px 10px #3a2a2a;
}

body.dark-mode .btn-primary:hover,
body.dark-mode .btn-primary:focus-visible {
  background: linear-gradient(135deg, #7d5858, #a67c7c);
  transform: scale(1.05);
}

body.dark-mode .btn-secondary {
  background-color: #5a3f3f;
  color: #f3dede !important;
  box-shadow: 5px 5px 10px rgba(90, 63, 63, 0.5), -5px -5px 10px #3a2a2a;
}

body.dark-mode .btn-secondary:hover,
body.dark-mode .btn-secondary:focus-visible {
  background-color: #a67c7c;
  color: #222 !important;
}

body.dark-mode .btn-outline-dark {
  border: 2px solid #a67c7c;
  background: transparent;
  color: #f3dede !important;
}

body.dark-mode .btn-outline-dark:hover,
body.dark-mode .btn-outline-dark:focus-visible {
  background-color: #a67c7c;
  color: #222 !important;
}

body.dark-mode .btn-glow {
  background: linear-gradient(135deg, #7d5858, #a67c7c);
  color: #f3dede;
  box-shadow: 0 0 8px #a67c7c, 0 0 16px #7d5858;
}

body.dark-mode .btn-glow:hover,
body.dark-mode .btn-glow:focus-visible {
  box-shadow: 0 0 14px #a67c7c, 0 0 28px #7d5858;
}

body.dark-mode .project-title,
body.dark-mode label,
body.dark-mode .checkbox-label,
body.dark-mode .small-text {
  color: #f3dede;
}

body.dark-mode .error {
  color: #ff8888;
}

body.dark-mode canvas:hover,
body.dark-mode canvas:focus-visible {
  box-shadow: 0 0 22px 5px rgba(255, 170, 170, 0.7), 0 0 35px 8px rgba(255, 190, 190, 0.3);
}

body.dark-mode .title-glow::after {
  background: linear-gradient(90deg, #a67c7c, #7d5858);
  box-shadow: 0 0 12px rgba(255, 200, 200, 0.6);
}
