.mandamat-tw16-360 {
    --tw16-green: #a8d500;
    --tw16-navy: #2a3941;
    --tw16-paper: #f4f6f6;
    --tw16-line: rgba(42, 57, 65, 0.09);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    color: var(--tw16-navy);
    font-family: "Open Sans", Arial, sans-serif;
}

.mandamat-tw16-360 *,
.mandamat-tw16-360 *::before,
.mandamat-tw16-360 *::after {
    box-sizing: border-box;
}

.tw16-toolbar,
.tw16-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tw16-toolbar {
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tw16-pill,
.tw16-mode,
.tw16-tool {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.tw16-pill {
    min-width: 126px;
    padding: 11px 15px;
    text-align: center;
}

.tw16-status {
    min-width: 86px;
    color: var(--tw16-green);
}

.tw16-mode-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.tw16-mode {
    appearance: none;
    padding: 9px 15px;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.tw16-mode:hover {
    color: var(--tw16-green);
}

.tw16-mode.is-active {
    background: var(--tw16-green);
    color: var(--tw16-navy);
}

.tw16-stage {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 390px;
    max-height: 720px;
    border-radius: 22px;
    background: var(--tw16-paper);
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 18px 50px rgba(0, 0, 0, 0.16);
}

.tw16-stage:active {
    cursor: grabbing;
}

.tw16-stage:focus-visible {
    box-shadow: inset 0 0 0 3px var(--tw16-green), 0 18px 50px rgba(0, 0, 0, 0.16);
}

.tw16-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--tw16-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--tw16-line) 1px, transparent 1px),
        radial-gradient(circle at 50% 44%, rgba(168, 213, 0, 0.14), transparent 48%);
    background-size: 48px 48px, 48px 48px, auto;
}

.tw16-grid::after {
    content: "TW16-4";
    position: absolute;
    right: 4%;
    bottom: 2%;
    color: rgba(42, 57, 65, 0.045);
    font-size: clamp(74px, 14vw, 190px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.07em;
}

.tw16-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    transition: opacity 100ms ease;
}

.tw16-image.is-loading {
    opacity: 0.35;
}

.tw16-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(42, 57, 65, 0.88);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 160ms ease, transform 160ms ease;
}

.tw16-arrow:hover {
    background: var(--tw16-green);
    color: var(--tw16-navy);
    transform: translateY(-50%) scale(1.06);
}

.tw16-arrow svg,
.tw16-tool svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tw16-prev { left: 18px; }
.tw16-next { right: 18px; }

.tw16-drag-hint {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 2;
    padding: 9px 15px;
    border-radius: 999px;
    background: rgba(42, 57, 65, 0.88);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    transform: translateX(-50%);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
}

.tw16-drag-hint span {
    color: var(--tw16-green);
    padding: 0 5px;
}

.mandamat-tw16-360.has-interacted .tw16-drag-hint {
    opacity: 0;
    transform: translate(-50%, 8px);
}

.tw16-controls {
    margin-top: 15px;
}

.tw16-dots {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.tw16-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.32);
    cursor: pointer;
    transition: width 160ms ease, background 160ms ease;
}

.tw16-dot.is-active {
    width: 27px;
    border-radius: 999px;
    background: var(--tw16-green);
}

.tw16-tools {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.tw16-tool {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tw16-tool:hover,
.tw16-tool:focus-visible {
    border-color: var(--tw16-green);
    color: var(--tw16-green);
}

.tw16-play-icon {
    fill: currentColor !important;
    stroke: none !important;
}

.tw16-pause-icon {
    display: none;
    fill: currentColor !important;
    stroke: none !important;
}

.tw16-play.is-playing .tw16-play-icon { display: none; }
.tw16-play.is-playing .tw16-pause-icon { display: block; }

.mandamat-tw16-360:fullscreen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: none;
    padding: 24px;
    background: var(--tw16-navy);
}

.mandamat-tw16-360:fullscreen .tw16-stage {
    max-height: calc(100vh - 145px);
}

@media (max-width: 767px) {
    .tw16-toolbar {
        justify-content: center;
    }

    .tw16-angle,
    .tw16-status {
        min-width: 0;
    }

    .tw16-mode-switch {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .tw16-stage {
        min-height: 310px;
        aspect-ratio: 4 / 3;
        border-radius: 16px;
    }

    .tw16-grid {
        background-size: 32px 32px, 32px 32px, auto;
    }

    .tw16-arrow {
        width: 40px;
        height: 40px;
    }

    .tw16-prev { left: 10px; }
    .tw16-next { right: 10px; }

    .tw16-drag-hint {
        bottom: 11px;
        white-space: nowrap;
    }

    .tw16-controls {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mandamat-tw16-360 *,
    .mandamat-tw16-360 *::before,
    .mandamat-tw16-360 *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

