/* ============================================================================
 * DanceMirror Pose Compare - Main Stylesheet (Dance-Analyzer Aesthetic)
 * ============================================================================ */

/* --- Main App Container --- */
.dpc-app {
    font-family: sans-serif;
    background: #0d0f1a;
    color: #e0e8ff;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* --- Title Bar --- */
#dpc-titlebar {
    padding: 12px;
    background: #1a1e2e;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
    letter-spacing: 1px;
    color: #7eb8ff;
    border-bottom: 2px solid #333;
}

/* --- Viewports / Panels --- */
#dpc-viewports {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
    background: #0a0c14;
    transition: padding 0.3s;
}

.dpc-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 50%;
    position: relative;
    min-width: 0;
}

.dpc-panel-teacher {
    order: 1;
    background: #0d0f1a;
    border-right: 2px solid #000;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.dpc-panel-student {
    order: 2;
    background: #141724;
    z-index: 1;
}

/* --- Badges --- */
.dpc-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 30;
    font-weight: 900;
    font-size: 16px;
    letter-spacing: 2px;
    background: transparent;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0px 3px 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.dpc-badge-teacher {
    color: #7eb8ff;
}

.dpc-badge-student {
    color: #ff2a6d;
}

/* --- Media Wrappers & Canvas --- */
.dpc-media-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
}

.dpc-video,
.dpc-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    background: transparent;
}

.dpc-video {
    z-index: 10;
    display: none;
}

.dpc-canvas {
    z-index: 20;
    pointer-events: none;
}

.dpc-placeholder-msg {
    color: #555;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 80%;
    pointer-events: none;
    z-index: 5;
    line-height: 1.5;
}

/* --- 骨格表示ボタン（dance-analyzer の #btn-analyze-user と同一デザイン）
   動画読み込み/カメラ開始まで非表示、ユーザーが押すまでMediaPipeは起動しない。
   ON/OFFの配色（白抜き⇔ピンク塗り）は setTeacherAnalyzeBtnState/setStudentAnalyzeBtnState がJSで切り替える。 --- */
.dpc-analyze-btn {
    display: none;
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 30;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
}

/* --- Individual Playback Controls (Under Panels) --- */
.dpc-ctrl-individual {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    margin-bottom: 0;
    padding: 8px 10px;
    background: #131624;
    border-radius: 6px;
    border: 1px solid #1e2030;
    box-sizing: border-box;
    min-height: 48px;
    min-width: 0;
}

.dpc-btn-play {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: bold;
    background: #2a2e45;
    color: #a0c4ff;
    border: 1px solid #3a3f58;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.dpc-btn-play:hover {
    background: #3a3f58;
    color: #fff;
}

.dpc-btn-play-student {
    color: #ff9a00;
}

.dpc-btn-play-student:hover {
    background: #3a3f58;
    color: #ffb84d;
}

/* Range Inputs in playback strips */
.dpc-ctrl-individual input[type=range] {
    flex: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    height: 12px;
    border-radius: 4px;
    outline: none;
    padding: 0 6px;
    box-sizing: border-box;
    overflow: visible;
}

.dpc-panel-teacher .dpc-ctrl-individual input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5a9eff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 6px rgba(90, 158, 255, 0.6);
}

.dpc-panel-teacher .dpc-ctrl-individual input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5a9eff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 6px rgba(90, 158, 255, 0.6);
}

.dpc-panel-student .dpc-ctrl-individual input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff9a00;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 6px rgba(255, 154, 0, 0.6);
}

.dpc-panel-student .dpc-ctrl-individual input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff9a00;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 6px rgba(255, 154, 0, 0.6);
}

.dpc-frame-lbl {
    color: #7eb8ff;
    white-space: nowrap;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    min-width: 75px;
    text-align: right;
}

.dpc-panel-student .dpc-frame-lbl {
    color: #ff9a00;
}

/* --- Source Selection (動画枠の直下、各パネル内) --- */
.dpc-source-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    padding: 8px 10px;
}

