/* genesis/web-app/styles/page-starmap.css */
/* 創世の星図（Starmap）専用のスタイル設定 */

/* 共通の背景色と模様を消して、宇宙の画像と同じ深い黒色で塗りつぶします */
html,
body {
    background-color: #020403;
    background-image: none;
}

/* --- Loading Screen --- */
#startup-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #020403;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-out;
}

.loader-text {
    color: var(--primary-cyan);
    font-family: 'Cinzel', serif;
    font-size: 1.5em;
    letter-spacing: 2px;
    margin-bottom: 20px;
    animation: pulseText 2s infinite alternate;
    text-shadow: 0 0 15px var(--primary-glow);
    text-align: center;
    padding: 0 20px;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-cyan);
    border-right: 2px solid var(--primary-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* --- Canvas & Map --- */
#starmap-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: crosshair;
}

#starmap-container.dragging {
    cursor: grabbing !important;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ★追加：手前の透明な画用紙用のスタイル（HTMLの直書きstyleを排除） */
#effectCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#target-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid var(--primary-cyan);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: none;
    box-shadow: 0 0 15px var(--primary-glow), inset 0 0 10px var(--primary-glow);
    z-index: 5;
}

#target-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--primary-cyan);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* --- UI Panels --- */
/*.top-nav {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    pointer-events: auto;
}*/

#zoom-controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-zoom {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.btn-zoom-reset {
    font-size: 0.8em;
}

.btn-toggle-rings {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin-top: 10px;
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
}

.btn-toggle-rings.off {
    color: var(--text-muted);
    border-color: var(--border-dark);
}

/* --- コントロールパネル本体 --- */
#control-panel {
    position: fixed;
    bottom: 5px;
    right: 20px;
    width: 280px;
    background: rgba(11, 16, 13, 0.85);
    border: 1px solid var(--border-dark);
    border-top: 3px solid var(--primary-cyan);
    border-radius: var(--radius);
    padding: 15px;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
}

.panel-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3em;
    color: var(--primary-cyan);
    margin: -10px 0 0 0;
    text-shadow: 0 0 10px var(--primary-glow);
    letter-spacing: 1px;
}

#panel-toggle {
    position: absolute;
    top: 12px;
    right: 15px;
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--primary-cyan);
    font-size: 0.75em;
    cursor: pointer;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: monospace;
    transition: 0.3s;
    font-weight: bold;
}

#panel-toggle:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--primary-cyan);
}

.panel-content-wrap {
    max-height: 1000px;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border-dark) transparent;
}

.panel-content-wrap::-webkit-scrollbar {
    width: 4px;
}

.panel-content-wrap::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

#control-panel.collapsed .panel-content-wrap {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    margin-top: 0;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85em;
}

.status-label {
    color: var(--text-muted);
}

.status-value {
    font-weight: bold;
    color: #fff;
}

.credit-value {
    color: var(--accent-amber);
    font-size: 1.3em;
    text-shadow: 0 0 5px rgba(230, 171, 8, 0.5);
}

/* 凡例（Legend） */
#legend-box {
    display: none;
}

.legend-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 5px;
    font-size: 0.75em;
    font-family: monospace;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-ring {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid transparent;
    margin-right: 8px;
    display: inline-block;
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-dark);
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85em;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}

