*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f1a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 1rem;
}
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 480px;
  width: 100%;
}
.ad {
  background: #12121f;
  border: 1.5px dashed #2a2a44;
  border-radius: 1rem;
  color: #444466;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  user-select: none;
}
.ad-top { height: 60px; }
.ad-bottom { height: 60px; }
.ad-inline {
  height: 60px;
  width: 100%;
  background: #12121f;
  border: 1.5px dashed #2a2a44;
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
}
.container {
  background: #1a1a2e;
  border-radius: 2rem;
  padding: 3rem 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.8);
  text-align: center;
  max-width: 480px;
  width: 100%;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.header h1 { margin-bottom: 0; }
.lang-switch { display: flex; gap: .4rem; }
.lang-switch button {
  font-size: 1.2rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  opacity: .35;
  transition: opacity .15s;
  filter: grayscale(.6);
}
.lang-switch button.active { opacity: 1; filter: none; }
.lang-switch button:hover { opacity: .7; filter: none; }

h1 {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8888aa;
}
.display {
  font-size: clamp(3.5rem, 15vw, 6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
  line-height: 1.2;
  color: #f0f0ff;
  text-shadow: 0 0 40px rgba(100,140,255,.15);
  margin-bottom: .3rem;
  transition: color .2s;
}
.display.running { color: #6ee7b7; text-shadow: 0 0 60px rgba(110,231,183,.25); }
.display.paused { color: #fbbf24; text-shadow: 0 0 60px rgba(251,191,36,.2); }
.display.ended { color: #f87171; text-shadow: 0 0 60px rgba(248,113,113,.3); }

.label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #666688;
  margin-bottom: 2rem;
  min-height: 1.2em;
}

.input-group {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.input-group input {
  width: 5rem;
  padding: .6rem .4rem;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  background: #12121f;
  border: 1.5px solid #2a2a44;
  border-radius: .75rem;
  color: #fff;
  outline: none;
  transition: border-color .2s;
}
.input-group input:focus { border-color: #4f6ef7; }
.input-group input::placeholder { color: #444466; font-weight: 400; }
.input-group span {
  font-size: 1.3rem;
  font-weight: 600;
  color: #8888aa;
  align-self: center;
}

.actions {
  display: flex;
  gap: .6rem;
  justify-content: center;
  flex-wrap: wrap;
}
.actions button {
  padding: .7rem 1.6rem;
  font-size: .95rem;
  font-weight: 600;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  transition: all .15s;
  background: #2a2a44;
  color: #ccd;
}
.actions button:active { transform: scale(.95); }
.actions .start  { background: #22c55e; color: #0a0a1a; }
.actions .start:hover  { background: #16a34a; }
.actions .start:disabled { background: #1a3a2a; color: #446655; cursor: not-allowed; }
.actions .pause  { background: #eab308; color: #0a0a1a; }
.actions .pause:hover  { background: #ca8a04; }
.actions .pause:disabled { background: #3a3520; color: #887744; cursor: not-allowed; }
.actions .delete { background: transparent; color: #666688; border: 1.5px solid #2a2a44; }
.actions .delete:hover { color: #f87171; border-color: #f87171; }
.actions .delete:disabled { opacity: .3; cursor: not-allowed; }
.actions .stop { background: #ef4444; color: #fff; }
.actions .stop:hover { background: #dc2626; }

.sound-select {
  margin-bottom: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
}
.sound-select label {
  font-size: .8rem;
  color: #8888aa;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.sound-select select {
  background: #12121f;
  color: #ddd;
  border: 1.5px solid #2a2a44;
  border-radius: .75rem;
  padding: .4rem .8rem;
  font-size: .85rem;
  cursor: pointer;
  outline: none;
  max-width: 180px;
}
.sound-select select:focus { border-color: #4f6ef7; }
.sound-select .preview {
  background: #2a2a44;
  border: none;
  border-radius: .5rem;
  color: #aaa;
  cursor: pointer;
  font-size: .9rem;
  padding: .35rem .5rem;
  line-height: 1;
  transition: all .15s;
}
.sound-select .preview:hover { background: #3a3a55; color: #fff; }
.sound-select .preview:active { transform: scale(.9); }

.presets {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
}
.presets button {
  padding: .35rem 1rem;
  font-size: .8rem;
  font-weight: 500;
  border-radius: 1.5rem;
  border: 1.5px solid #2a2a44;
  background: transparent;
  color: #8888aa;
  cursor: pointer;
  transition: all .15s;
}
.presets button:hover { background: #2a2a44; color: #ddd; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #1a1a2e;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 30px 60px rgba(0,0,0,.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
}
.modal-close {
  position: absolute;
  top: .7rem;
  right: .7rem;
  background: none;
  border: none;
  color: #666688;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: .2rem;
  transition: color .15s;
}
.modal-close:hover { color: #fff; }
.modal-ad {
  width: 300px;
  height: 250px;
  background: #12121f;
  border: 1.5px dashed #2a2a44;
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444466;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  user-select: none;
}
.modal-stop {
  padding: .7rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  transition: background .15s;
}
.modal-stop:hover { background: #dc2626; }
.modal-stop:active { transform: scale(.95); }
