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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    color: #333;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
}

header {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #34495e;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
}

.header-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.header-intro-image img {
    max-width: 220px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.header-intro-text {
    max-width: 600px;
    text-align: left;
    color: #555;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .header-intro {
        flex-direction: column;
    }
    
    .header-intro-text {
        text-align: center;
    }
}

.players-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.player-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 0; /* グリッドアイテムのオーバーフローを防ぐ */
}

.player-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.player-header h2 {
    font-size: 1.5rem;
    color: #34495e;
}

.remove-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.remove-btn:hover {
    background: #ff3838;
}

.url-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.url-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: #34495e;
}

.load-btn {
    background: #34495e;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.load-btn:hover {
    background: #2c3e50;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin-bottom: 20px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    min-height: 200px; /* 最小高さを確保 */
}

.video-container > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.video-container iframe {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.control-btn {
    background: #34495e;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn:hover {
    background: #2c3e50;
}

.control-btn.loop-active {
    background: #2ed573;
}

.control-btn.loop-active:hover {
    background: #26c95f;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.speed-control label {
    font-weight: 600;
    color: #555;
}

.speed-control select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.speed-control select:focus {
    outline: none;
    border-color: #34495e;
}

.keyboard-shortcuts {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.keyboard-shortcuts h3 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.shortcuts-grid {
    display: grid;
    gap: 10px;
}

.shortcut-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.95rem;
}

kbd {
    background: #34495e;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Espacio para publicidad */
.ad-space {
    margin: 40px 0;
    width: 100%;
}

.ad-placeholder {
    background: #ecf0f1;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: #7f8c8d;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder p {
    margin: 0;
    font-size: 1.1rem;
}

/* Descripción del sitio */
.site-description {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.site-description h3 {
    color: #34495e;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.site-description h4 {
    color: #34495e;
    font-size: 1.2rem;
    margin-top: 20px;
    margin-bottom: 10px;
}

.site-description p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.site-description ul {
    color: #555;
    line-height: 1.8;
    padding-left: 25px;
}

.site-description li {
    margin-bottom: 8px;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 30px 20px;
    margin-top: auto;
    border-radius: 12px 12px 0 0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ecf0f1;
    text-decoration: underline;
}

.footer-lang-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-lang-links span {
    color: #bdc3c7;
    font-size: 0.9rem;
    margin-right: 5px;
}

.footer-lang-links a {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

.footer-lang-links a:hover {
    color: #ecf0f1;
    background-color: rgba(255, 255, 255, 0.1);
}

.footer-copyright {
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* レスポンシブデザイン */
@media (max-width: 1200px) {
    .players-container {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    }
}

@media (max-width: 768px) {
    .players-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .player-section {
        padding: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .url-input-container {
        flex-direction: column;
    }

    .load-btn {
        width: 100%;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-btn {
        width: 100%;
        justify-content: center;
    }
}
