body {
    margin: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000020;
    overflow: hidden; /* スクロールバーを無効にする */
}

.solar-system {
    position: relative;
    width: 100vmin;
    height: 100vmin;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    overflow: hidden; /* スクロールバーを無効にする */
}

#sun {
    position: absolute;
    width: 70px;
    height: 70px;
    background-color: #ffcc00;
    border-radius: 50%;
    box-shadow: 0 0 50px #ffcc00;
    pointer-events: auto;
}

#mercury-orbit, #venus-orbit, #earth-orbit, #mars-orbit, #jupiter-orbit, #saturn-orbit, #uranus-orbit, #neptune-orbit {
    position: absolute;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.15);
    border-width: 1px;
    border-radius: 50%;
    transform-style: preserve-3d;
}

#mercury, #venus, #earth, #mars, #jupiter, #saturn, #uranus, #neptune {
    position: absolute;
    border-radius: 50%;
    pointer-events: auto;
}

/* 軌道サイズ */
#mercury-orbit { width: 120px; height: 120px; }
#venus-orbit { width: 180px; height: 180px; }
#earth-orbit { width: 260px; height: 260px; }
#mars-orbit { width: 360px; height: 360px; }
#jupiter-orbit { width: 500px; height: 500px; }
#saturn-orbit { width: 640px; height: 640px; }
#uranus-orbit { width: 760px; height: 760px; }
#neptune-orbit { width: 840px; height: 840px; }

/* 惑星サイズと位置 */
#mercury { width: 8px; height: 8px; background-color: #bcae9e; top: -4px; left: 56px; box-shadow: inset -2px 2px 2px rgba(0,0,0,0.5), inset 2px -2px 2px rgba(255,255,255,0.5); }
#venus { width: 12px; height: 12px; background-color: #d8a273; top: -6px; left: 84px; box-shadow: inset -3px 3px 3px rgba(0,0,0,0.5), inset 3px -3px 3px rgba(255,255,255,0.5); }
#earth { width: 12px; height: 12px; background-color: #0066ff; top: -6px; left: 124px; box-shadow: inset -3px 3px 3px rgba(0,0,0,0.5), inset 3px -3px 3px rgba(255,255,255,0.5); }
#mars { width: 10px; height: 10px; background-color: #ff4500; top: -5px; left: 175px; box-shadow: inset -3px 3px 3px rgba(0,0,0,0.5), inset 3px -3px 3px rgba(255,255,255,0.5); }
#jupiter { width: 30px; height: 30px; background-color: #c8a078; top: -15px; left: 235px; box-shadow: inset -8px 8px 8px rgba(0,0,0,0.5), inset 8px -8px 8px rgba(255,255,255,0.5); }
#saturn { width: 25px; height: 25px; background-color: #e0d8b0; top: -12.5px; left: 307.5px; box-shadow: inset -6px 6px 6px rgba(0,0,0,0.5), inset 6px -6px 6px rgba(255,255,255,0.5); }
#uranus { width: 20px; height: 20px; background-color: #a0d8ef; top: -10px; left: 370px; box-shadow: inset -5px 5px 5px rgba(0,0,0,0.5), inset 5px -5px 5px rgba(255,255,255,0.5); }
#neptune { width: 20px; height: 20px; background-color: #5a78ff; top: -10px; left: 420px; box-shadow: inset -5px 5px 5px rgba(0,0,0,0.5), inset 5px -5px 5px rgba(255,255,255,0.5); }

/* 土星の環 */
#saturn .ring {
    position: absolute;
    width: 180%;
    height: 180%;
    border: 2px solid rgba(224, 216, 176, 0.7);
    border-radius: 50%;
    top: -45%;
    left: -45%;
    transform: rotateX(70deg);
}

/* コントロール */
.controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    color: white;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 300px;
    backdrop-filter: blur(10px);
}

.controls label {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.controls > label {
    margin-bottom: 5px;
}

/* チェックボックス付きラベルの余白 */
.controls label:has(input[type="checkbox"]) {
    margin-top: 8px;
    margin-bottom: 8px;
}

.controls input[type="range"] {
    width: 150px;
    margin-bottom: 5px;
}

.controls select {
    padding: 5px;
    margin-bottom: 5px;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

.controls select option {
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px;
}

.controls select:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.controls select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.controls button {
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.controls button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.controls input[type="checkbox"] {
    margin-right: 5px;
}

/* 時間表示 */
.time-display {
    color: #ffcc00;
    font-size: 14px;
    font-weight: bold;
    margin: 12px 0;
    text-align: center;
}

.time-display span {
    color: white;
}

/* 惑星情報表示パネル */
.planet-info {
    position: fixed;
    top: 20px;
    left: 20px; /* 画面左側に配置 */
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    max-width: 400px;
    z-index: 1001; /* 選択パネルより高い値に設定 */
    backdrop-filter: blur(10px);
}

.planet-info h3 {
    margin: 0 0 15px 0;
    color: #ffcc00;
    font-size: 24px;
    text-align: center;
}

.planet-info #info-content {
    line-height: 1.6;
}

.planet-info #info-content div {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
}

.planet-info #info-content strong {
    color: #ffcc00;
}

