* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: #0c123d;
  overflow: hidden;
  font-family: Menlo, Monaco, "Courier New", monospace;
  font-weight: bold;
  color: #fff;
  user-select: none;
}

#stage {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
}

#avocado {
  position: relative;
  width: min(88vw, 360px);
  aspect-ratio: 320 / 380;
}

#avocado-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* the pit doubles as the timer interface, centered over the svg pit circle */
#pit {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 68%;
  height: 68%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid #0c123d;
  background: #57301f;
  overflow: hidden;
  transition: background 0.12s steps(2);
}

#pit.alarm {
  animation: pit-flash 220ms steps(1) infinite;
}

@keyframes pit-flash {
  0%, 49% { background: #c38a42; }
  50%, 100% { background: #D9A97A; }
}

#pit-wedge {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#c38a42 0deg, #c38a42 0deg, transparent 0deg, transparent 360deg);
  pointer-events: none;
}

#pit-inner {
  position: absolute;
  inset: 6%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 4px;
}

.hidden { display: none !important; }

.row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

#minutes-input {
  width: 3.2em;
  font: inherit;
  font-size: clamp(18px, 6vw, 26px);
  color: #fff98a;
  background: transparent;
  border: none;
  text-align: center;
  -moz-appearance: textfield;
}
#minutes-input::-webkit-outer-spin-button,
#minutes-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#panel-setup label {
  font-size: clamp(9px, 2.6vw, 12px);
  color: #eef36a;
  letter-spacing: 1px;
}

#task-input {
  width: 90%;
  font: inherit;
  font-size: clamp(9px, 2.6vw, 12px);
  color: #fff;
  background: transparent;
  border: none;
  border-bottom: 2px dashed rgba(255,255,255,0.4);
  text-align: center;
  padding: 4px 2px;
  letter-spacing: 0.5px;
}
#task-input::placeholder { color: rgba(255,255,255,0.5); }
#task-input:focus, #minutes-input:focus { outline: none; }

.pixel-btn {
  font: inherit;
  font-size: clamp(11px, 3.2vw, 14px);
  letter-spacing: 1px;
  color: #0c123d;
  background: #fff98a;
  border: 2px solid #0c123d;
  padding: 8px 14px;
  box-shadow: 2px 2px 0 #0c123d;
  cursor: pointer;
}
.pixel-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #0c123d;
}
.pixel-btn.small {
  font-size: clamp(9px, 2.6vw, 12px);
  padding: 6px 10px;
}

#timer-task {
  font-size: clamp(9px, 2.8vw, 12px);
  color: #eef36a;
  letter-spacing: 1px;
  text-transform: uppercase;
  min-height: 1.4em;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#timer-clock {
  font-size: clamp(26px, 9vw, 40px);
  color: #fff;
  text-shadow: 2px 2px 0 #0c123d;
  letter-spacing: 1px;
}

#alarm-label {
  font-size: clamp(13px, 3.6vw, 16px);
  color: #0c123d;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
  letter-spacing: 1px;
}

#log-status {
  font-size: clamp(13px, 3.6vw, 16px);
  color: #fff98a;
  letter-spacing: 1px;
}
#log-detail {
  font-size: clamp(9px, 2.6vw, 11px);
  color: #eef36a;
}
#log-task {
  font-size: clamp(9px, 2.6vw, 11px);
  color: #fff;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

#avocado.shake {
  animation: shake-anim 60ms linear infinite;
}
@keyframes shake-anim {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-6px, 4px); }
  50%  { transform: translate(5px, -5px); }
  75%  { transform: translate(-4px, -3px); }
  100% { transform: translate(6px, 5px); }
}