.tab-btn.active {
    color: var(--primary-cyan);
    border-bottom-color: var(--primary-cyan);
    text-shadow: 0 0 5px var(--primary-glow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- 配置フォーム用ユーティリティクラス --- */
.connect-btn-wrapper {
    margin-top: 5px;
    margin-bottom: 15px;
    text-align: center;
}

.btn-connect-starmap {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.95em !important;
    padding: 10px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#settings-area {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s;
}

#settings-area.active {
    opacity: 1;
    pointer-events: auto;
}

.coord-form-group {
    text-align: center;
    margin-bottom: 8px;
}

.coord-help-text {
    color: var(--text-muted);
    font-size: 0.75em;
}

.name-help-wrapper {
    text-align: end;
}

.flex-row-gap {
    display: flex;
    gap: 10px;
}

.flex-1 {
    flex: 1;
}

.float-right {
    float: right;
}

.turnstile-wrapper {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    transform: scale(0.85);
    transform-origin: center center;
    margin-bottom: -5px;
}

.place-action-wrapper {
    position: relative;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.name-group label {
    display: block;
    font-size: 0.95em;
    color: var(--text-main);
    margin-bottom: 4px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    cursor: pointer;
    margin-top: 5px;
}

.checkbox-group input {
    cursor: pointer;
    accent-color: var(--primary-cyan);
}

.coord-display {
    font-family: monospace;
    color: var(--primary-cyan);
    font-size: 1em;
    background: rgba(0, 229, 255, 0.05);
    padding: 4px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    text-align: center;
    border-radius: 4px;
    margin-bottom: 5px;
}

.preview-box {
    width: 100%;
    height: 70px;
    background: #000;
    border: 1px dashed var(--border-dark);
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.preview-label {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 0.65em;
    color: var(--text-muted);
}

#preview-star {
    border-radius: 50%;
    transition: background-color 0.3s, box-shadow 0.3s;
}

@keyframes previewBlink {
    0% {
        opacity: 0.3;
        transform: scale(0.85);
    }

    100% {
        opacity: 1;
        transform: scale(1.15);
    }
}

.btn-action {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    font-family: 'Cinzel', serif;
    font-size: 1em;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.3s;
    text-transform: uppercase;
    margin-top: 8px;
    box-sizing: border-box;
}

.btn-action:hover:not(:disabled) {
    background: var(--primary-cyan);
    color: #000;
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-action:disabled {
    border-color: #444;
    color: #666;
    cursor: not-allowed;
}

/* --- ツールチップ --- */
#star-tooltip {
    position: absolute;
    background: rgba(11, 16, 13, 0.95);
    border: 1px solid var(--primary-cyan);
    border-radius: var(--radius);
    padding: 15px;
    z-index: 10;
    display: none;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
    font-size: 0.85em;
    transform: translate(-50%, -100%);
    margin-top: -15px;
    pointer-events: auto;
    min-width: 180px;
    font-family: 'Noto Serif JP', serif;
}

#star-tooltip.core-style {
    border-color: #fff;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    background: rgba(5, 5, 5, 0.95);
}

#star-tooltip.core-style::after {
    border-color: #fff transparent transparent transparent;
}

#star-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: var(--primary-cyan) transparent transparent transparent;
}

.tt-close {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.4em;
    font-family: monospace;
}

.tt-close:hover {
    color: var(--danger);
}

.tt-title {
    color: var(--primary-cyan);
    font-family: 'Cinzel', serif;
    margin-bottom: 5px;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
}

.tt-name {
    color: #ffffff;
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 1px;
    border-bottom: 1px dashed var(--border-dark);
    padding-bottom: 8px;
}

.tt-row {
    margin-bottom: 6px;
    color: #aaa;
}

.tt-row span {
    color: #fff;
    font-weight: bold;
    font-family: monospace;
}

.tt-core-notice {
    margin-top: 10px;
    font-size: 0.8em;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px dashed var(--border-dark);
    padding-top: 5px;
}

.btn-renew {
    width: 100%;
    padding: 8px;
    background: rgba(230, 171, 8, 0.1);
    border: 1px solid var(--accent-amber);
    color: var(--accent-amber);
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 10px;
    transition: 0.3s;
    font-weight: bold;
    letter-spacing: 1px;
}

.btn-renew:hover {
    background: var(--accent-amber);
    color: #000;
    box-shadow: 0 0 10px rgba(230, 171, 8, 0.5);
}

/* --- My Stars リスト --- */
#mystars-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.mystars-empty-text {
    color: var(--text-muted);
    font-size: 0.85em;
    text-align: center;
}

.mystar-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-dark);
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mystar-item:hover {
    border-color: var(--primary-cyan);
    background: rgba(0, 229, 255, 0.05);
}

.mystar-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    flex-shrink: 0;
}

.mystar-info {
    flex: 1;
    font-size: 0.85em;
    font-family: monospace;
}

.mystar-coords {
    color: #aaa;
}

.mystar-time {
    font-size: 0.75em;
    text-align: right;
    font-weight: bold;
}

/* ★ メインタイトルのデザイン（日英共通表示・フォント個別適用） */
#main-title-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
    line-height: 1.2;
}

.main-title-text {
    font-family: 'Cinzel', serif;
    font-size: 1.8em;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 3px;
    text-shadow: 0 0 15px var(--primary-glow), 0 0 30px var(--primary-cyan);
    margin: 0;
}

/* 英語部分には Cinzel フォントを適用 */
.title-part-en {
    font-family: 'Cinzel', serif;
    color: var(--primary-cyan);
    letter-spacing: 4px;
    margin-left: 4px;
}

