/* リアルタイム2D太陽系ウィジェット CSS */

/* --- 背景キャンバス --- */
.solar-system-widget-wrapper .stars-container {
    position: absolute;
    inset: 0;
}

.solar-system-widget-wrapper .stars-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: black;
}

/* --- ウィジェット本体 --- */
.solar-system-widget-wrapper {
    position: relative;
    display: grid;
    place-items: center;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    background: black;
    aspect-ratio: 1 / 1;
}

.solar-system-widget-container {
    position: relative;
    margin: 0 auto;
    width: 100%;
    background: transparent;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    /* 幅・高さの短い方に正方形の太陽系を収める。 */
    max-width: var(--solar-system-height, 100%);
    z-index: 1;
}

.solar-system-widget-container .solar-system {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
}

/* 太陽 */
.solar-system-widget-container .sun {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6%;
    height: 6%;
    border-radius: 50%;
    background: radial-gradient(circle, #ffd700, #ff8c00, #ff4500);
    box-shadow:
        0 0 30px #ffc700,
        0 0 45px #ff8c00,
        0 0 75px #ff4500;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.solar-system-widget-container .sun:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

/* 軌道 */
.solar-system-widget-container .orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation-name: revolve;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    transition: border-color 0.3s ease, border-width 0.3s ease;
    pointer-events: none;
}
@keyframes revolve {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 惑星 */
.solar-system-widget-container .planet {
    position: absolute;
    top: 50%;
    left: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform 0.3s ease;
    pointer-events: auto;
}
.solar-system-widget-container .planet:hover {
    transform: translate(-50%, -50%) scale(1.6);
}

/* 各惑星の軌道サイズ */
.orbit[data-planet="mercury"] { width: 11%; height: 11%; }
.orbit[data-planet="venus"]   { width: 17%; height: 17%; }
.orbit[data-planet="earth"]   { width: 24%; height: 24%; }
.orbit[data-planet="mars"]    { width: 33%; height: 33%; }
.orbit[data-planet="jupiter"] { width: 45%; height: 45%; }
.orbit[data-planet="saturn"]  { width: 57%; height: 57%; }
.orbit[data-planet="uranus"]  { width: 69%; height: 69%; }
.orbit[data-planet="neptune"] { width: 81%; height: 81%; }

/* 各惑星のサイズと色（2.2.0の表示バランス） */
.planet[data-planet="mercury"] { width: 20%; height: 20%; background: #a9a9a9; }
.planet[data-planet="venus"]   { width: 18%; height: 18%; background: #e6d3a2; }
.planet[data-planet="earth"]   { width: 18%; height: 18%; background: #4b89e0; }
.planet[data-planet="mars"]    { width: 14%; height: 14%; background: #c1440e; }
.planet[data-planet="jupiter"] { width: 16%; height: 16%; background: #d8ca9d; }
.planet[data-planet="saturn"]  { width: 15%; height: 15%; background: #f0e6c5; }
.planet[data-planet="uranus"]  { width: 10%; height: 10%; background: #a9d5f0; }
.planet[data-planet="neptune"] { width: 10%; height: 10%; background: #3f54ba; }

/* 土星の輪 */
.planet[data-planet="saturn"]::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 200%; height: 200%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotateX(70deg);
}

/* ツールチップ */
.solar-system-tooltip {
    position: fixed;
    display: none;
    padding: 8px 12px;
    background: rgba(0,0,0,0.85);
    color: white;
    border-radius: 5px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
}