#close-info {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#close-info:hover {
    color: #ffcc00;
}

/* クリック可能な惑星 */
.clickable-planet {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.clickable-planet::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: transparent;
    border-radius: 50%;
    z-index: 10;
    pointer-events: auto;
}

.clickable-planet:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* 星の一覧パネル */
.planet-list {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
    min-width: 280px;
}

.planet-list h3 {
    margin: 0 0 15px 0;
    color: #ffcc00;
    font-size: 18px;
    text-align: center;
}

.planet-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 0 0 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 12px;
    font-weight: bold;
    color: #ffcc00;
    justify-content: space-between;
}

.planet-name-header {
    flex: 1;
    margin-right: 10px;
}

.toggle-header {
    width: 20px;
    text-align: center;
    margin: 0 4px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.toggle-header:hover {
    background-color: rgba(255, 204, 0, 0.2);
    color: #ffcc00;
}

.planet-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    justify-content: space-between;
}

.planet-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.planet-item.active {
    background-color: rgba(255, 204, 0, 0.2);
    border: 1px solid #ffcc00;
}

.planet-item .planet-icon {
    margin-right: 10px;
}

.planet-item span {
    flex: 1;
    margin-right: 10px;
}

.toggle-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
    width: 20px;
    justify-content: center;
}

.toggle-label:hover {
    color: rgba(255, 255, 255, 0.9);
}

.toggle-label input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
    accent-color: #ffcc00;
}

