/* Adem Meter — Stylesheet v1.0.0 */

.adem-meter-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 3rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Header ── */
.am-header {
    text-align: center;
    margin-bottom: 2rem;
}

.am-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
    padding: 0;
    border: none;
}

.am-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* ── Stage ── */
.am-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    max-width: 320px;
}

.am-hint {
    font-size: 0.9375rem;
    color: #6b7280;
    text-align: center;
    margin: 0;
    min-height: 1.5em;
    line-height: 1.5;
    transition: opacity 0.2s;
}

/* ── Ring + Button ── */
.am-ring-wrap {
    position: relative;
    width: 204px;
    height: 204px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.am-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 204px;
    height: 204px;
    display: none;
}

.am-ring-bg {
    stroke: #e5e7eb;
}

.am-ring-arc {
    stroke: #1a1a2e;
    stroke-dasharray: 603.2;
    stroke-dashoffset: 603.2;
    transition: stroke-dashoffset 0.1s linear;
}

.am-btn {
    position: relative;
    width: 192px;
    height: 192px;
    border-radius: 50%;
    border: none;
    background: #1a1a2e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    transition: transform 0.1s, background 0.2s;
    box-shadow: 0 4px 24px rgba(26, 26, 46, 0.18);
    outline: none;
}

.am-btn:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 4px;
}

.am-btn:active {
    transform: scale(0.95);
}

.am-btn.am-done {
    cursor: default;
    pointer-events: none;
    background: #374151;
}

.am-count {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    user-select: none;
    pointer-events: none;
}

/* ── Reset button ── */
.am-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.75rem;
    color: #6b7280;
    padding: 6px 12px;
    border-radius: 6px;
    margin-top: 1.25rem;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.am-reset:hover {
    background: #f3f4f6;
    color: #374151;
}

.am-reset svg {
    flex-shrink: 0;
}

/* ── Result state ── */
.am-result-bpm {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    display: block;
    margin-bottom: 4px;
}

/* ── Responsive ── */
@media (min-width: 480px) {
    .am-title {
        font-size: 1.875rem;
    }
    .am-ring-wrap {
        width: 228px;
        height: 228px;
    }
    .am-ring {
        width: 228px;
        height: 228px;
    }
    .am-btn {
        width: 216px;
        height: 216px;
    }
    .am-count {
        font-size: 4rem;
    }
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
    .am-title {
        color: #f9fafb;
    }
    .am-subtitle,
    .am-hint {
        color: #9ca3af;
    }
    .am-btn {
        background: #4f46e5;
        box-shadow: 0 4px 24px rgba(79, 70, 229, 0.3);
    }
    .am-btn.am-done {
        background: #6366f1;
    }
    .am-btn:focus-visible {
        outline-color: #818cf8;
    }
    .am-ring-bg {
        stroke: #374151;
    }
    .am-ring-arc {
        stroke: #818cf8;
    }
    .am-result-bpm {
        color: #f9fafb;
    }
    .am-reset:hover {
        background: #1f2937;
        color: #d1d5db;
    }
}
