/* ===== GameHospital 自訂下拉選單（統一原生 select 外觀，面板固定向下展開） ===== */
.cs {
    position: relative;
    display: block;
    width: 100%;
}

/* 展開時整個元件抬升，面板才不會被後方的卡片／標籤蓋住 */
.cs.is-open {
    z-index: 200;
}

/* 原生 select 保留在 DOM 中（透明疊放）以維持表單送出與 required 驗證 */
.cs-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.cs-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    color: var(--text, #f7f7f8);
    background: rgba(255, 255, 255, 0.04);
    font: inherit;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.cs.is-open .cs-trigger,
.cs-trigger:focus-visible {
    border-color: rgba(0, 191, 209, 0.58);
    background: rgba(0, 191, 209, 0.06);
    box-shadow: 0 0 0 4px rgba(0, 191, 209, 0.10);
    outline: none;
}

.cs-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs.is-placeholder .cs-label {
    color: rgba(255, 255, 255, 0.42);
}

.cs-caret {
    flex: 0 0 auto;
    display: inline-flex;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease, color 0.2s ease;
}

.cs-caret svg {
    display: block;
    width: 16px;
    height: 16px;
}

.cs.is-open .cs-caret {
    transform: rotate(180deg);
    color: var(--accent, #00bfd1);
}

.cs-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 200;
    max-height: min(72vh, 392px);
    overflow-y: auto;
    scrollbar-width: none;
    padding: 6px;
    border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
    border-radius: 14px;
    background: #0d1316;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.cs-panel::-webkit-scrollbar { width: 0; height: 0; display: none; }

.cs.is-open .cs-panel {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* 選項可帶 icon（data-icon）：icon＋文字綁在一起 */
.cs-opt-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.cs-opt-icon {
    width: 1.05em;
    text-align: center;
    flex: 0 0 auto;
    color: rgba(0, 191, 209, 0.82);
    font-size: 0.92em;
}
/* 觸發鈕的 icon 與文字間距（觸發鈕不是 flex，靠 margin 撐開，避免 icon 黏住文字） */
.cs-label .cs-opt-icon { margin-right: 8px; }

.cs-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--text, #f7f7f8);
    font-size: 0.98rem;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cs-option:hover,
.cs-option.is-active {
    background: rgba(0, 191, 209, 0.12);
    color: var(--accent, #00bfd1);
}

.cs-option.is-selected {
    color: var(--accent, #00bfd1);
    font-weight: 700;
}

.cs-option.is-selected::after {
    content: "\f058";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 0.95em;
}

/* 選項／按鈕的 FontAwesome 圖示（沿用桌機標籤的圖示） */
.cs-opt-icon {
    flex: 0 0 auto;
    width: 1.05em;
    text-align: center;
    color: var(--muted-2, #8b9197);
}

.cs-option:hover .cs-opt-icon,
.cs-option.is-active .cs-opt-icon,
.cs-option.is-selected .cs-opt-icon {
    color: inherit;
}

.cs-option.is-disabled {
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.cs-option.is-disabled:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.3);
}

@media (prefers-reduced-motion: reduce) {
    .cs-panel,
    .cs.is-open .cs-panel { transition: opacity 0.15s ease; transform: none; }
    .cs-caret { transition: color 0.2s ease; }
}

/* 手機：選項列加大、間距放寬，讓手指更好點按 */
@media (max-width: 760px) {
    .cs-trigger {
        min-height: 56px;
    }

    .cs-panel {
        padding: 8px;
        border-radius: 16px;
        max-height: min(80vh, 480px);
    }

    .cs-option {
        gap: 12px;
        padding: 15px 16px;
        border-radius: 12px;
        font-size: 1.04rem;
    }
}