/* --- Common Settings Card (Full Width Below Source Selection) --- */
.dpc-common-settings-card {
    background: #0f121e;
    border: 1px solid #252a42;
    border-radius: 8px;
    margin: 15px 10px 0 10px;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.dpc-common-settings-body {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    flex-wrap: nowrap;
}

/* 同期再生／音楽再生を1枠内で行として区別するための仕切り線 */
.dpc-common-settings-row + .dpc-common-settings-row {
    border-top: 1px solid #20263d;
}

.dpc-setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dpc-setting-music {
    flex: 1;
    min-width: 0;
}

.dpc-setting-sync {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.dpc-setting-sync .dpc-ctrl-individual {
    width: 100%;
}

.dpc-setting-label {
    font-size: 12px;
    font-weight: bold;
    color: #ccc;
    white-space: nowrap;
}

/* Speed Controls */
.dpc-speed-ctrl-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #141726;
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid #2a304e;
}

.dpc-btn-step {
    width: 22px;
    height: 22px;
    background: #252b47;
    color: #00d2ff;
    border: 1px solid #3d456f;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
    user-select: none;
}

.dpc-btn-step:hover {
    background: #00d2ff;
    color: #000;
    border-color: #00d2ff;
}

#dpc-num-speed {
    width: 48px;
    padding: 2px 2px 2px 6px;
    font-size: 12px;
    background: #0d0f1a;
    color: #00d2ff;
    border: 1px solid #333d60;
    border-radius: 4px;
    text-align: center;
    font-family: monospace;
    font-weight: bold;
}

.dpc-speed-unit {
    font-size: 11px;
    color: #888;
    margin-right: 2px;
}

/* Music Select */
.dpc-music-select-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.dpc-select-music {
    background: #141726;
    color: #fff;
    border: 1px solid #2a304e;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    min-width: 190px;
    transition: border-color 0.2s;
}

.dpc-select-music:focus {
    border-color: #00d2ff;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.3);
}

.dpc-music-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #1b2033;
    color: #888;
    border: 1px solid #2e3553;
    white-space: nowrap;
}

.dpc-music-badge.active {
    background: rgba(0, 210, 255, 0.15);
    color: #00d2ff;
    border-color: #00d2ff;
    box-shadow: 0 0 6px rgba(0, 210, 255, 0.2);
}

/* Audio Toggle Button / Audio Play Button */
.dpc-btn-audio-toggle,
.dpc-btn-audio-play {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    /* 有効状態デフォルト */
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.15) 0%, rgba(0, 180, 220, 0.15) 100%);
    color: #00d2ff;
    border: 1px solid #00a8cc;
}

.dpc-btn-audio-toggle:not(:disabled):hover,
.dpc-btn-audio-play:not(:disabled):hover {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.3) 0%, rgba(0, 180, 220, 0.3) 100%);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
    color: #40eaff;
}

/* 種目未選択 / URLなし：グレーアウト */
.dpc-btn-audio-toggle.dpc-audio-disabled,
.dpc-btn-audio-toggle:disabled,
.dpc-btn-audio-play.dpc-audio-disabled,
.dpc-btn-audio-play:disabled {
    background: #1b2033;
    color: #555;
    border: 1px solid #2a3050;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* 再生中アニメーション */
.dpc-btn-audio-toggle.dpc-audio-playing,
.dpc-btn-audio-play.dpc-audio-playing {
    background: linear-gradient(135deg, rgba(255, 42, 109, 0.25) 0%, rgba(0, 210, 255, 0.25) 100%);
    color: #ff9040;
    border: 1px solid #ff6a00;
    box-shadow: 0 0 10px rgba(255, 106, 0, 0.35);
    animation: dpc-pulse-play 1.4s ease-in-out infinite;
}

@keyframes dpc-pulse-play {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 106, 0, 0.3); }
    50%       { box-shadow: 0 0 18px rgba(255, 106, 0, 0.65); }
}