/* 日本語部分には Noto Serif JP フォントを適用 */
.title-part-ja {
    font-family: 'Noto Serif JP', serif;
    color: var(--primary-cyan);
    letter-spacing: 4px;
    margin-left: 4px;
}

/* ★ 星カウンターのデザイン */
#star-counter-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.9em;
    background: rgba(11, 16, 13, 0.6);
    padding: 8px 12px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    backdrop-filter: blur(5px);
}

#star-count-total,
#star-count-dormant {
    color: var(--primary-cyan);
    font-weight: bold;
}

/* ★ スマホ画面用の調整 */
@media (max-width: 768px) {
    #control-panel {
        bottom: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        padding: 15px;
        box-sizing: border-box;
    }

    .panel-content-wrap {
        max-height: 75vh;
    }

    #zoom-controls {
        bottom: auto;
        top: 70px;
        left: 10px;
    }

    #mystars-list {
        max-height: 200px;
    }

    #main-title-container {
        top: 15px;
    }

    .main-title-text {
        font-size: 1.1em;
        letter-spacing: 1px;
    }

    .main-title-text .title-part-en,
    .main-title-text .title-part-ja {
        letter-spacing: 1px;
    }

    #star-counter-container {
        top: 60px;
        right: 10px;
        font-size: 0.75em;
    }
}

/* ==========================================
   Tuner Specific Styles (starmap-tuner.html専用)
   .tuner-page スコープで囲み、通常の星図画面と衝突させない
========================================== */

/* Tuner用のコンテナとパネル上書き */
.tuner-page #starmap-container {
    right: 410px;
    width: auto;
    height: 100vh;
}

.tuner-page #zoom-controls {
    bottom: 20px;
    left: 20px;
    position: absolute;
}

.tuner-page #control-panel {
    top: 0;
    right: 0;
    bottom: auto;
    width: 410px;
    height: 100vh;
    border-radius: 0;
    border-left: 1px solid var(--border-dark);
    border-top: none;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Tuner用パネル内部の構造 */
.tuner-panel-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-dark);
}

.tuner-panel-header h2 {
    margin: 0;
    color: var(--primary-cyan);
    font-family: 'Cinzel', serif;
    text-align: center;
}

.tuner-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-dark) transparent;
}

.tuner-panel-content::-webkit-scrollbar {
    width: 6px;
}

.tuner-panel-content::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

.tuner-group {
    border: 1px dashed #333;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.3);
}

