/* ── Tune Player ──────────────────────────────────────── */

.gp-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

.gp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.gp-header h1 { font-size: 1.5rem; font-weight: 600; }

.header-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: right;
}

.site-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.footer-support {
    margin-top: 6px;
}

.footer-support a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.footer-support a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Floating donate button */
.floating-donate {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    transition: all 0.2s;
    z-index: 1000;
}

.floating-donate:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

@media (max-width: 640px) {
    .floating-donate {
        padding: 8px 14px;
        font-size: 0.8rem;
        bottom: 14px;
        right: 14px;
    }
}

/* Track info */
.track-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.track-name {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-duration {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--mono);
}

/* Waveform */
.waveform-wrap {
    position: relative;
    margin-bottom: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

#waveform {
    width: 100%;
    display: block;
    cursor: crosshair;
    touch-action: none;  /* prevent Safari from hijacking gestures */
}

.time-labels {
    display: flex;
    justify-content: space-between;
    padding: 4px 12px 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--mono);
}

/* Scroll bar */
.scroll-bar-wrap {
    padding: 2px 12px 10px;
}

.scroll-track {
    position: relative;
    height: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    cursor: pointer;
    touch-action: none;
}

.scroll-thumb {
    position: absolute;
    top: 1px;
    height: 10px;
    min-width: 24px;
    background: rgba(99, 102, 241, 0.45);
    border-radius: 5px;
    cursor: grab;
    transition: background 0.15s;
}

.scroll-thumb:hover,
.scroll-thumb.dragging {
    background: rgba(99, 102, 241, 0.7);
    cursor: grabbing;
}

/* View + Loop info row */
.view-loop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.loop-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.loop-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--mono);
    white-space: nowrap;
}

.loop-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.loop-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* View window control */
.view-window-ctrl {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.view-window-ctrl label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compact-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    width: 52px;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--mono);
    text-align: center;
}

.compact-input:focus {
    border-color: var(--accent);
    outline: none;
}

.unit {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.compact-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

.compact-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.compact-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Transport */
.transport {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.transport-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ctrl-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.ctrl-btn.play-btn {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.ctrl-btn.play-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.ctrl-btn.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.current-time {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1px;
}

/* Speed */
.speed-section, .volume-section {
    width: 100%;
    max-width: 520px;
}

.speed-label {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.speed-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.speed-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--mono);
    transition: all 0.2s;
}

.speed-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.speed-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Speed fine control row */
.speed-fine-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

/* Speed Trainer */
.trainer-toggle-row {
    width: 100%;
    display: flex;
    justify-content: center;
}

.trainer-toggle-row .active {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.trainer-panel {
    width: 100%;
    max-width: 520px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.trainer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.trainer-row label {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 50px;
    text-align: right;
}

.trainer-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--accent);
    width: 68px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--mono);
    text-align: center;
    font-weight: 600;
}

.trainer-input:focus {
    border-color: var(--accent);
    outline: none;
}

.trainer-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.trainer-actions {
    display: flex;
    gap: 8px;
}

.trainer-status {
    font-size: 0.82rem;
    font-family: var(--mono);
    text-align: center;
    min-height: 1.2em;
}

.trainer-status.active {
    color: var(--accent);
}

.trainer-status.reached {
    color: var(--success);
    font-weight: 600;
}

.speed-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 260px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.speed-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.speed-num-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--accent);
    width: 64px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: var(--mono);
    text-align: center;
    font-weight: 600;
}

.speed-num-input:focus {
    border-color: var(--accent);
    outline: none;
}

.speed-x {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--mono);
}

.speed-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

/* Loop actions */
.loop-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Loop adjust controls */
.loop-adjust {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 520px;
}

.loop-point {
    display: flex;
    align-items: center;
    gap: 4px;
}

.loop-point-label {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--success);
    width: 18px;
    text-align: center;
}

.adj-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: var(--mono);
    transition: all 0.15s;
    line-height: 1;
}

.adj-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.adj-btn.adj-fine {
    font-size: 0.7rem;
    padding: 4px 5px;
    color: var(--text-muted);
}

.loop-time-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--accent);
    width: 62px;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: var(--mono);
    text-align: center;
    font-weight: 600;
}

.loop-time-input:focus {
    border-color: var(--accent);
    outline: none;
}

/* Keyboard shortcuts */
.shortcuts {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.shortcuts span {
    color: var(--text-muted);
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 3px;
}

kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text);
}

/* Responsive */
@media (max-width: 640px) {
    .gp-container { padding: 16px; }
    .transport { padding: 16px; }
    .speed-slider { width: 160px; }
    .ctrl-btn { width: 40px; height: 40px; font-size: 0.85rem; }
    .ctrl-btn.play-btn { width: 52px; height: 52px; font-size: 1.2rem; }
    .shortcuts { gap: 8px; }
    .view-loop-row { flex-direction: column; align-items: flex-start; }
    .compact-slider { width: 80px; }
}
