body {
  font-family: 'Poppins', sans-serif;
  background-color: #ededed;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #111;
}

/* Dark mode */
body.dark-mode {
  background-color: #252525;
  color: #fafafa;
}

.app-wrap {
  flex-grow: 1;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.main-content {
  width: 100%;
  max-width: 95vw;
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 1rem;
  justify-items: center;
  text-align: center;
}

.logo {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  cursor: pointer;
}

.title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
}

.subtitle {
  font-size: 1rem;
  color: #555;
}

body.dark-mode .subtitle {
  color: #757575;
}

.modes {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
}

.modeBtn {
  background: #fff;
  border: 1px solid #222;
  border-radius: 1rem;
  color: #000;
  font-size: 1.25rem;
  padding: 0.4em 1.2em;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.15s ease-in-out;
}

body.dark-mode .modeBtn {
  background: #555;
  border-color: #fafafa;
  color: #fafafa;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.modeBtn.active {
  background: #0c1a69;
  border-color: #0c1a69;
  color: #fff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

body.dark-mode .modeBtn.active {
  background: #03a9f4;
  color: #111;
  border-color: #0c1a69;
  box-shadow: 0 5px 15px rgba(0,0,50,0.75);
}

.modeBtn:focus-visible {
  outline: 0.25rem solid #03a9f4;
  outline-offset: 0.25rem;
  z-index: 10;
}

.presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.presets button {
  background: rgba(100, 100, 100, 0.25);
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  padding: 0.25rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.presets button:hover {
  background: #03a9f4;
}

.presets button:focus-visible {
  outline: 0.25rem solid #03a9f4;
  outline-offset: 3px;
  z-index: 10;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: center;
  user-select: none;
  max-width: 100%;
}

.controls label,
.controls span {
  text-align: justify;
}

.controls input[type="range"] {
  flex-grow: 1;
  max-width: 7.5rem;
  margin: 0 0.5rem;
  accent-color: #3db3d1;
  border-radius: 1rem;
  height: 10px;
}

.controls input[type="number"] {
  width: 5rem;
  padding: 0.25rem 0.5rem;
  font-family: 'Poppins', monospace;
  font-size: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #999;
  text-align: center;
  box-sizing: border-box;
  user-select: text;
  transition: border-color 0.15s ease;
  background: #fff;
  color: #000;
}

body.dark-mode .controls input[type="number"] {
  background: #222;
  border-color: #555;
  color: #fafafa;
}

.controls input[type="number"]{
  background: #1a1a1a;
  color: #fafafa;
}

.toggles-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  margin: 0.5rem auto;
}

/* Modern toggle switches */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  min-width: max-content;
  position: relative;
  font-weight: 500;
  user-select: none;
}
.toggle-label-text {
  min-width: 0;
  font-size: 1rem;
  color: #333;
  transition: color 0.15s;
}
body.dark-mode .toggle-label-text { color: #fafafa; }
.toggle-switch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  position: absolute;
}
/* Center toggle switch content horizontally if inside flex */
.toggles-row {
  display: flex;
  justify-content: center; /* horizontally center toggles container */
  align-items: center;     /* vertically align toggles nicely */
  gap: 1.5rem;
  margin: 0.5rem auto;
}

/* Center content inside toggle switch */
.toggle-switch {
  display: flex;
  align-items: center;  /* vertical align slider and label */
  justify-content: center; /* center horizontally if needed */
  gap: 0.5rem;
  cursor: pointer;
  min-width: max-content;
  position: relative;
  font-weight: 500;
}

/* Ensure slider itself is inline-block and vertically centered */
.toggle-switch .slider {
  display: inline-block;
  vertical-align: middle;  /* vertical center relative to label text */
  width: 2.75rem;
  height: 1.75rem;
  background-color: #fafafa;
  border-radius: 5rem;
  position: relative;
  transition: background 0.15s;
  box-sizing: border-box;
}
.toggle-switch .slider:before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 0.125rem;
  width: 1.5rem;
  height: 1.5rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(.5,0,.25,1), background 0.25s;
  box-shadow: 0 5px 10px rgba(0,0,0,0.25);
  vertical-align: middle; /* optional */
}

.toggle-switch {
  margin: 0 auto;
  display: block; /* or inline-block */
  width: fit-content;
}


.toggle-switch input[type="checkbox"]:checked + .slider {
  background-color: #3db3d1;
}
body.dark-mode .toggle-switch input[type="checkbox"]:checked + .slider {
  background-color: #3db3d1;
}
.toggle-switch input[type="checkbox"]:checked + .slider:before {
  transform: translateX(1.05rem);
  background: #fff;
}
.toggle-switch input[type="checkbox"]:focus-visible + .slider {
  outline: 2px solid #3db3d1; outline-offset: 2px;
}

/* All sub-labels modern color */
.toggle-label-text { margin-left: 0.25rem; }

.actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
  user-select: none;
}

.actionBtn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0.55rem 1.8rem;
  cursor: pointer;
  border: 1.5px solid #222;
  border-radius: 1.1rem;
  background-color: #fff;
  color: #141a67;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  user-select: none;
  transition: all 0.2s ease;
}

body.dark-mode .actionBtn {
  background-color: #151515;
  border-color: #555;
  color: #eee;
  box-shadow: 0 5px 15px rgba(255,255,255,0.05);
}
.actionBtn.main {
  background: #0c1968;
  border-color: #151515;
  color: #fff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
}
.actionBtn:focus-visible {
  outline: 0.25rem solid #0c1968;
  outline-offset: 0.25rem;
  z-index: 10;
}

.unboxed-output {
  font-size: clamp(5rem, 5vw, 5rem);
  background-color: #fff;
  color: #000;
  border-radius: 0.5rem;
  font-weight: 800;
  font-family: 'Poppins', monospace;
  padding: 1.5rem 2.5rem;
  user-select: text;
  max-width: 75rem;
  min-width: 5rem;
  word-break: break-all;
  overflow-wrap: anywhere;
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  outline: none;
}
body.dark-mode .unboxed-output {
  background: #151515;
  color: #fafafa;
  box-shadow: 0 5px 25px rgba(0,0,0,0.05);
}

.roll-msg-overlay,
.copy-msg-overlay {
  border-radius: 0 !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  user-select: none;
  pointer-events: none;
  border-radius: 0;
  transform-origin: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
  opacity: 0;
  z-index: 9999;
  text-align: center;
}

.roll-msg-overlay {
  background: rgba(1, 25, 105, 0.95);
  color: #fff;
  z-index: 10030;
}

.copy-msg-overlay {
  background: rgba(25, 100, 75, 0.95);
  color: #fff;
  z-index: 10040;
}

.roll-msg-overlay.show,
.copy-msg-overlay.show {
  animation: popFade 0.15s ease forwards;
}

@keyframes popFade {
  0% {
    opacity: 0;
    transform: scale(0.75);
  }
  50% {
    opacity: 0.75;
    transform: scale(1);
  }
  75% {
    opacity: 0.75;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.footer {
  color: #555;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
  user-select: none;
}

body.dark-mode .footer {
  color: #fafafa;
}

@media (max-width: 600px) {
  body { font-size: 2.5rem; }
  .unboxed-output { font-size: 2.5rem; }
  .footer { font-size: 1rem; }
  .toggles-row{flex-direction: column; gap: 1rem}
  .toggle-switch{display: flex; gap: 1.5rem}
  .app-wrap{max-width: 90vw; margin: auto;}
  .controls{gap: 0.5rem}
}
