html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: "MS Pゴシック" ;
}

video {
    height: 100dvh;
    width: 100%;
    object-fit: contain;
    position: absolute;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* 全体を右揃え */
}

.controls-top button {
    margin-left: 8px;
    padding: 10px 16px;
    font-size: 18px;
    color: #2196F3;
}

.controls-top {
    margin-bottom: 5px;
    /* ボタンとプルダウン群の間 */
}


.controls-menu button {
    margin-left: 8px;
    padding: 6px 8px;
    font-size: 16px;
    color: #2196F3;
}

.controls-menu {
    padding-bottom: 5px;
}

#menu_area {
    display: none;
    flex-direction: column;
    /* 縦並び */
    gap: 5px;
    /* 各行の間隔 */
    background: rgba(33, 150, 243, 0.75);
}

#menu_area label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
}

#menu_area .label-text {
    display: inline-block;
    width: 115px;
}

#menu_area select {
    padding: 6px 10px;
    font-size: 14px;
    width: 130px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#lang_label .label-text {
    width: 150px; !important;
}

#lang_label select {
    width: 60px; !important;
}

#ai_status {
    z-index: 1;
}

#ai_status img {
    position: absolute;
    bottom: 20px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 4px solid #ccc;
    border-radius: 8px;
    display: none;
}

#ai_command {
    z-index: 2;
}

#ai_command_action {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 10px;
    font-size: 20px;
    background: #8bdce8;
    opacity: 0.8;
    border: 4px solid #ccc;
    border-radius: 8px;
}

#closeInline {
    font-size: 20px;
}

#captionArea {
    display: none;
    z-index: 1;
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    height: 25%;
    background: #ccc;
    opacity: 0.6;
    font-size: 18px;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
}

.switch input {
    display: none;
    /* デフォルトのチェックボックス非表示 */
}

.slider {
    position: relative;
    width: 50px;
    height: 28px;
    background-color: #ccc;
    border-radius: 34px;
    transition: background-color 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

input:checked+.slider {
    background-color: #4caf50;
}

input:checked+.slider::before {
    transform: translateX(22px);
}

#loading-indicator {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.75);
	color: white;
	padding: 20px 30px;
	border-radius: 8px;
	font-size: 18px;
	z-index: 100;
	display: none;
	text-align: center;
}

.spinner {
	margin: 0 auto 10px auto;
	width: 32px;
	height: 32px;
	border: 4px solid #ffffff;
	border-top: 4px solid #888888;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}



/* オーバーレイ背景 */
.modal {
  position: fixed;
  inset: auto;
  display: block;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal .modal-card {
  position: fixed;
  right: 16px; bottom: 16px;
}
/* 非表示にするとき */
.modal[hidden] {
  display: none;
}

.modal-card {
  background: #fff;
  border-radius: 12px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  border: 1px solid rgba(127, 127, 127, 0.2);
}

/* Head */
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.modal-title { display: flex; align-items: center; gap: 10px; }
.modal-icon { font-size: 20px; }
#cp-title { font-size: 16px; margin: 0; }

/* Body */
.modal-body { padding: 16px 16px 8px; }
.modal-desc { margin: 12px 0 0; opacity: .8; line-height: 1.5; }

/* File summary */
.file-summary { display: flex; gap: 12px; align-items: center; }
.file-meta { min-width: 0; }
.file-name {
  font: 600 15px/1.3 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-info { font-size: 12px; opacity: .7; margin-top: 4px; }

/* Footer */
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08);
}

/* Buttons */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  border-radius: 10px; padding: 10px 14px; font-weight: 600;
  transition: transform .04s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: #2b8a3e; color: #fff;
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
  opacity: .9;
}
.icon-btn {
  appearance: none; background: transparent; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 6px; border-radius: 8px;
}
.icon-btn:hover { background: rgba(127,127,127,.15); }

/* ==== Download List Panel ==== */
.dl-panel {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px;
  pointer-events: none; /* パネル外のクリックを素通りさせたいなら調整 */
}
.dl-panel[hidden] { display: none; }

.dl-card {
  pointer-events: auto;
  background: #fff;
  border: 1px solid rgba(127,127,127,.2);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  width: min(320px, 90vw);
  max-height: 50vh;
  overflow: hidden;
}

.dl-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,.06);
}
.dl-title { font-weight: 700; }

.dl-list {
  margin: 0; padding: 8px 10px; list-style: none;
  max-height: calc(50vh - 44px); overflow: auto;
}

.dl-item + .dl-item { margin-top: 6px; }

.dl-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: none; background: #f8f9fb; cursor: pointer;
  border-radius: 8px;
}
.dl-row:hover { filter: brightness(0.98); }
.dl-row:active { transform: translateY(1px); }

.dl-name {
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dl-open { opacity: .7; font-size: 12px; }
#joinBtn {
  background: #2196F3;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 16px;
  cursor: pointer;
}
#joinBtn:disabled {
  background: #aaa;       /* グレー背景 */
  color: #666;            /* 文字も薄く */
  cursor: not-allowed;    /* カーソルを禁止マークに */
}
#menuBtn {
  background: #fff;
  color: #2196F3;
  border: 1px solid #000;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 16px;
  cursor: pointer;
}

#notice {
  background: #e5ed77;
  color: #e6540b;
  font-size: 16px;
  margin-bottom: 8px;
  display: none;
}