/* 2ボタングループ */
.dpc-audio-btn-group {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

/* STOPボタン */
.dpc-btn-audio-stop {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    background: linear-gradient(135deg, rgba(255, 42, 109, 0.15) 0%, rgba(200, 20, 80, 0.15) 100%);
    color: #ff2a6d;
    border: 1px solid #cc2255;
}

.dpc-btn-audio-stop:not(:disabled):hover {
    background: linear-gradient(135deg, rgba(255, 42, 109, 0.35) 0%, rgba(200, 20, 80, 0.35) 100%);
    box-shadow: 0 0 10px rgba(255, 42, 109, 0.45);
    color: #ff6090;
}

.dpc-btn-audio-stop.dpc-audio-disabled,
.dpc-btn-audio-stop:disabled {
    background: #1b2033;
    color: #555;
    border: 1px solid #2a3050;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* --- Controls Wrapper (Bottom 2-Column Cards) --- */
.dpc-controls-wrapper {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 0 10px 15px;
    box-sizing: border-box;
}

.dpc-panel-card {
    flex: 1;
    background: #0d0f1a;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dpc-card-top-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.dpc-speed-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
    margin-left: auto;
}

.dpc-speed-wrap input {
    width: 44px;
    padding: 2px 2px 2px 6px;
    font-size: 11px;
    background: #16192b;
    color: #00d2ff;
    border: 1px solid #444;
    border-radius: 4px;
    text-align: center;
    font-family: monospace;
}

.dpc-operation-area {
    padding: 15px;
    border-radius: 6px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dpc-operation-teacher {
    border: 1px solid rgba(0, 210, 255, 0.25);
    background: rgba(0, 210, 255, 0.02);
}

.dpc-operation-student {
    border: 1px solid rgba(255, 154, 0, 0.25);
    background: rgba(255, 154, 0, 0.01);
}

.dpc-area-title {
    font-size: 11px;
    color: #00d2ff;
    font-weight: bold;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.dpc-area-title-orange {
    color: #ff9a00;
}

.dpc-btn-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.dpc-card-spacer {
    flex-grow: 1;
    min-height: 15px;
}

/* --- Buttons --- */
.dpc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
    border: 1px solid transparent;
}

.dpc-btn-rec-open {
    background: #3d0016;
    color: #ff2a6d;
    border: 1px solid #ff2a6d;
    box-shadow: 0 0 8px rgba(255, 42, 109, 0.2);
}

.dpc-btn-rec-open:hover {
    background: #ff2a6d;
    color: #fff;
    box-shadow: 0 0 14px rgba(255, 42, 109, 0.5);
}

.dpc-btn-cyan {
    background: #002b3d;
    color: #00d2ff;
    border: 1px solid #00d2ff;
}

.dpc-btn-cyan:hover {
    background: #00d2ff;
    color: #000;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.4);
}

.dpc-btn-dark {
    background: #222;
    color: #888;
    border: 1px solid #444;
}

.dpc-btn-dark:hover {
    background: #333;
    color: #ccc;
}

.dpc-btn-primary {
    background: linear-gradient(135deg, #ff2a6d 0%, #9a00e6 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 42, 109, 0.3);
}

.dpc-btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 6px 16px rgba(255, 42, 109, 0.5);
}

.dpc-file-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    background: #1e2030;
    color: #a0c4ff;
    border: 1px solid #3a3f58;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.dpc-file-upload-btn:hover {
    background: #2a2e45;
    color: #fff;
    border-color: #7eb8ff;
}

.dpc-checkbox-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #ccc;
    white-space: nowrap;
    user-select: none;
}

.dpc-checkbox-label input[type="checkbox"] {
    accent-color: #ff2a6d;
    cursor: pointer;
}

/* Disabled states */
#dpc-app button:disabled,
#dpc-app button[disabled],
#dpc-app input:disabled,
#dpc-app input[disabled],
#dpc-app .dpc-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: none;
    filter: grayscale(60%);
}

