/* Mouse Drag Test — stitched mousepad arena, live ink trail. */

.mouse-drag-test-page {
    --mdt-ink: #ff6b2d;
    --mdt-ink-soft: rgba(255, 107, 45, 0.28);
    --mdt-land: #2dd4bf;
    --mdt-ok: #34d399;
    --mdt-break: #fb7185;
    --mdt-pad: #12161c;
    --mdt-pad-2: #1a2028;
    --mdt-stitch: #3a4656;
    --mdt-grid: rgba(255, 107, 45, 0.07);
    --mdt-paper: #ffffff;
    --mdt-line: #e4e4e7;
}

html.dark .mouse-drag-test-page {
    --mdt-paper: rgba(18, 24, 38, 0.82);
    --mdt-line: rgba(255, 255, 255, 0.08);
}

.mdt-wrap {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
}

.mdt-card {
    background: var(--mdt-paper);
    border: 1px solid var(--mdt-line);
    box-shadow: 0 12px 32px -22px rgba(15, 23, 42, 0.35);
}

.mdt-trust {
    background:
        linear-gradient(90deg, var(--mdt-ink-soft), transparent 34%),
        rgba(244, 244, 245, 0.94);
}

html.dark .mdt-trust {
    background:
        linear-gradient(90deg, rgba(255, 107, 45, 0.12), transparent 36%),
        rgba(9, 13, 22, 0.7);
}

.mdt-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mdt-land);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18), 0 0 10px rgba(45, 212, 191, 0.55);
}

.mdt-led.is-warn {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* Toolbar sitting on the desk, above the pad */
.mdt-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.mdt-mode-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.3rem;
    border-radius: 1.1rem;
    background: #f4f4f5;
    border: 1px solid var(--mdt-line);
}

@media (min-width: 640px) {
    .mdt-mode-rail {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

html.dark .mdt-mode-rail {
    background: rgba(9, 13, 22, 0.72);
}

.drag-mode-btn,
.btn-select-mouse-btn {
    color: #3f3f46;
    background: transparent;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    min-height: 40px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.01em;
    border-radius: 0.8rem;
}

html.dark .drag-mode-btn,
html.dark .btn-select-mouse-btn {
    color: #d4d4d8;
}

.drag-mode-btn:hover,
.btn-select-mouse-btn:hover {
    color: var(--mdt-ink);
}

.drag-mode-btn.active,
.btn-select-mouse-btn.active {
    background: var(--mdt-ink);
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(255, 107, 45, 0.32);
}

.mdt-btn-row {
    display: flex;
    border-radius: 0.9rem;
    background: #f4f4f5;
    border: 1px solid var(--mdt-line);
    padding: 0.25rem;
}

html.dark .mdt-btn-row {
    background: rgba(9, 13, 22, 0.72);
}

.mdt-chip {
    flex: 1;
    min-height: 38px;
    border-radius: 0.75rem;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid var(--mdt-line);
    background: #f4f4f5;
    color: #3f3f46;
    cursor: pointer;
}

html.dark .mdt-chip {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: #d4d4d8;
}

.mdt-chip.is-on {
    background: rgba(255, 107, 45, 0.12);
    border-color: rgba(255, 107, 45, 0.35);
    color: var(--mdt-ink);
}

.mdt-chip.is-muted {
    opacity: 0.72;
}

/* Stitched mousepad */
.drag-workspace {
    --mdt-pad-h: 420px;
    position: relative;
    height: var(--mdt-pad-h);
    background:
        radial-gradient(1200px 280px at 50% -10%, rgba(255, 107, 45, 0.12), transparent 55%),
        linear-gradient(180deg, var(--mdt-pad-2), var(--mdt-pad));
    border: 1px solid #0b0e12;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 24px 50px -28px rgba(0, 0, 0, 0.7);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    overflow: hidden;
}

@media (min-width: 640px) {
    .drag-workspace {
        --mdt-pad-h: 480px;
    }
}

@media (min-width: 1024px) {
    .drag-workspace {
        height: min(480px, calc(100vh - 16.5rem));
    }
}

.drag-workspace::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 1.35rem;
    border: 1.5px dashed var(--mdt-stitch);
    pointer-events: none;
    z-index: 2;
    opacity: 0.55;
}

.drag-workspace::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--mdt-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--mdt-grid) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse at 50% 48%, #000 18%, transparent 78%);
    pointer-events: none;
    z-index: 1;
}

.drag-workspace.is-dragging {
    cursor: grabbing;
}

.mdt-hud {
    position: absolute;
    top: 14px;
    left: 16px;
    right: 16px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 1rem;
    background: rgba(10, 12, 16, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: #fff;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 640px) {
    .mdt-hud {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: center;
    }
}

.mdt-hud span.label {
    display: block;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a1a1aa;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
}

.mdt-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    background: rgba(10, 12, 16, 0.72);
    backdrop-filter: blur(4px);
    transition: opacity 0.28s ease;
}

.mdt-overlay.hidden {
    display: none;
}

