:root {
    --primary-color: #fff;
    --accent-color: #ffd700;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Poppins', 'Zen Kaku Gothic New', sans-serif;
    color: var(--primary-color);
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* 背景: ゆっくり動くディープなグラデーション */
.background-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #0f2027, #203a43, #2c5364, #240b36);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 雪（単語）のスタイル */
#snow-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.word-flake {
    position: absolute;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
    cursor: pointer;
    pointer-events: auto; /* クリック可能 */
    white-space: nowrap;
    user-select: none;
    transition: color 0.3s, text-shadow 0.3s, transform 0.3s;
    will-change: transform, opacity;
}

.word-flake:hover {
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px var(--accent-color);
    transform: scale(1.2);
    z-index: 10;
    animation-play-state: paused; /* ホバー時に停止 */
}

/* 落下アニメーション */
@keyframes fall {
    0% { transform: translateY(-50px) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(110vh) translateX(var(--sway)); opacity: 0; }
}

/* モーダル (グラスモーフィズム) */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    position: relative;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#modal-overlay:not(.hidden) .modal-content {
    transform: translateY(0);
}

#close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: color 0.2s;
}

#close-btn:hover {
    color: #fff;
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
}

#modal-title {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: capitalize;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    margin-top: 5px;
}

.wiki-list {
    overflow-y: auto;
    padding-right: 10px;
    flex-grow: 1;
}

/* スクロールバーのカスタマイズ */
.wiki-list::-webkit-scrollbar {
    width: 6px;
}
.wiki-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.wiki-link {
    display: block;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s;
}

.wiki-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.loading, .error, .no-result {
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.7);
}