/* --- Ghost Controls --- */
.dpc-ghost-controls {
    padding: 10px 15px;
    margin-top: 10px;
    margin-bottom: 10px;
    background: #131624;
    border-radius: 6px;
    border: 1px solid #1e2030;
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.dpc-ghost-slider-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dpc-ghost-slider-group input[type=range] {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    outline: none;
}

.dpc-ghost-label {
    font-size: 12px;
    font-weight: bold;
}

.dpc-ghost-label-teacher {
    color: #00d2ff;
}

.dpc-ghost-label-student {
    color: #c4a0ff;
}

/* --- Ghost Mode Viewport Overrides --- */
#dpc-viewports.dpc-ghost-mode {
    position: relative !important;
    width: 100% !important;
    max-width: 800px !important;
    aspect-ratio: 16 / 9 !important;
    margin: 0 auto 16px auto !important;
    overflow: hidden !important;
    display: block !important;
}

#dpc-viewports.dpc-ghost-mode .dpc-panel {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 16 / 9 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 1;
}

#dpc-viewports.dpc-ghost-mode .dpc-panel-student {
    z-index: 5 !important;
}

#dpc-viewports.dpc-ghost-mode .dpc-panel-teacher {
    z-index: 10 !important;
}

#dpc-viewports.dpc-ghost-mode .dpc-media-wrap {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 16 / 9 !important;
    background: transparent !important;
}

#dpc-viewports.dpc-ghost-mode .dpc-ctrl-individual,
#dpc-viewports.dpc-ghost-mode .dpc-badge {
    display: none !important;
}

/* --- Sync Bar & Status --- */
.dpc-sync-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dpc-btn-sync-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 7px 18px;
    font-size: 12px;
    font-weight: bold;
    background: #00d2ff;
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.3);
    transition: all 0.2s;
    white-space: nowrap;
}

.dpc-btn-sync-play:hover {
    background: #38e1ff;
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.6);
}

.dpc-status {
    font-size: 11px;
    color: #a0c4ff;
    margin: 0;
    line-height: 1.4;
    min-height: 1.2em;
}

.dpc-student-status-box {
    padding: 10px 12px;
    background: #131624;
    border-radius: 6px;
    border: 1px solid #1e2030;
    margin-bottom: 8px;
}

.dpc-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #aaa;
}

.dpc-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
    transition: all 0.3s;
}

.dpc-status-dot.active {
    background: #00d2ff;
    box-shadow: 0 0 8px #00d2ff;
}

.dpc-status-dot.recording {
    background: #ff2a6d;
    box-shadow: 0 0 8px #ff2a6d;
    animation: dpc-blink 1s infinite;
}

/* --- Camera Recording Modal (Dance-Analyzer Style) --- */
.dpc-modal {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.dpc-modal[style*="display: none"],
.dpc-modal[hidden] {
    display: none !important;
}

.dpc-modal-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpc-modal-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    z-index: 30;
    box-sizing: border-box;
}

.dpc-modal-header h3 {
    color: #fff;
    font-size: 16px;
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

.dpc-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
}

.dpc-modal-close:hover {
    color: #ff2a6d;
}

.dpc-modal-body {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dpc-modal-camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#dpc-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 150px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 30px #ff2a6d;
    z-index: 40;
    pointer-events: none;
}

.dpc-countdown-anim {
    animation: dpc-pop 1s linear infinite;
}

@keyframes dpc-pop {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.dpc-modal-footer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    z-index: 30;
    pointer-events: none;
}

.dpc-btn-modal-rec {
    pointer-events: auto;
    padding: 16px 40px;
    border-radius: 50px;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
    margin: 0 auto;
}

.dpc-btn-modal-rec-start {
    background: rgba(255, 42, 109, 0.85);
    color: white;
}

.dpc-btn-modal-rec-start:hover {
    background: rgba(255, 42, 109, 1);
    transform: scale(1.03);
}

.dpc-btn-modal-rec-stop {
    background: rgba(51, 51, 51, 0.85);
    color: white;
    border: 1px solid #666;
}

.dpc-btn-modal-rec-stop:hover {
    background: rgba(70, 70, 70, 0.95);
}