.tuner-group-title {
    margin-top: 0;
    color: #e6ab08;
    font-size: 0.9em;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.tuner-slider-row {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.tuner-slider-row label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.tuner-slider-row label span {
    color: #fff;
    font-weight: bold;
}

/* 直書きされていたレイアウトのクラス化 */
.tuner-row-flex {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.tuner-row-mt {
    margin-top: 10px;
}

.tuner-label-margin-0 {
    margin: 0;
}

.tuner-label-pointer {
    cursor: pointer;
}

.tuner-flex-align {
    display: flex;
    align-items: center;
}

.btn-reset-single {
    cursor: pointer;
    color: #888 !important;
    font-weight: normal !important;
    font-size: 1.3em;
    line-height: 1;
    transition: 0.3s;
    margin-left: 5px;
    display: inline-block;
}

.btn-reset-single:hover {
    color: #ff4444 !important;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
    transform: rotate(-45deg);
}

.default-val {
    font-size: 1.0em;
    color: var(--text-muted) !important;
    margin-left: 5px;
}

.tuner-page input[type="range"] {
    width: 100%;
    accent-color: var(--primary-cyan);
    cursor: pointer;
}

.tuner-page input[type="color"] {
    width: 40px;
    height: 24px;
    padding: 0;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.tuner-page input[type="checkbox"] {
    accent-color: var(--primary-cyan);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.tuner-export-section {
    padding: 15px;
    border-top: 1px solid var(--border-dark);
    background: #000;
    flex-shrink: 0;
}

.tuner-page textarea {
    width: 100%;
    height: 180px;
    background: #0b100d;
    color: #00e5ff;
    border: 1px solid var(--border-dark);
    font-family: monospace;
    font-size: 0.8em;
    padding: 8px;
    box-sizing: border-box;
    border-radius: var(--radius);
    resize: vertical;
    outline: none;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.tuner-btn-copy {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    font-weight: bold;
    cursor: pointer;
    border-radius: var(--radius);
    margin-top: 8px;
    transition: 0.3s;
    font-family: 'Cinzel', serif;
}

.tuner-btn-copy:hover {
    background: var(--primary-cyan);
    color: #000;
}

.tuner-btn-test-explosion {
    width: 100%;
    padding: 8px;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
    font-weight: bold;
    cursor: pointer;
    border-radius: var(--radius);
    margin-top: 10px;
    transition: 0.3s;
    font-family: 'Cinzel', serif;
}

.tuner-btn-test-explosion:hover {
    background: #ff4444;
    color: #000;
}

.tuner-btn-reset-all {
    margin-bottom: 10px;
    border-color: #ff4444;
    color: #ff4444;
}

.tuner-btn-reset-all:hover {
    background: #ff4444;
    color: #000;
}

.tuner-note {
    font-size: 0.7em;
    color: #888;
    margin-top: 5px;
    line-height: 1.4;
}

.tuner-export-label {
    color: var(--primary-cyan);
    font-size: 0.8em;
    display: block;
    margin-bottom: 5px;
}

.tuner-top-nav {
    top: 10px;
    left: 10px;
}

/* 彗星テストボタン用スタイル */
.tuner-btn-test-comet {
    width: 100%;
    padding: 8px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    font-weight: bold;
    cursor: pointer;
    border-radius: var(--radius);
    margin-top: 10px;
    transition: 0.3s;
    font-family: 'Cinzel', serif;
}

.tuner-btn-test-comet:hover {
    background: var(--primary-cyan);
    color: #000;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* ==========================================
   Admin Specific Styles (starmap-admin.html専用)
   .admin-page スコープで囲み、通常の星図画面と衝突させない
========================================== */

.admin-page {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
    background-color: #050806;
}

/* 左側のキャンバス領域 */
.admin-page #canvas-area {
    flex: 1;
    position: relative;
    cursor: crosshair;
}

.admin-page #zoom-controls {
    bottom: 20px;
    left: 20px;
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.admin-page .btn-zoom {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    background: #121814;
    border: 1px solid #1f2b23;
    color: #888;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    transition: 0.3s;
}

.admin-page .btn-zoom:hover {
    color: #00e5ff;
    border-color: #00e5ff;
}

/* 範囲選択の赤い四角 */
.admin-page #selection-box {
    position: absolute;
    border: 1px dashed #ff4444;
    background: rgba(255, 68, 68, 0.2);
    pointer-events: none;
    display: none;
    z-index: 10;
}

/* 右側のパネル領域 */
/* 右側のパネル領域 */
.admin-page #admin-panel {
    width: 400px;
    background: #121814;
    border-left: 1px solid #1f2b23;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.8);
    z-index: 20;
    box-sizing: border-box;
    height: 100vh;
    overflow: hidden;
}

.admin-page h2 {
    color: #00e5ff;
    font-family: 'Cinzel', serif;
    margin-top: 0;
    border-bottom: 1px solid #1f2b23;
    padding-bottom: 10px;
    font-size: 1.5em;
    text-align: center;
}

/* Admin専用ボタンスタイル */
.admin-page .btn {
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    font-weight: bold;
    border: 1px solid transparent;
    transition: 0.3s;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.admin-page .btn-primary {
    border-color: #00e5ff;
    color: #00e5ff;
}

.admin-page .btn-primary:hover {
    background: #00e5ff;
    color: #000;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.admin-page .btn-danger {
    border-color: #ff4444;
    color: #ff4444;
}

.admin-page .btn-danger:hover {
    background: #ff4444;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.4);
}

.admin-page .btn-warning {
    border-color: #e6ab08;
    color: #e6ab08;
}

.admin-page .btn-warning:hover {
    background: #e6ab08;
    color: #000;
    box-shadow: 0 0 10px rgba(230, 171, 8, 0.4);
}

.admin-page .btn-outline {
    border-color: #444;
    color: #888;
    text-decoration: none;
    display: block;
    text-align: center;
}

.admin-page .btn-outline:hover {
    color: #fff;
    border-color: #888;
}

.admin-page input[type="text"],
.admin-page input[type="number"] {
    width: 100%;
    padding: 8px;
    background: #000;
    border: 1px solid #333;
    color: #00e5ff;
    font-family: monospace;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.admin-page input:focus {
    outline: none;
    border-color: #00e5ff;
}

/* タブメニュー */
.admin-page .tabs {
    display: flex;
    border-bottom: 1px solid #1f2b23;
    margin-bottom: 15px;
}

.admin-page .tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    color: #888;
    font-weight: bold;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}

.admin-page .tab.active {
    color: #00e5ff;
    border-bottom-color: #00e5ff;
}

.admin-page .tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.admin-page .tab-content.active {
    display: flex;
}

/* タブ1: Map Control の中身 */
.admin-page .search-area {
    margin-bottom: 10px;
}

.admin-page .info-text {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 5px;
}

.admin-page #star-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #1f2b23;
    background: #0b100d;
    padding: 5px;
    margin-bottom: 15px;
    min-height: 0;
    /* ← この1行を追加します */
}

.admin-page .star-item {
    padding: 8px;
    border-bottom: 1px solid #1f2b23;
    font-size: 0.8em;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-page .star-item:hover {
    background: rgba(0, 229, 255, 0.1);
}

.admin-page .star-item.selected {
    background: rgba(0, 229, 255, 0.2);
    border-left: 3px solid #00e5ff;
}

/* タブ2: Settings & BAN の中身 */
.admin-page .setting-group {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #1f2b23;
    border-radius: 4px;
}

.admin-page .setting-group h3 {
    margin-top: 0;
    color: #e6ab08;
    font-size: 1em;
    border-bottom: 1px dashed #333;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.admin-page #blacklist-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #1f2b23;
    background: #0b100d;
    padding: 5px;
    margin-bottom: 10px;
    font-size: 0.8em;
}

.admin-page .bl-item {
    padding: 8px;
    border-bottom: 1px solid #1f2b23;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* オーナー権限がない場合の警告オーバーレイ */
.admin-page #authOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 10, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    color: #ff4444;
    font-size: 1.5em;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    flex-direction: column;
}

.admin-page .auth-box {
    border: 2px dashed #ff4444;
    padding: 40px;
    background: rgba(255, 0, 0, 0.1);
    text-align: center;
}

/* ユーティリティクラス（直書きスタイルの置き換え） */
.admin-page .mt-0 {
    margin-top: 0;
}

.admin-page .mb-15 {
    margin-bottom: 15px;
}

.admin-page .mb-10 {
    margin-bottom: 10px;
}

.admin-page .mb-0 {
    margin-bottom: 0;
}

.admin-page .mt-10 {
    margin-top: 10px;
}

.admin-page .mt-30 {
    margin-top: 30px;
}

.admin-page .ml-5 {
    margin-left: 5px;
}

.admin-page .mr-5 {
    margin-right: 5px;
}

.admin-page .w-250 {
    width: 250px;
}

.admin-page .p-15 {
    padding: 15px;
}

.admin-page .flex-center-gap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-page .flex-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-page input.w-100 {
    width: 100px;
}

.admin-page .text-right {
    text-align: right;
}

.admin-page .mt-15 {
    margin-top: 15px;
}

.admin-page .pt-15 {
    padding-top: 15px;
}

.admin-page .d-block {
    display: block;
}

.admin-page .text-center {
    text-align: center;
}

.admin-page .text-gray {
    color: #888;
}

.admin-page .text-amber {
    color: #e6ab08;
}

.admin-page .text-cyan {
    color: #00e5ff;
}

.admin-page .text-white {
    color: #fff;
}

.admin-page .font-08 {
    font-size: 0.8em;
}

.admin-page .font-09 {
    font-size: 0.9em;
}

.admin-page .font-12 {
    font-size: 1.2em;
}

.admin-page .font-20 {
    font-size: 2em;
}

.admin-page .font-mono {
    font-family: monospace;
}

.admin-page .font-bold {
    font-weight: bold;
}

.admin-page .border-top-dashed {
    border-top: 1px dashed #333;
    padding-top: 10px;
}

.admin-page .flex-1 {
    flex: 1;
}

.admin-page .w-auto {
    width: auto;
}

.admin-page .px-10-py-5 {
    padding: 5px 10px;
}

.admin-page .btn-truncate {
    color: #ff4444;
    border-color: #ff4444;
}

/* --- 追加：ログイン前に要素を隠すための専用クラス --- */
.admin-page .hide-before-login {
    display: none !important;
}

/* ==========================================
   Adminページ用のスクロールバー設定
   ※スクロールさせたい箱を直接指名してデザインを適用します
========================================== */
.admin-page #star-list::-webkit-scrollbar,
.admin-page #blacklist-list::-webkit-scrollbar {
    width: 6px;
}

.admin-page #star-list::-webkit-scrollbar-track,
.admin-page #blacklist-list::-webkit-scrollbar-track {
    background: #050806;
}

.admin-page #star-list::-webkit-scrollbar-thumb,
.admin-page #blacklist-list::-webkit-scrollbar-thumb {
    background: #1f2b23;
    border-radius: 3px;
}

.admin-page #star-list::-webkit-scrollbar-thumb:hover,
.admin-page #blacklist-list::-webkit-scrollbar-thumb:hover {
    background: #333;
}

/* ==========================================
   Asset Generator Specific Styles (starmap-generator.html専用)
========================================== */

.generator-page {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
    background-color: #050806;
}

#generator-preview-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    scrollbar-width: thin;
    scrollbar-color: var(--border-dark) transparent;
}

