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

body, html {
    height: 100vh;
    width: 100vw;
    font-family: 'Arial', sans-serif;
}

/* ペンライトエリア */
.penlight-area {
    height: 130vh;
    width: 100vw;
    transition: background-color 0.3s ease;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
}

/* 縦書きテキスト */
.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    color: #000;
    font-weight: bold;
    font-size: 48px;
    font-family: 'Kosugi Maru', sans-serif;
    letter-spacing: 0.1em;
    line-height: 1.2;
    display: none;
    text-align: center;
    max-height: 110vh;
    overflow: hidden;
    transition: all 0.3s ease;
     white-space: pre;
}

.vertical-text.rotated {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    max-width: 110vh;
    max-height: none;
    white-space: pre;
}

/* 上に戻るボタン */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    color: #333;
}

.back-to-top:hover {
    background: rgba(255, 255, 255, 1);
}

/* 設定エリア */
.settings-area {
    min-height: 100vh;
    background: linear-gradient(135deg, #2c5364 0%, #203a43 50%, #0f2027 100%);
    padding: 40px 20px 0px 20px;
    margin-bottom: -1px;
}

.settings-container {
    max-width: 600px;
    margin: 0 auto;
}

.settings-title {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: #ffffff;
}

.setting-group {
    background: #2d2d2d;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #3d3d3d;
}

.setting-group h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #ffffff;
}

.mode-buttons {
    display: grid;
    gap: 12px;
}

.mode-btn {
    padding: 15px 20px;
    border: 2px solid #555;
    border-radius: 8px;
    background: #3d3d3d;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
}

.mode-btn:hover {
    border-color: #007bff;
    background: #4d4d4d;
}

.mode-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

.color-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.color-btn {
    width: 50px;
    height: 50px;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: #333;
    transform: scale(1.2);
}

/* テキスト入力ONボタン */
.text-input-btn {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #28a745;
    border-radius: 8px;
    background: #2d2d2d;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #28a745;
    font-weight: bold;
}

.text-input-btn:hover {
    background: #28a745;
    color: white;
}

.ad-space {
    background: #e9ecef;
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: #6c757d;
    font-size: 16px;
    margin-top: 30px;
}

/* フッター */
.footer {
    background: linear-gradient(135deg, #2c5364 0%, #203a43 50%, #0f2027 100%);
    padding: 15px 20px;
    text-align: center;
    margin: 0;
    margin-top: -1px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-copyright {
    color: white;
    font-size: 12px;
    opacity: 0.8;
    margin-top: 10px;
}

.x-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
    margin-right: 4px;
}