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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.section {
    padding: 40px;
    position: relative;
}

.section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 2px;
}

.fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.fullscreen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* グラデーションチャート */
.gradient-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 60vh;
    max-height: 600px;
}

.gradient-strip {
    flex: 1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 30px;
}


.red-to-white {
    background: linear-gradient(to right, red, white);
}

.red-to-black {
    background: linear-gradient(to right, red, black);
}

.green-to-white {
    background: linear-gradient(to right, green, white);
}

.green-to-black {
    background: linear-gradient(to right, green, black);
}

.blue-to-white {
    background: linear-gradient(to right, blue, white);
}

.blue-to-black {
    background: linear-gradient(to right, blue, black);
}

.cyan-to-white {
    background: linear-gradient(to right, cyan, white);
}

.cyan-to-black {
    background: linear-gradient(to right, cyan, black);
}

.magenta-to-white {
    background: linear-gradient(to right, magenta, white);
}

.magenta-to-black {
    background: linear-gradient(to right, magenta, black);
}

.yellow-to-white {
    background: linear-gradient(to right, yellow, white);
}

.yellow-to-black {
    background: linear-gradient(to right, yellow, black);
}

/* 24色カラーチャート */
.color-chart {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    margin-top: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.color-square {
    aspect-ratio: 1;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}


.color-info {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: #333;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}


/* 全画面モード */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: gray;
    z-index: 1000;
    display: none;
    padding: 0px;
    overflow-y: auto;
    overflow: hidden;

    /* ノッチを含む全画面表示 */
    padding-top: env(safe-area-inset-top, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
}

.fullscreen-content {
    background: none;
    border-radius: 0;
    padding: 0px;
    max-width: 100%;
    margin: 0 auto;
    height: 100%;
    width: 100%;
}

.fullscreen-color-chart {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    width: 100vw;
    height: 100vh;
    /* ノッチエリアも含めて完全に全画面表示 */
    position: absolute;
    top: calc(-1 * env(safe-area-inset-top, 0));
    left: calc(-1 * env(safe-area-inset-left, 0));
    right: calc(-1 * env(safe-area-inset-right, 0));
    bottom: calc(-1 * env(safe-area-inset-bottom, 0));
    width: calc(100vw + env(safe-area-inset-left, 0) + env(safe-area-inset-right, 0));
    height: calc(100vh + env(safe-area-inset-top, 0) + env(safe-area-inset-bottom, 0));
}

.fullscreen-color-square {
    border-radius: 0;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
}

.separator {
    height: 2px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    margin: 40px 0;
    border-radius: 1px;
}

@media (max-width: 768px) {
    .gradient-chart {
        height: 50vh;
        gap: 6px;
    }

    .gradient-label {
        font-size: 10px;
        padding: 3px 8px;
    }

    .color-chart {
        grid-template-columns: repeat(3, 1fr);
    }

    .section {
        padding: 20px;
    }
}