@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&family=Bebas+Neue&family=Oswald:wght@600&display=swap');

  :root {
    --bg: #0b0b0b;
    --panel: #151515;
    --panel-2: #1d1d1d;
    --panel-3: #242424;
    --line: #343434;
    --line-soft: rgba(255,255,255,0.08);
    --text: #f1eee6;
    --muted: #898989;
    --dim: #555;
    --gold: #e8a923;
    --gold-light: #ffd766;
    --gold-dark: #9c6810;
    --red: #d44036;
    --green: #1D9E75;
    --radius: 18px;
    --shadow-deep: 0 18px 45px rgba(0,0,0,0.58), inset 0 1px 0 rgba(255,255,255,0.07), inset 0 -20px 35px rgba(0,0,0,0.28);
    --shadow-press: inset 0 4px 14px rgba(0,0,0,0.75), inset 0 1px 0 rgba(255,255,255,0.04);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
  html { background: #0b0b0b; }
  body {
    min-height: 100vh;
    padding: 8px;
    background:
      radial-gradient(circle at 50% -10%, rgba(232,169,35,0.16), transparent 30%),
      radial-gradient(circle at 18% 0%, rgba(255,255,255,0.08), transparent 22%),
      radial-gradient(circle at 82% 0%, rgba(255,255,255,0.08), transparent 22%),
      linear-gradient(180deg, #202020 0%, #101010 55%, #080808 100%);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    overflow-x: hidden;
  }

  .app-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    min-height: calc(100vh - 16px);
    background:
      linear-gradient(180deg, rgba(255,255,255,0.05), transparent 18%),
      radial-gradient(circle at 50% 20%, rgba(255,255,255,0.05), transparent 26%),
      #111;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0,0,0,0.75);
  }

  /* APP HEADER */
  .app-header { position: relative; padding: 22px 18px 14px; text-align: center; overflow: hidden; }
  .app-header:before,
  .app-header:after {
    content: "";
    position: absolute;
    top: -28px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(232,169,35,0.24), transparent 40%);
    pointer-events: none;
  }
  .app-header:before { left: -38px; }
  .app-header:after { right: -38px; }
  .app-title-wrap { display: flex; align-items: center; justify-content: center; gap: 12px; position: relative; z-index: 1; }
  .app-spotlight { flex-shrink: 0; width: 40px; height: 40px; filter: drop-shadow(0 0 12px rgba(232,169,35,0.34)); }
  .app-spotlight-r { transform: scaleX(-1); }
  .app-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(44px, 12vw, 74px);
    letter-spacing: clamp(12px, 3vw, 28px);
    margin-right: -18px;
    color: transparent;
    -webkit-text-stroke: 1.6px var(--gold);
    text-stroke: 1.6px var(--gold);
    line-height: 0.9;
    filter: drop-shadow(0 0 12px rgba(232,169,35,0.26));
  }
  .app-sub { font-size: 10px; color: #747474; letter-spacing: 4px; margin-top: 8px; text-transform: uppercase; }

  /* MODE TABS */
  .mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin: 0 18px;
    padding: 7px;
    background: #080808;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: var(--shadow-press);
  }
  .mode-tab {
    min-height: 54px;
    padding: 13px 6px 11px;
    background: linear-gradient(180deg, #2c2c2c 0%, #151515 100%);
    border: 1px solid #383838;
    border-bottom: 3px solid #050505;
    border-radius: 10px;
    color: #8a8a8a;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 2px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 6px 14px rgba(0,0,0,0.35);
    transition: transform 0.08s, color 0.12s, border-color 0.12s;
  }
  .mode-tab.active {
    background: linear-gradient(180deg,#ffd15a 0%,#e8a923 44%,#b97914 100%);
    color: #151515;
    border-color: #f1be42;
    border-bottom-color: #81550e;
    text-shadow: 0 1px 0 rgba(255,255,255,0.35);
    box-shadow: 0 0 26px rgba(232,169,35,0.22), inset 0 1px 0 rgba(255,255,255,0.32);
  }
  .mode-tab:active { transform: translateY(2px); border-bottom-width: 1px; }

  /* PANELS / CARDS */
  .panel { display: none; padding: 14px 18px 20px; }
  .panel.active { display: block; }

  .stage-panel,
  .card,
  .bpm-card,
  .meter-card,
  .live-bpm-card {
    background:
      radial-gradient(circle at 50% 0%, rgba(255,255,255,0.08), transparent 42%),
      linear-gradient(180deg, #202020 0%, #111 100%);
    border: 1px solid var(--line);
    border-top-color: rgba(255,255,255,0.16);
    border-radius: var(--radius);
    box-shadow: var(--shadow-deep);
  }

  .stage-panel { padding: 16px; margin-bottom: 12px; }
  .card { padding: 16px; margin-bottom: 12px; }
  .section-label {
    display: block;
    margin-bottom: 10px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
  }

  /* METRONOME */
  .bpm-card {
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
  }
  .bpm-card.playing,
  .live-bpm-card.playing {
    border-color: rgba(232,169,35,0.65);
    box-shadow: 0 0 28px rgba(232,169,35,0.14), var(--shadow-deep);
  }
  .bpm-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; }
  .bpm-center { min-width: 0; text-align: center; border-left: 1px solid rgba(255,255,255,0.07); padding-left: 16px; }
  .bpm-big,
  .live-bpm-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(86px, 25vw, 152px);
    letter-spacing: 3px;
    line-height: 0.85;
    color: #eee7d9;
    text-shadow: 0 2px 0 #fff, 0 10px 24px rgba(0,0,0,0.65);
    transform-origin: center;
    transition: transform 0.08s;
  }
  .bpm-tempo,
  .bpm-unit,
  .live-tap-hint {
    margin-top: 8px;
    color: var(--gold);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    letter-spacing: 6px;
    text-transform: uppercase;
  }
  .bpm-tap-hint {
    margin-top: 12px;
    color: #545454;
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
  }
  .bpm-card.playing .bpm-tap-hint,
  .live-bpm-card.playing .live-tap-hint { color: #6a5525; }

  .wheel-col,
  .live-wheel-col {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-shrink: 0;
    min-height: 146px;
  }
  .wheel-arrows,
  .live-wheel-arrows {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .wheel-btn,
  .live-wheel-btn {
    width: 72px;
    height: 68px;
    border: 1px solid #494949;
    border-bottom: 4px solid #090909;
    border-radius: 12px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.1), transparent 25%),
      linear-gradient(180deg,#303030,#171717);
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 8px 16px rgba(0,0,0,0.42);
    transition: transform 0.08s, border-bottom-width 0.08s, filter 0.08s;
  }
  .wheel-btn svg,
  .live-wheel-btn svg { width: 28px; height: 28px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); }
  .wheel-btn:active,
  .live-wheel-btn:active {
    transform: translateY(3px);
    border-bottom-width: 1px;
    background: linear-gradient(180deg,#242424,#101010);
  }

  .wheel-track,
  .live-wheel-track {
    position: relative;
    width: 72px;
    height: 146px;
    min-height: 146px;
    border: 1px solid #555;
    border-radius: 14px;
    background:
      linear-gradient(90deg, rgba(232,169,35,0.22), transparent 18%, transparent 82%, rgba(232,169,35,0.16)),
      linear-gradient(180deg, #0a0a0a, #262626 45%, #0b0b0b);
    overflow: hidden;
    cursor: ns-resize;
    touch-action: none;
    box-shadow: inset 0 0 18px rgba(0,0,0,0.9), 0 8px 18px rgba(0,0,0,0.4);
  }
  .wheel-track:before,
  .live-wheel-track:before {
    content: "";
    position: absolute;
    inset: 13px 18px;
    border-radius: 16px;
    background:
      repeating-linear-gradient(
        0deg,
        #101010 0px,
        #101010 5px,
        #696969 6px,
        #9a9a9a 8px,
        #2b2b2b 12px
      );
    box-shadow:
      inset 0 0 8px rgba(255,255,255,0.12),
      inset 7px 0 12px rgba(255,255,255,0.08),
      inset -7px 0 12px rgba(0,0,0,0.7),
      0 0 0 2px #050505;
    transform: translateY(var(--wheel-shift, 0px));
    transition: transform 0.12s ease-out;
  }
  .wheel-track:after,
  .live-wheel-track:after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background:
      linear-gradient(180deg, rgba(0,0,0,0.85), transparent 24%, transparent 76%, rgba(0,0,0,0.85)),
      linear-gradient(90deg, rgba(232,169,35,0.26), transparent 15%, transparent 85%, rgba(232,169,35,0.2));
    pointer-events: none;
  }
  .wheel-track.dragging:before,
  .live-wheel-track.dragging:before { transition: none; }

  .beat-dots,
  .live-beat-dots { display: flex; gap: 16px; justify-content: center; margin-top: 18px; }
  .dot {
    width: 15px; height: 15px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: transparent;
    opacity: 0.95;
    transition: background 0.05s, box-shadow 0.05s, transform 0.05s;
  }
  .dot.first { width: 18px; height: 18px; }
  .dot.active {
    background: var(--gold);
    box-shadow: 0 0 14px rgba(232,169,35,0.62);
    transform: scale(1.08);
  }

  .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
  .row2 .card { margin-bottom: 0; }
  .seg-row { display: flex; gap: 4px; }
  .seg,
  .live-sig-btn,
  .inst-tab {
    flex: 1;
    min-height: 50px;
    padding: 10px 4px;
    background: linear-gradient(180deg,#323232,#161616);
    border: 1px solid #434343;
    border-bottom: 3px solid #090909;
    border-radius: 9px;
    color: #d8d3c8;
    cursor: pointer;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.15;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.09), 0 7px 12px rgba(0,0,0,0.34);
    transition: transform 0.08s;
  }
  .seg.on,
  .live-sig-btn.on,
  .inst-tab.active {
    background: linear-gradient(180deg,#ffd15a 0%,#e8a923 45%,#ad7413 100%) !important;
    color: #151515 !important;
    border-color: #f1bd42 !important;
    border-bottom-color: #7c510d !important;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  }
  .seg:active,
  .live-sig-btn:active,
  .inst-tab:active { transform: translateY(2px); border-bottom-width: 1px; }

  .sound-card .seg { font-size: 12px; min-height: 44px; }

  .metro-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
  }
  .stage-action,
  .btn-primary,
  .btn-outline,
  .btn-ghost,
  .add-btn,
  .song-action-btn,
  .live-nav-btn,
  .mic-btn,
  .refresh-btn {
    border-radius: 14px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.08s, border-bottom-width 0.08s;
  }
  .stage-action {
    min-height: 64px;
    padding: 16px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(180deg,#2f2f2f,#141414);
    color: #d7d2c6;
    border: 1px solid #454545;
    border-bottom: 4px solid #050505;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 12px 24px rgba(0,0,0,0.36);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
  }
  .stage-action.primary {
    background: linear-gradient(180deg,#ffd15a 0%,#e8a923 45%,#ad7413 100%);
    color: #151515;
    border-color: #f1bd42;
    border-bottom-color: #7c510d;
    text-shadow: 0 1px 0 rgba(255,255,255,0.32);
  }
  .stage-action:active,
  .btn-primary:active,
  .btn-outline:active,
  .btn-ghost:active,
  .add-btn:active,
  .song-action-btn:active,
  .live-nav-btn:active:not(:disabled),
  .mic-btn:active,
  .refresh-btn:active { transform: translateY(3px); border-bottom-width: 1px; }

  /* SET LIST EDITOR */
  .setlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  .setlist-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 42px;
    letter-spacing: 3px;
    color: var(--gold);
    line-height: 0.9;
  }
  .small-action {
    background: linear-gradient(180deg,#2f2f2f,#141414);
    color: #d7d2c6;
    border: 1px solid #454545;
    border-bottom: 3px solid #050505;
    border-radius: 12px;
    padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11px;
  }

  .add-row {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) 88px 84px 86px;
    gap: 8px;
    margin-bottom: 14px;
  }
  input, select, .song-edit-input, .input-select, .stage-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text);
    background: linear-gradient(180deg,#111,#1d1d1d);
    border: 1px solid #3b3b3b;
    border-radius: 11px;
    outline: none;
    box-shadow: inset 0 3px 10px rgba(0,0,0,0.58), inset 0 1px 0 rgba(255,255,255,0.04);
  }
  select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23898989' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
  }
  option {
    background: #1d1d1d;
    color: #f1eee6;
  }
  .add-row input,
  .add-row select,
  .song-edit-input { min-width: 0; padding: 13px 12px; }
  input::placeholder { color: #5e5e5e; }
  .add-btn {
    padding: 0 12px;
    background: linear-gradient(180deg,#ffd15a,#e8a923 45%,#ad7413);
    color: #151515;
    border: 1px solid #f1bd42;
    border-bottom: 3px solid #7c510d;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
  }
  .setlist-items { display: flex; flex-direction: column; gap: 8px; }
  .setlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(180deg,#242424,#151515);
    border: 1px solid #393939;
    border-radius: 13px;
    cursor: grab;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 9px 16px rgba(0,0,0,0.28);
  }
  .setlist-item:active { cursor: grabbing; }
  .setlist-item.active-song {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px rgba(232,169,35,0.3), 0 0 22px rgba(232,169,35,0.12), inset 0 1px 0 rgba(255,255,255,0.06);
  }
  .song-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 14px; }
  .song-meta { flex-shrink: 0; color: var(--gold); font-size: 12px; white-space: nowrap; }
  .spb {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    background: #151515;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .spb.playing { background: var(--gold); }
  .song-action-btn {
    background: linear-gradient(180deg,#313131,#171717);
    border: 1px solid #484848;
    border-bottom: 3px solid #090909;
    color: #d7d2c6;
    font-size: 11px;
    padding: 10px 12px;
    white-space: nowrap;
  }
  .song-del {
    background: transparent;
    border: none;
    color: #6c6c6c;
    cursor: pointer;
    font-size: 26px;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
  }
  .song-del:active { color: var(--text); }

  /* LIVE MODE */
  body.live-mode .mode-tabs,
  body.live-mode .app-sub { display: none; }
  #panel-live {
    min-height: calc(100vh - 120px);
  }
  .live-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
  }
  .live-now-label { font-size: 10px; color: var(--gold); letter-spacing: 4px; text-transform: uppercase; }
  .live-song-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(42px, 12vw, 72px);
    letter-spacing: 3px;
    color: var(--text);
    line-height: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .live-song-name.empty { color: #424242; font-size: 38px; }

  .live-bpm-card { padding: 14px; margin-bottom: 12px; cursor: pointer; }
  .live-bpm-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; }
  .live-bpm-center { text-align: center; border-left: 1px solid rgba(255,255,255,0.07); padding-left: 16px; }
  .live-sig-row { display: flex; gap: 6px; margin-top: 8px; }
  .live-subdivision-wrap { margin-top: 14px; }
  .live-subdivision-wrap .section-label { margin-bottom: 8px; }
  .live-setlist-wrap {
    max-height: 34vh;
    overflow-y: auto;
    padding: 14px;
    margin-bottom: 12px;
  }
  .live-setlist-label { font-size: 10px; color: var(--gold); letter-spacing: 4px; text-transform: uppercase; margin-bottom: 10px; }
  .live-song-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 13px 14px;
    margin-bottom: 8px;
    background: linear-gradient(180deg,#242424,#151515);
    border: 1px solid #393939;
    border-radius: 13px;
    cursor: pointer;
  }
  .live-song-row.live-active {
    border-color: var(--gold);
    background: linear-gradient(180deg,#2b271c,#171511);
  }
  .live-row-name {
    flex: 1;
    min-width: 0;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 26px;
    letter-spacing: 1.5px;
    color: #c9c9c9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .live-song-row.live-active .live-row-name { color: var(--gold); }
  .live-row-meta { color: #aaa; font-size: 12px; white-space: nowrap; }
  .live-bottom { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 10px; margin-top: 12px; }
  .live-nav-btn {
    min-height: 58px;
    padding: 14px 8px;
    background: linear-gradient(180deg,#303030,#151515);
    color: #d7d2c6;
    border: 1px solid #464646;
    border-bottom: 4px solid #050505;
    font-size: 11px;
    letter-spacing: 2px;
  }
  .live-nav-btn.primary {
    background: linear-gradient(180deg,#ffd15a,#e8a923 45%,#ad7413);
    color: #151515;
    border-color: #f1bd42;
    border-bottom-color: #7c510d;
    font-weight: 600;
  }
  .live-nav-btn:disabled { opacity: 0.35; cursor: default; }

  /* TUNER */
  .tuner-inst-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
  .tuner-stage { display: grid; grid-template-columns: 1fr 36px; gap: 10px; align-items: stretch; }
  .meter-card { padding: 22px 18px; margin-bottom: 12px; }
  .note-display { text-align: center; margin-bottom: 18px; }
  .note-name-big {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(92px, 25vw, 150px);
    letter-spacing: 5px;
    color: #eee7d9;
    line-height: 0.85;
    text-shadow: 0 2px 0 #fff, 0 10px 24px rgba(0,0,0,0.65);
    transition: color 0.2s;
  }
  .note-freq-txt { color: var(--gold); font-size: 12px; letter-spacing: 3px; margin-top: 10px; }
  .cents-label { color: #8e8e8e; font-size: 12px; letter-spacing: 2px; margin-top: 8px; text-transform: uppercase; }
  .meter-labels { display: flex; justify-content: space-between; color: #777; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
  .meter-bar-wrap {
    position: relative;
    height: 12px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 3px 10px rgba(0,0,0,0.7);
  }
  .meter-bar-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 20px;
    background: var(--gold);
    transition: left 0.08s ease, width 0.08s ease, background 0.15s;
  }
  .meter-center-tick { position: absolute; left: 50%; top: -5px; width: 2px; height: 22px; background: rgba(255,255,255,0.36); transform: translateX(-50%); }
  .tuner-status-row { display: flex; align-items: center; justify-content: center; gap: 8px; color: #777; font-size: 10px; letter-spacing: 3px; margin-top: 14px; text-transform: uppercase; }
  .status-dot { width: 8px; height: 8px; border-radius: 50%; background: #3a3a3a; }
  .vu-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    background: linear-gradient(180deg,#202020,#111);
    border: 1px solid #343434;
    border-radius: 14px;
    box-shadow: var(--shadow-press);
    margin-bottom: 12px;
  }
  .vu-track { flex: 1; width: 12px; border-radius: 10px; background: #0d0d0d; border: 1px solid #333; position: relative; overflow: hidden; display: flex; align-items: flex-end; }
  .vu-fill { width: 100%; height: 0%; border-radius: 10px; background: var(--green); transition: height 0.05s ease-out, background 0.15s; }
  .vu-label { font-size: 8px; color: #777; letter-spacing: 2px; text-transform: uppercase; }
  .strings-grid { display: grid; gap: 8px; margin-bottom: 12px; }
  .string-btn {
    background: linear-gradient(180deg,#242424,#151515);
    border: 1px solid #3e3e3e;
    border-radius: 12px;
    padding: 11px 6px;
    cursor: pointer;
    text-align: center;
  }
  .string-btn.s-active { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(232,169,35,0.4), 0 0 18px rgba(232,169,35,0.16); }
  .s-num { display: block; color: #666; font-size: 9px; letter-spacing: 1px; margin-bottom: 2px; }
  .s-note { display: block; color: var(--text); font-size: 18px; font-weight: 600; }
  .s-hz { display: block; color: #666; font-size: 9px; margin-top: 2px; }
  .input-row { display: flex; gap: 8px; align-items: stretch; }
  .input-select { flex: 1; min-width: 0; padding: 13px 12px; }
  .refresh-btn {
    width: 48px;
    flex-shrink: 0;
    background: linear-gradient(180deg,#303030,#151515);
    color: #aaa;
    border: 1px solid #464646;
    border-bottom: 3px solid #050505;
  }
  .mic-btn {
    width: 100%;
    min-height: 56px;
    margin-top: 10px;
    background: linear-gradient(180deg,#303030,#151515);
    color: #d7d2c6;
    border: 1px solid #464646;
    border-bottom: 4px solid #050505;
    letter-spacing: 3px;
  }
  .mic-btn.t-listening { border-color: #c0392b; color: #e74c3c; }

  /* KEY CONVERTER */
  .key-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .stage-input,
  #kc-source,
  #kc-target {
    width: 100%;
    padding: 14px 12px;
  }
  .kc-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin-bottom: 12px; }
  .btn-primary,
  .btn-outline,
  .btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 14px 12px;
    border-bottom-width: 4px;
    text-decoration: none;
    text-align: center;
    letter-spacing: 3px;
    font-size: 12px;
    font-weight: 600;
  }
  .btn-primary {
    background: linear-gradient(180deg,#ffd15a,#e8a923 45%,#ad7413);
    color: #151515;
    border: 1px solid #f1bd42;
    border-bottom-color: #7c510d;
  }
  .btn-outline {
    background: linear-gradient(180deg,#303030,#151515);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-bottom-color: #7c510d;
  }
  .btn-ghost {
    background: linear-gradient(180deg,#303030,#151515);
    color: #d7d2c6;
    border: 1px solid #464646;
    border-bottom-color: #050505;
  }
  .btn-primary:disabled, .btn-outline:disabled, .btn-ghost:disabled { opacity: 0.45; cursor: default; transform: none; }
  .kc-status {
    min-height: 18px;
    color: #777;
    font-size: 11px;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 12px;
  }
  .kc-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 32px;
    letter-spacing: 2px;
    color: var(--text);
    line-height: 1;
  }
  .kc-artist {
    color: #888;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 14px;
  }
  .key-equation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
  }
  .key-label { color: #666; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 5px; text-align: center; }
  .key-big {
    font-family:'Oswald',sans-serif;
    font-weight:600;
    font-size: clamp(42px, 13vw, 62px);
    letter-spacing:2px;
    color: var(--text);
    line-height:1;
    text-align:center;
  }
  .key-big.gold { color: var(--gold); }
  .key-arrow { text-align: center; color: var(--gold); font-family: 'Bebas Neue', sans-serif; font-size: 30px; }
  .kc-hint { color:#666; font-size:10px; letter-spacing:1px; text-align:center; margin-bottom:8px; line-height:1.5; }
  .kc-bpm-row { display:flex; align-items:center; justify-content:center; gap:10px; padding:12px 0; border-top:1px solid rgba(255,255,255,0.08); margin-top:8px; }
  .kc-bpm-row span { font-size:9px; color:#666; letter-spacing:2px; text-transform:uppercase; }
  .kc-bpm-row strong { font-family:'Bebas Neue',sans-serif; font-size:36px; letter-spacing:2px; color:var(--text); line-height:1; }



  /* SET LIST SHARE / IMPORT */
  .metro-actions.setlist-actions {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .stage-action.share {
    background: linear-gradient(180deg,#303030,#151515);
    color: var(--gold);
    border-color: #5a4a26;
    border-bottom-color: #120d04;
  }
  .share-status {
    margin-top: 10px;
    min-height: 16px;
    color: #888;
    font-size: 10px;
    letter-spacing: 1px;
    text-align: center;
  }
  .import-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(8px);
  }
  .import-modal[hidden] { display: none; }
  .import-card {
    width: min(440px, 100%);
    background: linear-gradient(180deg,#252525,#101010);
    border: 1px solid #42351c;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 28px 70px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
  }
  .import-kicker {
    color: var(--gold);
    font-size: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 8px;
  }
  .import-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 46px;
    letter-spacing: 3px;
    line-height: 0.95;
    color: var(--text);
    margin-bottom: 10px;
  }
  .import-copy {
    color: #b9b2a5;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
  }
  .import-actions {
    display: grid;
    gap: 10px;
  }
  .import-actions .stage-action {
    width: 100%;
    min-height: 56px;
  }

  @media (max-width: 560px) {
    body { padding: 0; background: #0b0b0b; }
    .app-shell { min-height: 100vh; border-radius: 0; border-left: 0; border-right: 0; }
    .app-header { padding-top: 18px; }
    .app-spotlight { width: 32px; height: 32px; }
    .mode-tabs { margin: 0 10px; }
    .panel { padding: 12px 10px 18px; }
    .stage-panel, .card, .bpm-card, .meter-card, .live-bpm-card { border-radius: 13px; }
    .bpm-row, .live-bpm-row { gap: 12px; }
    .bpm-center, .live-bpm-center { padding-left: 10px; }
    .wheel-col, .live-wheel-col { gap: 7px; min-height: 126px; }
    .wheel-arrows, .live-wheel-arrows { gap: 8px; }
    .wheel-btn, .live-wheel-btn { width: 58px; height: 59px; }
    .wheel-track, .live-wheel-track { width: 58px; height: 126px; min-height: 126px; }
    .beat-dots, .live-beat-dots { gap: 13px; }
    .row2, .metro-actions, .metro-actions.setlist-actions, .key-grid, .kc-actions { grid-template-columns: 1fr; }
    .sound-card .seg-row { flex-wrap: wrap; }
    .sound-card .seg { min-width: 30%; }
    .add-row { grid-template-columns: 1fr 78px; }
    .add-row select, .add-row .add-btn { min-height: 48px; }
    .setlist-item { flex-wrap: wrap; }
    .setlist-item[style*="grid-template-columns"] { grid-template-columns: 1fr 72px !important; }
    .tuner-inst-tabs { grid-template-columns: repeat(3, 1fr); }
    .live-bottom { grid-template-columns: 1fr 1fr; }
    .live-bottom .primary { grid-column: 1 / -1; }
  }


/* ─────────────────────────────────────
   FINAL HEADER SPOTLIGHTS
───────────────────────────────────── */
.app-header.stage-header {
  position: relative;
  margin: 0;
  padding: 1rem 0.75rem 1.05rem;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,0.06), transparent 34%),
    linear-gradient(180deg, #202020 0%, #111 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -22px 42px rgba(0,0,0,0.6),
    0 16px 36px rgba(0,0,0,0.45);
}

.app-title-block {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 0 88px;
}

.stage-spotlight {
  position: absolute;
  top: 1px;
  width: 126px;
  height: 104px;
  z-index: 3;
  pointer-events: none;
  filter:
    drop-shadow(0 16px 14px rgba(0,0,0,0.85))
    drop-shadow(0 0 10px rgba(232,169,35,0.18));
}

.stage-spotlight svg {
  width: 100%;
  height: 100%;
  display: block;
}

.stage-spotlight-left {
  left: 8px;
  transform: rotate(-10deg);
}

.stage-spotlight-right {
  right: 8px;
  transform: scaleX(-1) rotate(-10deg);
}

.spot-lens {
  filter:
    drop-shadow(0 0 6px rgba(255,207,87,0.95))
    drop-shadow(0 0 18px rgba(232,169,35,0.45));
}

.spot-beam {
  opacity: 0.7;
  animation: spotlightBeamPulse 3.8s ease-in-out infinite;
}

@keyframes spotlightBeamPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.8; }
}

.stage-header .app-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(40px, 10vw, 62px);
  letter-spacing: clamp(8px, 2.8vw, 18px);
  color: transparent;
  -webkit-text-stroke: 1.5px var(--gold);
  text-stroke: 1.5px var(--gold);
  line-height: 0.92;
  margin-right: 0;
  filter:
    drop-shadow(0 0 5px rgba(212,146,15,0.6))
    drop-shadow(0 0 16px rgba(212,146,15,0.25));
}

.stage-header .app-sub {
  margin-top: 8px;
  font-size: 9px;
  color: #8b8b8b;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ─────────────────────────────────────
   FINAL LIVE MODE PERFORMANCE LAYOUT
───────────────────────────────────── */
body.live-mode {
  height: 100dvh;
  overflow: hidden;
  padding: 0;
  background: #0b0b0b;
}

body.live-mode .app-shell {
  height: 100dvh;
  min-height: 100dvh;
  border-radius: 0;
  overflow: hidden;
}

body.live-mode .app-header,
body.live-mode .mode-tabs {
  display: none !important;
}

#panel-live.active {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: 10px;
  gap: 10px;
}

#panel-live .live-bpm-card {
  margin: 0;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

#panel-live .live-bpm-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

#panel-live .live-wheel-col {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
  min-height: 132px;
}

#panel-live .live-wheel-arrows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#panel-live .live-wheel-btn {
  width: 62px;
  height: 62px;
}

#panel-live .live-wheel-track {
  width: 62px;
  height: 132px;
  min-height: 132px;
}

#panel-live .live-bpm-center {
  flex: 1;
  min-width: 0;
  text-align: center;
  border-left: 1px solid rgba(255,255,255,0.07);
  padding-left: 12px;
}

#panel-live .live-bpm-num {
  font-size: clamp(86px, 27vw, 142px);
  line-height: 0.9;
}

#panel-live .live-bpm-label {
  margin-top: 4px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: var(--gold);
  letter-spacing: 7px;
}

#panel-live .live-beat-dots {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

#panel-live .live-sub-row {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}

#panel-live .live-sub-btn {
  flex: 1;
  min-height: 48px;
  background: linear-gradient(180deg,#323232,#161616);
  border: 1px solid #434343;
  border-bottom: 3px solid #090909;
  border-radius: 9px;
  color: #d8d3c8;
  cursor: pointer;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.15;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.09), 0 7px 12px rgba(0,0,0,0.34);
  transition: transform 0.08s;
}

#panel-live .live-sub-btn.on {
  background: linear-gradient(180deg,#ffd15a 0%,#e8a923 45%,#ad7413 100%) !important;
  color: #151515 !important;
  border-color: #f1bd42 !important;
  border-bottom-color: #7c510d !important;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

#panel-live .live-tap-hint {
  margin-top: 8px;
  font-size: 9px;
  color: #555;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
}

#panel-live .live-setlist-wrap {
  flex: 0 0 auto;
  max-height: none;
  overflow: hidden;
  min-height: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#panel-live .live-setlist-label {
  display: none;
}

#panel-live #live-setlist {
  display: grid;
  grid-template-rows: 58px 74px 58px;
  gap: 8px;
}

#panel-live .live-song-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-height: 0;
  margin: 0;
  background: linear-gradient(180deg,#232323,#171717);
  border-radius: 13px;
  border: 1px solid #333;
  cursor: pointer;
  opacity: 0.58;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 3px 9px rgba(0,0,0,0.25);
}

#panel-live .live-song-row.live-active {
  opacity: 1;
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(232,169,35,0.22), rgba(24,24,24,1) 58%);
  box-shadow:
    0 0 0 1px rgba(232,169,35,0.25),
    0 5px 16px rgba(232,169,35,0.12),
    inset 0 1px 0 rgba(255,255,255,0.07);
}

#panel-live .live-song-row.live-placeholder {
  opacity: 0.28;
  cursor: default;
}

#panel-live .live-row-name {
  font-size: 21px;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 1.2px;
  color: #d6d6d6;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#panel-live .live-song-row.live-active .live-row-name {
  color: var(--gold);
  font-size: 27px;
}

#panel-live .live-row-meta {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

#panel-live .live-song-row.live-active .live-row-meta {
  color: #f0f0f0;
}

#panel-live .live-bottom {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0;
  display: flex;
  gap: 8px;
}

#panel-live .live-nav-btn {
  flex: 1;
  min-height: 58px;
  padding: 14px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid #3a3a3a;
  border-bottom: 3px solid #090909;
  border-radius: 13px;
  background: linear-gradient(180deg,#282828,#161616);
  color: #aaa;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

#panel-live .live-nav-btn.primary {
  flex: 1.25;
  background: linear-gradient(180deg,#f0b732,#e8a923 45%,#b87a12);
  color: #161616;
  border-color: var(--gold);
  border-bottom-color: #8f5f0d;
  font-weight: 600;
}

#panel-live .live-nav-btn:disabled {
  color: #333;
  border-color: #282828;
  opacity: 0.42;
  cursor: default;
}

@media (max-width: 430px) {
  .app-header.stage-header {
    min-height: 120px;
  }

  .app-title-block {
    padding: 0 72px;
  }

  .stage-spotlight {
    width: 112px;
    height: 94px;
    top: 3px;
  }

  .stage-spotlight-left { left: 0; }
  .stage-spotlight-right { right: 0; }

  .stage-header .app-sub {
    font-size: 8px;
    letter-spacing: 2.4px;
  }
}

/* Desktop Live Mode: show full set list and allow normal scrolling. */
@media (min-width: 701px) {
  body.live-mode {
    height: auto;
    overflow: auto;
    padding: 8px;
    background:
      radial-gradient(circle at 50% -10%, rgba(232,169,35,0.16), transparent 30%),
      linear-gradient(180deg, #202020 0%, #101010 55%, #080808 100%);
  }

  body.live-mode .app-shell {
    height: auto;
    min-height: calc(100vh - 16px);
    border-radius: 28px;
    overflow: hidden;
  }

  #panel-live.active {
    height: auto;
    max-height: none;
    min-height: 100vh;
    overflow: visible;
    max-width: 760px;
    margin: 0 auto;
  }

  #panel-live .live-setlist-wrap {
    flex: 1;
    overflow-y: auto;
    max-height: none;
    padding: 14px;
    background:
      radial-gradient(circle at 50% 0%, rgba(255,255,255,0.08), transparent 42%),
      linear-gradient(180deg, #202020 0%, #111 100%);
    border: 1px solid var(--line);
    border-top-color: rgba(255,255,255,0.16);
    box-shadow: var(--shadow-deep);
  }

  #panel-live .live-setlist-label {
    display: block;
    font-size: 10px;
    color: var(--gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 10px;
  }

  #panel-live #live-setlist {
    display: block;
  }

  #panel-live .live-song-row {
    min-height: 64px;
    margin-bottom: 8px;
    opacity: 1;
  }

  #panel-live .live-song-row.live-active .live-row-name {
    font-size: 26px;
  }
}
