@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Share+Tech+Mono:wght@400&display=swap');

/* リセット・基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ベース背景・レイアウト */
body {
    font-family: 'Share Tech Mono', 'Courier Prime', monospace;
    background:
            linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(10, 25, 15, 0.95) 50%, rgba(0, 0, 0, 0.9) 100%),
            radial-gradient(ellipse at center, rgba(0, 255, 65, 0.1) 0%, transparent 70%),
            repeating-linear-gradient(
                    0deg,
                    transparent,
                    transparent 2px,
                    rgba(0, 255, 65, 0.03) 2px,
                    rgba(0, 255, 65, 0.03) 4px
            );
    color: #00ff41;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* スキャンライン効果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff41, transparent);
    animation: scanlines 3s linear infinite;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.3;
}

/* ペーパーテクスチャ */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
            radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* メインコンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background:
            linear-gradient(135deg,
            rgba(20, 20, 20, 0.95) 0%,
            rgba(5, 25, 10, 0.95) 50%,
            rgba(15, 15, 15, 0.95) 100%
            );
    border-radius: 15px;
    padding: 30px;
    box-shadow:
            0 0 30px rgba(0, 255, 65, 0.3),
            inset 0 0 30px rgba(0, 0, 0, 0.5),
            0 20px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 255, 65, 0.3);
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    pointer-events: none;
}

/* タイトル */
h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #00ff41;
    font-size: 2.8em;
    font-family: 'Courier Prime', monospace;
    font-weight: 700;
    text-shadow:
            0 0 10px #00ff41,
            0 0 20px #00ff41,
            0 0 30px #00ff41,
            2px 2px 0px rgba(139, 69, 19, 0.5);
    letter-spacing: 3px;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff41, transparent);
    box-shadow: 0 0 10px #00ff41;
}

/* グリッドレイアウト */
.enigma-machine {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.text-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 35px;
}

/* コントロール */
.controls {
    text-align: center;
    margin: 30px 0;
}

/* レスポンシブデザイン */

/* 極小画面 */
@media (max-width: 360px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .enigma-machine {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .text-area {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    h1 {
        font-size: 1.8em;
        letter-spacing: 1px;
        margin-bottom: 20px;
    }
}

/* スマートフォン */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .container {
        padding: 20px;
    }

    .enigma-machine {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .text-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    h1 {
        font-size: 2.2em;
        letter-spacing: 2px;
        margin-bottom: 25px;
    }

    .controls {
        margin: 20px 0;
    }
}

/* タブレット */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 2.5em;
    }
}

/* デスクトップ（大画面） */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
        padding: 40px;
    }

    h1 {
        font-size: 3.2em;
        margin-bottom: 40px;
    }
}

/* 横画面対応 */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2em;
        margin-bottom: 15px;
    }

    .enigma-machine {
        margin-bottom: 20px;
    }
}

/* プリント用 */
@media print {
    body::before,
    body::after {
        display: none;
    }

    * {
        box-shadow: none !important;
        text-shadow: none !important;
        animation: none !important;
    }

    .container {
        max-width: 100%;
        padding: 20px;
        box-shadow: none;
        border: 1px solid #333;
    }
}