/* ============================================
   UI Floating — ドロップダウン・コンテキストメニュー・ツールチップ
   ============================================ */

/* --- Difficulty Drawer --- */
.difficulty-drawer {
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 0 15px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-5px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}

.difficulty-drawer.active {
    max-height: 100px;
    opacity: 1;
    transform: translateY(0);
    padding: 10px 15px;
}

/* --- Info Icon & Tooltip --- */
.info-icon {
    position: absolute;
    top: -28px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: var(--green-neon);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: help;
    box-shadow: 0 0 10px var(--green-glow-strong);
    z-index: 10;
}

.info-tooltip {
    position: absolute;
    top: 30px;
    right: 0;
    width: 280px;
    background: rgba(10, 20, 30, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--green-neon);
    border-radius: 12px;
    padding: 15px;
    color: #fff;
    font-size: 0.85rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 100;
}

.info-icon:hover .info-tooltip {
    opacity: 1;
    visibility: visible;
}

/* --- Assist Menu --- */
.assist-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 10px;
    z-index: 2000;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.assist-dropdown.active {
    display: block; opacity: 1; transform: translateY(0);
}

.assist-dropdown-content {
    background: rgba(10, 20, 30, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--green-neon);
    border-radius: 12px;
    width: 280px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.assist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(0, 188, 212, 0.2);
}

.assist-header h3 {
    font-size: 0.9rem;
    color: var(--green-neon);
    margin: 0;
}

.assist-header .close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 4px;
}

.assist-header .close-btn:hover {
    opacity: 1;
}

.assist-body {
    padding: 16px;
}

.assist-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

.label-text {
    font-size: 0.85rem;
    color: #eee;
}

.assist-child {
    padding-left: 20px;
}

.assist-child .label-text {
    font-size: 0.8rem;
    color: #ccc;
    position: relative;
    display: flex;
    align-items: center;
}

.assist-child .label-text::before {
    content: "└";
    margin-right: 6px;
    color: rgba(0, 188, 212, 0.4);
}

.switch-row input {
    display: none;
}

/* --- Slider --- */
.slider {
    position: relative;
    width: 44px; height: 22px;
    background: #333; border-radius: 20px;
}

.slider:before {
    content: ""; position: absolute;
    width: 18px; height: 18px; left: 2px; bottom: 2px;
    background: #999; border-radius: 50%; transition: 0.3s;
}

input:checked + .slider { background: var(--green-neon); }
input:checked + .slider:before { transform: translateX(22px); background: #fff; }

/* --- Context Menu --- */
.context-menu {
    position: fixed; display: none; background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--green-neon); border-radius: 8px;
    z-index: 3000; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    padding: 8px; gap: 8px; align-items: stretch; pointer-events: none;
    transform: translate(-50%, -50%);
    width: 160px; min-height: 80px;
}
.context-menu.active { display: flex; }
.cm-item {
    padding: 10px 15px; background: rgba(255, 255, 255, 0.1);
    color: white; border-radius: 4px; cursor: pointer;
    font-size: 0.9rem; font-weight: bold; text-align: center;
    transition: all 0.2s;
}
.cm-item:hover { background: var(--green-neon); color: black; }
.cm-group-right { display: flex; flex-direction: column; gap: 8px; }

/* --- Hint Area (wrapper) --- */
.hint-area {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Hint Log Toggle Button */
.hint-log-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.4);
    color: var(--warning);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hint-log-toggle-btn:hover {
    background: rgba(255, 152, 0, 0.15);
}

.hint-log-badge {
    background: var(--warning);
    color: #000;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Hint Log Panel */
.hint-log-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 2000;
    background: rgba(10, 20, 30, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--warning);
    border-radius: 12px;
    width: 320px;
    max-height: 300px;
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.hint-log-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.hint-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 152, 0, 0.3);
    color: var(--warning);
    font-weight: bold;
    font-size: 0.85rem;
}

.hint-log-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.hint-log-close:hover {
    color: #fff;
}

/* Log List */
.hint-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 240px;
    overflow-y: auto;
}

.hint-log-list:empty::after {
    content: 'まだヒントを使用していません';
    display: block;
    padding: 20px;
    text-align: center;
    color: #607d8b;
    font-size: 0.85rem;
}

.hint-log-item {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.hint-log-item:hover {
    background: rgba(255, 152, 0, 0.1);
}

.hint-log-item.active {
    background: rgba(255, 152, 0, 0.15);
    border-left: 3px solid var(--warning);
}

.hint-log-item:last-child {
    border-bottom: none;
}

.hint-log-pos {
    font-family: var(--font-title);
    font-size: 0.75rem;
    color: var(--warning);
    white-space: nowrap;
    min-width: 42px;
    padding-top: 2px;
}

.hint-log-advice {
    font-size: 0.8rem;
    color: #b0bec5;
    line-height: 1.4;
}