.planet-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.sun-icon { background-color: #ffcc00; box-shadow: 0 0 10px #ffcc00; }
.mercury-icon { background-color: #bcae9e; }
.venus-icon { background-color: #d8a273; }
.earth-icon { background-color: #0066ff; }
.mars-icon { background-color: #ff4500; }
.jupiter-icon { background-color: #c8a078; }
.saturn-icon { background-color: #e0d8b0; }
.uranus-icon { background-color: #a0d8ef; }
.neptune-icon { background-color: #5a78ff; }

/* 惑星の強調表示 */
.planet-highlighted {
    animation: pulse 1s infinite;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.5) !important;
}

@keyframes pulse {
    0% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }
    50% { box-shadow: 0 0 40px rgba(255, 255, 255, 1); }
    100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }
}

/* ハンバーガーメニューボタン */
.menu-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    display: flex; /* デフォルトで表示（デスクトップで非表示にする） */
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle:hover {
    background-color: rgba(255, 204, 0, 0.2);
    border-color: #ffcc00;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* モバイルメニュー */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 90%;
    max-width: 400px;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1001;
    overflow-y: auto;
    transition: right 0.3s ease;
    padding: 60px 20px 20px 20px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
    display: none; /* デフォルトは非表示（デスクトップ） */
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu .planet-list,
.mobile-menu .controls {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    margin-bottom: 20px;
}

.mobile-menu .controls {
    width: 100%;
    max-width: 100%;
}

/* モバイルメニュー内のコントロール要素の間隔を調整 */
.mobile-menu .controls > label {
    display: block;
    margin-top: 15px;
    margin-bottom: 8px;
}

/* 最初のラベルは上部マージン不要 */
.mobile-menu .controls > label:first-child {
    margin-top: 0;
}

/* チェックボックス付きのラベルはインライン表示で間隔を調整 */
.mobile-menu .controls > label:has(input[type="checkbox"]) {
    display: inline-block;
    margin-right: 15px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.mobile-menu .controls input[type="range"] {
    margin-bottom: 8px;
}

.mobile-menu .controls select {
    margin-bottom: 15px;
}

.mobile-menu .controls button {
    margin-top: 15px;
}

.mobile-menu .controls .time-display {
    margin-bottom: 10px;
}

.mobile-menu .controls br {
    display: none;
}

/* デスクトップ表示（モバイルメニューを非表示） */
@media (min-width: 1025px) {
    .menu-toggle {
        display: none !important;
    }
    
    .mobile-menu {
        display: none !important;
    }
    
    /* モバイルメニュー内のパネルを非表示 */
    .mobile-menu .planet-list,
    .mobile-menu .controls {
        display: none !important;
    }
    
    /* デスクトップでは通常のパネル位置を維持 */
    #desktop-planet-list,
    #desktop-controls {
        display: block !important;
        position: fixed !important;
    }
}

/* タブレット表示 */
@media (max-width: 1024px) and (min-width: 769px) {
    /* ハンバーガーボタンを表示 */
    .menu-toggle {
        display: flex !important;
    }
    
    /* モバイルメニューを表示 */
    .mobile-menu {
        display: block !important;
    }
    
    /* モバイルメニューがアクティブな場合のみパネルを表示 */
    .mobile-menu.active .planet-list,
    .mobile-menu.active .controls {
        display: block !important;
    }
    
    /* タブレットではデスクトップ用パネルを非表示 */
    #desktop-planet-list,
    #desktop-controls {
        display: none !important;
    }
}

/* スマートフォン表示 */
@media (max-width: 768px) {
    /* スマホではデスクトップ用パネルを非表示 */
    #desktop-planet-list,
    #desktop-controls {
        display: none !important;
    }
    
    /* ハンバーガーボタンを表示 */
    .menu-toggle {
        display: flex !important;
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }
    
    /* モバイルメニューを表示 */
    .mobile-menu {
        display: block !important;
        width: 85%;
    }
    
    /* モバイルメニューがアクティブな場合のみパネルを表示 */
    .mobile-menu.active .planet-list,
    .mobile-menu.active .controls {
        display: block !important;
    }
    
    header {
        max-width: calc(100% - 80px) !important;
        font-size: 12px !important;
    }
    
    header h1 {
        font-size: 16px !important;
    }
    
    header p {
        font-size: 12px !important;
    }
    
    .mobile-menu .planet-list h3 {
        font-size: 16px;
    }
    
    .mobile-menu .controls label {
        font-size: 14px;
    }
    
    .mobile-menu .controls > label {
        margin-top: 18px;
        margin-bottom: 10px;
    }
    
    .mobile-menu .controls > label:first-child {
        margin-top: 0;
    }
    
    .mobile-menu .controls > label:has(input[type="checkbox"]) {
        margin-right: 15px;
        margin-top: 12px;
        margin-bottom: 12px;
    }
    
    .mobile-menu .controls input[type="range"] {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .mobile-menu .controls select {
        width: 100%;
        font-size: 12px;
        margin-bottom: 18px;
    }
    
    .mobile-menu .controls button {
        width: 100%;
        margin-top: 18px;
    }
    
    .mobile-menu .controls .time-display {
        margin-bottom: 12px;
    }
    
    .planet-info {
        position: fixed !important;
        top: auto !important;
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        max-width: 100% !important;
        font-size: 14px;
    }
    
    .planet-info h3 {
        font-size: 18px;
    }
    
    .time-display {
        font-size: 12px;
    }
    
    .planet-item {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .planet-icon {
        width: 16px;
        height: 16px;
    }
    
    .toggle-label {
        width: 18px;
    }
    
    .toggle-label input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }
}

/* 小さなスマートフォン表示 */
@media (max-width: 480px) {
    /* デスクトップ用パネルを非表示 */
    #desktop-planet-list,
    #desktop-controls {
        display: none !important;
    }
    
    header {
        padding: 10px !important;
    }
    
    .mobile-menu {
        padding: 50px 15px 15px 15px;
    }
    
    .mobile-menu .planet-list,
    .mobile-menu .controls {
        padding: 10px;
    }
    
    .mobile-menu .planet-list h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .planet-header {
        font-size: 10px;
        padding: 6px 8px;
    }
    
    .planet-item {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .mobile-menu .controls label {
        font-size: 12px;
    }
    
    .mobile-menu .controls > label {
        margin-top: 15px;
        margin-bottom: 8px;
    }
    
    .mobile-menu .controls > label:first-child {
        margin-top: 0;
    }
    
    .mobile-menu .controls > label:has(input[type="checkbox"]) {
        margin-right: 15px;
        margin-top: 12px;
        margin-bottom: 12px;
    }
    
    .mobile-menu .controls input[type="range"] {
        margin-bottom: 8px;
    }
    
    .mobile-menu .controls select {
        margin-bottom: 15px;
    }
    
    .mobile-menu .controls button {
        margin-top: 15px;
    }
    
    .mobile-menu .controls .time-display {
        margin-bottom: 10px;
    }
    
    .time-display {
        font-size: 11px;
    }
}