#generator-preview-area::-webkit-scrollbar {
    width: 6px;
}

#generator-preview-area::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

.generator-header {
    text-align: center;
    margin-bottom: 25px;
}

.generator-canvas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    margin-bottom: 25px;
}

.generator-card {
    background: rgba(18, 24, 20, 0.85);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.generator-card-title {
    font-family: 'Cinzel', serif;
    color: var(--primary-cyan);
    font-size: 0.95em;
    font-weight: bold;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

/* 透過PNGの白がよく見えるようにする市松模様（チェッカーボード）の背景 */
.canvas-checkerboard-wrapper {
    width: 100%;
    height: 160px;
    background-color: #111;
    background-image:
        linear-gradient(45deg, #1e1e1e 25%, transparent 25%),
        linear-gradient(-45deg, #1e1e1e 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1e1e1e 75%),
        linear-gradient(-45deg, transparent 75%, #1e1e1e 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.canvas-checkerboard-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.btn-generator-download {
    width: 100%;
    font-size: 0.85em;
    padding: 8px 12px;
}

/* 重ね合わせ・着色テスト枠 */
.composite-test-box {
    width: 100%;
    max-width: 1100px;
    background: rgba(18, 24, 20, 0.85);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.composite-test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.composite-test-title {
    font-family: 'Cinzel', serif;
    color: var(--accent-amber);
    font-weight: bold;
    font-size: 1.1em;
}

.composite-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.composite-label {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.9em;
}

.composite-canvas-wrapper {
    width: 100%;
    background: #020403;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.composite-canvas-wrapper canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* 右側パネル */
#generator-control-panel {
    width: 380px;
    height: 100vh;
    background: rgba(11, 16, 13, 0.95);
    border-left: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* ==========================================
   Image Creator Specific Styles (starmap-image-creator.html専用)
========================================== */

.creator-header-container {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
    pointer-events: none;
}

.creator-header-container .main-title-text {
    margin: 0;
    pointer-events: auto;
}

/* 英語サブタイトル：文字サイズを親の0.75倍に抑えて上品に収めます */
.main-title-text .title-sub-en {
    font-family: 'Cinzel', serif;
    color: var(--primary-cyan);
    letter-spacing: 2px;
    margin-left: 6px;
    font-size: 0.75em;
}

.creator-inline-panel {
    pointer-events: auto;
    padding: 8px 18px;
    background: rgba(11, 16, 13, 0.85);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    text-align: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    margin-bottom: 0;
}

.creator-actions-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.creator-btn-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.creator-count-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-dark);
    padding: 3px 8px;
    border-radius: var(--radius);
}

.creator-count-label {
    font-size: 0.8rem;
    color: var(--primary-cyan);
    font-family: 'Cinzel', 'Noto Serif JP', serif;
    font-weight: bold;
    white-space: nowrap;
}

.creator-count-select {
    width: auto !important;
    padding: 4px 8px !important;
    font-size: 0.85em !important;
    background: #000 !important;
    border: 1px solid var(--border-dark) !important;
    color: #fff !important;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: monospace;
}

.creator-count-select:focus {
    border-color: var(--primary-cyan) !important;
    box-shadow: 0 0 8px var(--primary-glow);
}

.btn-creator-select {
    min-width: 190px;
    padding: 7px 16px;
    font-size: 0.85em;
    cursor: pointer;
    letter-spacing: 1.5px;
}

.creator-notice-text {
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
    font-family: 'Noto Serif JP', serif;
}

/* 画面幅が狭い端末での回り込み設定 */
@media (max-width: 880px) {
    .creator-header-container {
        top: 60px;
        flex-direction: column;
        gap: 8px;
    }

    .creator-btn-row {
        flex-direction: column;
        gap: 6px;
    }

    .creator-inline-panel {
        padding: 6px 14px;
    }

    /* スマホ画面では英語サブタイトルの文字と隙間をさらに小さく調整します */
    .main-title-text .title-sub-en {
        font-size: 0.7em;
        letter-spacing: 1px;
    }
}