.mdt-mouse-glyph {
    width: 72px;
    height: 88px;
    margin-bottom: 1rem;
    color: var(--mdt-ink);
    filter: drop-shadow(0 8px 18px rgba(255, 107, 45, 0.35));
}

.mdt-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1.25rem;
    border-radius: 0.9rem;
    background: var(--mdt-ink);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(255, 107, 45, 0.32);
    cursor: pointer;
    border: 0;
}

.mdt-cta:hover {
    filter: brightness(1.05);
}

/* Puck */
.draggable-item {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 999px;
    background:
        radial-gradient(circle at 32% 28%, #fff7, transparent 42%),
        linear-gradient(160deg, #ff8a4c, var(--mdt-ink) 55%, #c2410c);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 12px 28px rgba(255, 107, 45, 0.38), 0 0 0 6px var(--mdt-ink-soft);
    will-change: transform, left, top;
    z-index: 20;
}

@media (min-width: 640px) {
    .draggable-item {
        width: 5.15rem;
        height: 5.15rem;
    }
}

.draggable-item.is-dragging,
.draggable-item:active {
    cursor: grabbing;
    transform: scale(1.07);
    box-shadow: 0 16px 36px rgba(255, 107, 45, 0.5), 0 0 0 8px rgba(255, 107, 45, 0.22);
}

.draggable-item .mdt-puck-kicker {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Landing pad */
.drop-target-zone {
    width: 6.4rem;
    height: 6.4rem;
    border-radius: 999px;
    border: 2px dashed rgba(45, 212, 191, 0.55);
    background: radial-gradient(circle, rgba(45, 212, 191, 0.16) 0%, rgba(45, 212, 191, 0.04) 70%);
    color: var(--mdt-land);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 15;
    user-select: none;
    touch-action: none;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 640px) {
    .drop-target-zone {
        width: 7.25rem;
        height: 7.25rem;
    }
}

.drop-target-zone.drag-over {
    background: rgba(45, 212, 191, 0.28);
    border-color: var(--mdt-land);
    border-style: solid;
    transform: scale(1.08);
    box-shadow: 0 0 0 10px rgba(45, 212, 191, 0.12), 0 0 28px rgba(45, 212, 191, 0.35);
}

.drop-target-zone.drop-success {
    background: rgba(52, 211, 153, 0.28);
    border-color: var(--mdt-ok);
    color: var(--mdt-ok);
    transform: scale(1.1);
}

.multi-item {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    will-change: transform, left, top;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.multi-item.is-dragging,
.multi-item:active {
    transform: scale(1.08);
    cursor: grabbing;
    z-index: 50;
}

.multi-target {
    user-select: none;
    touch-action: none;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.multi-target.drag-over {
    border-style: solid;
    transform: scale(1.08);
}

.hold-pad {
    width: 11.5rem;
    height: 11.5rem;
    border-radius: 999px;
    border: 4px solid rgba(255, 107, 45, 0.45);
    background: radial-gradient(circle at 50% 40%, rgba(255, 107, 45, 0.22), rgba(18, 22, 28, 0.2));
    color: #fff;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 40px rgba(255, 107, 45, 0.12);
}

@media (min-width: 640px) {
    .hold-pad {
        width: 13.5rem;
        height: 13.5rem;
    }
}

.hold-pad:active,
.hold-pad.active {
    transform: scale(0.97);
    border-color: var(--mdt-ink);
    background: rgba(255, 107, 45, 0.22);
}

.hold-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 2px solid var(--mdt-ink);
    opacity: 0;
    pointer-events: none;
}

.hold-pad:active .hold-pulse-ring,
.hold-pad.active .hold-pulse-ring {
    opacity: 1;
    animation: mdt-hold-pulse 1.2s infinite ease-out;
}

@keyframes mdt-hold-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.38); opacity: 0; }
}

.mdt-stat {
    padding: 0.9rem 1rem;
    border-radius: 1.05rem;
    background: #fafafa;
    border: 1px solid var(--mdt-line);
}

html.dark .mdt-stat {
    background: rgba(9, 13, 22, 0.55);
}

.mdt-stat .k {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #71717a;
    margin-bottom: 0.15rem;
}

.mdt-stat .v {
    font-size: 1.65rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.mdt-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 12px;
}

html.dark .mdt-row {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.mdt-note {
    padding: 0.9rem 1rem;
    border-radius: 1.05rem;
    background: rgba(255, 107, 45, 0.08);
    border: 1px solid rgba(255, 107, 45, 0.18);
    font-size: 12px;
}

.mdt-action {
    flex: 1;
    min-height: 42px;
    border-radius: 0.9rem;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
}

.mdt-action.is-primary {
    background: var(--mdt-ink);
    color: #fff;
}

.mdt-action.is-ghost {
    background: #f4f4f5;
    color: #27272a;
    border: 1px solid var(--mdt-line);
}

html.dark .mdt-action.is-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: #e4e4e7;
}

.mdt-honest {
    border-top: 1px solid var(--mdt-line);
}

@media (prefers-reduced-motion: reduce) {
    .hold-pulse-ring,
    .draggable-item,
    .drop-target-zone,
    .mdt-overlay {
        animation: none !important;
        transition: none !important;
    }
}