.dpc-rec-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.dpc-rec-dot.active {
    background: #ff2a6d;
    animation: dpc-blink 1s infinite;
}

.dpc-modal-btn-cancel {
    position: relative;
    z-index: 99999;
    pointer-events: auto;
    display: block;
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
    margin-top: 35px;
    color: #ff4a4a;
    font-size: 16px;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
    padding: 12px 30px;
}

.dpc-modal-btn-cancel:hover {
    color: #ff7b9c;
}

/* --- Mobile Sticky Bar --- */
#dpc-mobile-sticky-bar {
    display: none;
}

/* --- Loading Overlay --- */
.dpc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 30, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.dpc-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(0, 188, 212, 0.1);
    border-top-color: #ff2a6d;
    border-right-color: #00bcd4;
    border-radius: 50%;
    animation: dpc-spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    filter: drop-shadow(0 0 10px rgba(0, 188, 212, 0.5)) drop-shadow(0 0 15px rgba(255, 42, 109, 0.3));
}

.dpc-loading-text {
    color: #ffffff;
    margin-top: 25px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    font-family: sans-serif;
}

/* --- Animations --- */
@keyframes dpc-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes dpc-blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* --- Responsive Layout (Mobile <= 768px) --- */
@media (max-width: 768px) {
    /* MASTER/USER/同期再生いずれのシークバーも、スマホでは秒数表示を隠す */
    .dpc-frame-lbl {
        display: none;
    }

    #dpc-viewports {
        flex-direction: column;
        background: #000;
    }

    .dpc-panel {
        width: 100%;
    }

    .dpc-panel-teacher {
        order: 1;
        border-right: none;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
        z-index: 2;
    }

    .dpc-panel-student {
        order: 2;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
        margin-bottom: 15px;
        border-bottom: 1px solid #2a2e45;
    }

    .dpc-media-wrap {
        width: 100% !important;
        aspect-ratio: 16 / 9 !important;
        height: auto !important;
        min-height: unset !important;
    }

    #dpc-viewports.dpc-ghost-mode {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 16 / 9 !important;
        height: auto !important;
        display: block !important;
        margin: 0 auto !important;
    }

    #dpc-viewports.dpc-ghost-mode .dpc-panel,
    #dpc-viewports.dpc-ghost-mode .dpc-media-wrap {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 16 / 9 !important;
        margin-bottom: 0 !important;
        border-bottom: none !important;
    }

    .dpc-common-settings-card {
        margin: 10px 10px 0 10px;
    }

    .dpc-common-settings-body {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .dpc-setting-item {
        justify-content: space-between;
        width: 100%;
        min-width: 0;
    }

    .dpc-music-select-wrapper {
        flex-grow: 1;
        flex-wrap: wrap;
        justify-content: flex-end;
        min-width: 0;
    }

    .dpc-select-music {
        min-width: 0;
        max-width: 180px;
        flex: 1;
    }

    .dpc-audio-btn-group {
        flex-wrap: wrap;
    }

    .dpc-controls-wrapper {
        padding-bottom: 90px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    #dpc-mobile-sticky-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: #090b11;
        border-top: 1px solid #1e2030;
        z-index: 99999;
        padding: 10px 12px;
        box-sizing: border-box;
        gap: 8px;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
    }

    .dpc-mob-bar-btn {
        flex: 1;
        height: 100%;
        font-size: 11px;
        font-weight: bold;
        border-radius: 6px;
        border: 1px solid #3a3f58;
        background: #1e2030;
        color: #ccc;
        cursor: pointer;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        transition: all 0.2s;
    }

    .dpc-mob-bar-btn-primary {
        background: #00d2ff;
        color: #000;
        border-color: #00d2ff;
    }

    /* MASTER/USERの動画バッジ文字色（#7eb8ff / #ff2a6d）と統一 */
    .dpc-mob-bar-btn-master {
        color: #7eb8ff;
        border-color: #7eb8ff;
    }

    .dpc-mob-bar-btn-user {
        color: #ff2a6d;
        border-color: #ff2a6d;
    }
}
