:root {
  --bg: #080a0d;
  --panel: rgba(20, 23, 29, 0.9);
  --panel-soft: rgba(28, 32, 39, 0.74);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6f7f9;
  --muted: #a8afb9;
  --orange: #ff9818;
  --orange-light: #ffbd62;
  --green: #42d884;
  --red: #ff6978;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 152, 24, 0.18), transparent 42%),
    linear-gradient(180deg, #0c0f13 0%, #07090c 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, select, input { font: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 28px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.brand img { width: 50px; height: 50px; object-fit: contain; flex: 0 0 auto; }
.brand span { display: grid; gap: 2px; min-width: 0; }
.brand h1 { margin: 0; font-size: clamp(1.05rem, 3vw, 1.35rem); line-height: 1.15; }
.brand small { color: var(--muted); font-size: 0.82rem; white-space: normal; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--orange-light);
  background: var(--panel-soft);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.language-button:hover { border-color: rgba(255,152,24,.55); background: rgba(255,152,24,.09); }
.tools-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid rgba(255, 152, 24, .48);
  border-radius: 12px;
  color: #181109 !important;
  background: linear-gradient(135deg, var(--orange-light), var(--orange));
  box-shadow: 0 9px 24px rgba(255, 152, 24, .18);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: transform .18s ease, filter .18s ease;
}
.tools-button:hover { filter: brightness(1.06); }
.tools-button:active { transform: scale(.98); }

:root { color-scheme: dark; }
.tool, .info-card { border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.tool { padding: clamp(18px, 4vw, 34px); }
h1, h2, p { margin: 0; }
.title-name { font-weight: 700; font-size: clamp(1rem, 3vw, 1.35rem); }
.title-subtitle, .lead, .info-card p { color: var(--muted); line-height: 1.5; }
.title-subtitle { font-size: .82rem; }
h1 { font-size: clamp(1.4rem, 4vw, 2rem); letter-spacing: -.035em; }
.lead { max-width: 59ch; margin-top: 6px; }
.readout { margin: 20px 0 16px; padding: 22px 12px 18px; border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(ellipse at 50% 0, #382719 0, transparent 67%), #101318; }
.tempo-row { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 4vw, 30px); }
.tempo { font-variant-numeric: tabular-nums; text-align: center; }
.tempo strong { display: block; font-size: clamp(3.3rem, 11vw, 5rem); line-height: 1; letter-spacing: -.06em; }
.tempo small { display: block; margin: 6px 0 0; color: var(--orange-light); font-size: .72rem; font-weight: 650; letter-spacing: .16em; }
.beat-light { position: relative; margin: 0 auto 14px; height: 13px; width: 13px; border: 1px solid #805e39; border-radius: 50%; background: #573b20; }
.beat-light.beat { background: #ffca78; border-color: #ffe3ac; box-shadow: 0 0 14px 4px #ff98187a; }
.beat-light.beat::after { content: ""; position: absolute; inset: -1px; border: 1px solid var(--orange-light); border-radius: 50%; animation: ripple 185ms ease-out forwards; }
@keyframes ripple { from { transform: scale(1); opacity: .8; } to { transform: scale(2.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .beat-light.beat::after { animation: none; } }
button, select { cursor: pointer; }
.iconbtn, .secondary, select { background: #20242b; color: var(--text); border: 1px solid var(--line); border-radius: 12px; }
.iconbtn { width: 44px; height: 44px; font-size: 1.5rem; }
.slider-wrap { margin: 16px auto 0; max-width: 460px; }
input[type=range] { width: 100%; margin: 0; height: 26px; accent-color: var(--orange); cursor: pointer; }
.voice-control, .actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.voice-control { color: var(--muted); font-size: .87rem; }
select, .button { padding: 9px 16px; min-height: 42px; }
.actions { margin-top: 16px; }
.button { font-weight: 650; border-radius: 12px; }
.button:not(.secondary) { border: 1px solid var(--orange); background: linear-gradient(135deg,var(--orange-light),var(--orange)); color: #181109; }
button:hover { filter: brightness(1.12); }
:focus-visible { outline: 2px solid var(--orange-light); outline-offset: 3px; }
.shortcuts { text-align: center; font-size: .76rem; color: var(--muted); margin-top: 18px; }
.info-card { margin-top: 16px; padding: 18px 22px; }
.info-card h2 { font-size: 1rem; margin-bottom: 5px; }
.info-card p { font-size: .9rem; }
footer { text-align: center; color: var(--muted); padding: 0 14px 24px; font-size: .76rem; line-height: 1.6; }
footer .tools-button { margin-bottom: 13px; }
footer a { color: var(--orange-light); }
@media(max-width: 520px) { .app-shell { padding-top: 16px; } .brand { gap: 7px; } .brand img { width: 38px; height: 38px; } .title-subtitle { font-size: .72rem; } }

.icon-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.icon-button:hover { border-color: rgba(255, 152, 24, .5); background: rgba(255, 152, 24, .09); }
.icon-button:active { transform: scale(.96); }


.settings-panel { margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.settings-panel h2 { font-size: 1rem; margin-bottom: 12px; }
.settings-panel .voice-control { justify-content: space-between; }
@media(max-width: 520px) { .icon-button { width: 39px; height: 39px; flex-basis: 39px; border-radius: 11px; } }
