
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    background: linear-gradient(to bottom, #f5f6fa, #e9ecef);
    height: 100vh;
    overflow: hidden;
    color: #333;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.app-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.version {
    margin-left: 20px;
    font-size: 15px;
}

.app-header nav {
    display: flex;
    gap: 20px;
}

.app-header nav a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s ease;
}

.app-header nav a:hover {
    color: #3498db;
}

.container {
    display: flex;
    height: calc(100vh - 80px);
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    margin: 70px 10px 10px 10px;
}

#chords {
    width: 40%;
    min-width: 300px;
    box-sizing: border-box;
    background: linear-gradient(145deg, #ffffff, #f9fafc);
    border-right: 2px solid #dfe4ea;
    overflow: hidden;
    border-radius: 12px 0 0 12px;
    position: relative;
}

#reset-button {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 8px 16px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    z-index: 20;
}

#reset-button:hover {
    background: #2980b9;
    transform: scale(1.05);
}

#reset-button:active {
    background: #1f6ea3;
    transform: scale(0.98);
}

#trends-body {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#d3-svg {
    width: 100%;
    height: 100%;
}

.list {
    width: 60%;
    box-sizing: border-box;
    height: 100%;
    background: #ffffff;
    border-radius: 0 12px 12px 0;
}

.header-fixed {
    background: linear-gradient(135deg, #ffffff, #eef2f6);
    padding: 15px 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #dfe4ea;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-fixed h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.description {
    font-size: 12px;
}

.list-container {
    overflow-y: auto;
    --header-height: 60px;
    height: calc(100% - var(--header-height) - 20px);
    padding: 10px 0;
    background: #fafbfc;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    margin: 0 10px;
    border-radius: 8px;
}

li:hover {
    background: #f1f4f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

li.playing {
    background: #e6f0fa;
    border: 2px solid #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transform: scale(1.02);
    z-index: 10;
    position: relative;
}

li.playing .title {
    color: #3498db;
}

li.playing .play-icon {
    opacity: 1;
    background: rgba(52, 152, 219, 0.6);
}

.thumb-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-right: 15px;
    position: relative;
    transition: transform 0.1s ease;
    border: 1px solid #dfe4ea;
}

.thumb-wrapper:hover {
    transform: scale(1.05);
}

img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 10px;
}

.play-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #fff;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 10px;
}

li:hover .play-icon {
    opacity: 1;
}

.info {
    width: 180px;
    display: flex;
    flex-direction: column;
    margin-right: 15px;
    flex-shrink: 0;
}

.title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist {
    font-size: 13px;
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lyrics {
    font-size: 14px;
    color: #95a5a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 15px;
    flex: 1;
    min-width: 80px;
}

.chord-progression {
    font-size: 14px;
    color: #e67e22;
    font-weight: 500;
    margin: 0 15px;
    white-space: nowrap;
    width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.original-key {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 15px;
    min-width: 40px;
}

.original-key-label {
    font-size: 12px;
    color: #8e44ad;
    font-weight: 500;
    line-height: 1.2;
}

.original-key-value {
    font-size: 16px;
    color: #8e44ad;
    font-weight: 600;
    line-height: 1.2;
}

@media (max-width: 900px) {
    .version {
        display: none;
    }

    .container {
        flex-direction: column;
        margin: 70px 5px 5px 5px;
    }

    #chords {
        width: 100%;
        height: 55%;
        border-right: none;
        border-bottom: 2px solid #dfe4ea;
        border-radius: 12px 12px 0 0;
    }

    .list {
        width: 100%;
        height: 45%;
        border-radius: 0 0 12px 12px;
    }

    .chord-progression {
        display: none;
    }

    .original-key {
        display: none;
    }
}

#youtube-player-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 180px;
    display: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    overflow: visible;
    padding: 5px;
    z-index: 100;
}

#youtube-player {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

#close-player {
    padding: 0;
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    background: #e74c3c;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 18px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 20;
}

#close-player:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* D3.js 用スタイル */
div.text {
    font: 14px sans-serif;
    text-align: center;
    font-weight: bold;
    width: 100%;
    height: 16px;
    padding-top: 2px;
    white-space: nowrap;
}

div.text-small {
    font: 11px sans-serif;
    text-align: center;
    font-weight: bold;
    width: 100%;
    height: 12px;
    padding-top: 2px;
    white-space: nowrap;
}

foreignObject,
foreignObject * {
    cursor: pointer;
}

line.link {
    stroke: #bbb;
    stroke-width: 1px;
}

line.active {
    stroke: #000;
    stroke-width: 2px;
}

circle.node {
    cursor: pointer;
}

circle.active {
    stroke-width: 2px;
    stroke: #000;
}

svg:not(:root) {
    overflow: hidden;
}