/* /css/y996.css */
body {
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ebebeb;
  margin: 0;
  padding: 10px;
  /* remove global touch-action to allow page scrolling on mobile */
  /* touch-action: none; */
  -webkit-overflow-scrolling: touch;
}

h1 {
  display: inline-block;
  font-size: 26px;
  font-family: "Roboto", sans-serif;
  font-weight: bold;
  background: linear-gradient(90deg, #00522b 0%, #076ad9 40%, #008758 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow: hidden;
  text-align: center;
  margin-left: 6px;
}

h1 a {
  display: inline-block;
  font-size: 26px;
  font-family: "Roboto", sans-serif;
  font-weight: bold;
  background: linear-gradient(90deg, #58c6ff 0%, #076ad9 40%, #ff3bef 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow: hidden;
  text-align: center;
  margin-left: 6px;
}

#controls {
  width: 100%;
  max-width: 1000px;
  background-color: #fff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 10px;
  box-sizing: border-box;
  touch-action: manipulation;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.control-group:last-child {
  border-bottom: none;
}

button, input[type="range"], input[type="color"] {
  cursor: pointer;
}
button {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #bababa;
  font-size: 14px;
  transition: background-color 0.2s;
}
button:hover {
  background-color: #8d8d8d;
}
button.active {
  background-color: #7abaff;
  color: rgb(0, 0, 0);
  border-color: #007bff;
}

#timer-display {
  font-size: 2em;
  font-weight: bold;
  color: #333;
  background-color: #eee;
  padding: 5px 15px;
  border-radius: 4px;
  min-width: 80px;
  text-align: center;
}

#start-btn {
  background-color: #81ff9e;
  color: rgb(0, 0, 0);
  border-color: #28a745;
}
#start-btn:hover {
  background-color: #218838;
}

.size-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.size-input input {
  width: 60px;
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#pen-width {
  width: 120px;
}

.color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 3px rgba(0,0,0,0.3);
}
.color-btn[data-color="black"] { background-color: black; }
.color-btn[data-color="red"]   { background-color: red; }
.color-btn[data-color="blue"]  { background-color: blue; }
.color-btn[data-color="green"] { background-color: green; }
.color-btn[data-color="orange"]{ background-color: orange; }

#color-picker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: none;
  padding: 0;
}
#color-picker::-webkit-color-swatch {
  border-radius: 50%;
  border: 1px solid #999;
}
#color-picker::-moz-color-swatch {
  border-radius: 50%;
  border: 1px solid #999;
}

/* Canvas styling: keep a visible border, drop shadow, and make it responsive.
   touch-action: none stays on canvas so touch moves on canvas do not trigger scrolling,
   while the rest of the page remains scrollable. */
#draw-canvas {
  border: 2px solid #333;
  background-color: white;
  touch-action: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  display: block;
  max-width: 100%;
  height: auto;
  margin: 8px 0 40px 0;
}

/* make footer links comfortable on small screens */
footer {
  margin-top: 20px;
  font-size: 14px;
  max-width: 1000px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
}
footer a {
  color: #0054ae;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

@keyframes screenFlash {
  0%,100% { background-color: #f0f0f0; }
  50%      { background-color: #ffc107; }
}
.flash {
  animation: screenFlash 0.5s 5;
}