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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid #e94560;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: #e94560;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

.subtitle {
    color: #a0a0a0;
    margin-top: 5px;
}

/* スクリーン切り替え */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* 初期画面 */
.patient-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.patient-info h2 {
    margin-bottom: 30px;
    color: #e94560;
}

.patient-info input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #333;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
}

.patient-info input::placeholder {
    color: #888;
}

.patient-info input:focus {
    outline: none;
    border-color: #e94560;
}

/* ボタンスタイル */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.2rem;
}

.btn-danger {
    background: linear-gradient(135deg, #e94560 0%, #c92a4a 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.6);
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #1a1a2e;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid #555;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #1a1a2e;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

.btn-shock {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: #fff;
    padding: 20px;
    flex: 1;
}

.btn-no-shock {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    flex: 1;
}

/* タイマーエリア */
.timers-area {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .timers-area {
        grid-template-columns: 1fr;
    }
}

.timer-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
}

.cpr-timer {
    border: 3px solid #e94560;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.3);
}

.adrenaline-timer {
    border: 3px solid #4facfe;
    box-shadow: 0 0 30px rgba(79, 172, 254, 0.3);
}

.total-timer {
    border: 3px solid #38ef7d;
    box-shadow: 0 0 30px rgba(56, 239, 125, 0.3);
}

.timer-label {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timer-display {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.cpr-timer .timer-display {
    color: #e94560;
}

.adrenaline-timer .timer-display {
    color: #4facfe;
}

.total-timer .timer-display {
    color: #38ef7d;
}

.adrenaline-info {
    font-size: 0.8rem;
    color: #888;
    margin-top: 10px;
}

.timer-controls {
    margin-top: 15px;
}

/* CPRタイマー点滅アニメーション */
.cpr-timer.warning {
    animation: pulse-warning 0.5s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 30px rgba(233, 69, 96, 0.3);
    }
    50% {
        box-shadow: 0 0 50px rgba(233, 69, 96, 0.8);
        background: rgba(233, 69, 96, 0.2);
    }
}

/* アルゴリズムフロー */
.algorithm-flow {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.algorithm-flow h2 {
    color: #e94560;
    margin-bottom: 20px;
    text-align: center;
}

.current-step {
    display: flex;
    align-items: center;
    background: rgba(233, 69, 96, 0.1);
    border-left: 4px solid #e94560;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.step-number {
    width: 50px;
    height: 50px;
    background: #e94560;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 20px;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.step-content p {
    color: #a0a0a0;
}

.rhythm-buttons {
    display: flex;
    gap: 20px;
}

@media (max-width: 768px) {
    .rhythm-buttons {
        flex-direction: column;
    }
}

.rhythm-type {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
}

.rhythm-desc {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 5px;
}

/* アクションパネル */
.action-panel {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.2) 0%, rgba(79, 172, 254, 0.2) 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid #e94560;
}

.action-panel.hidden {
    display: none;
}

.action-panel h3 {
    color: #e94560;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3rem;
}

.action-description {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.action-buttons .btn {
    min-width: 150px;
}

/* 処置記録入力 */
.record-input {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.record-input h3 {
    color: #4facfe;
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.input-row select,
.input-row input {
    flex: 1;
    min-width: 150px;
    padding: 12px;
    border: 2px solid #333;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
}

.input-row select {
    cursor: pointer;
}

.input-row select option {
    background: #1a1a2e;
    color: #fff;
}

.input-row input:focus,
.input-row select:focus {
    outline: none;
    border-color: #4facfe;
}

/* 記録一覧 */
.record-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.record-list h3 {
    color: #38ef7d;
    margin-bottom: 20px;
}

#records-container {
    max-height: 300px;
    overflow-y: auto;
}

#records-table {
    width: 100%;
    border-collapse: collapse;
}

#records-table th,
#records-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #333;
}

#records-table th {
    background: rgba(56, 239, 125, 0.1);
    color: #38ef7d;
    font-weight: 500;
}

#records-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 終了セクション */
.end-section {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .end-section {
        flex-direction: column;
    }
}

/* 結果画面 */
#result-screen {
    text-align: center;
}

#result-screen h2 {
    color: #e94560;
    margin-bottom: 30px;
}

.result-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: left;
}

.result-summary p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.result-summary strong {
    color: #4facfe;
}

.result-records {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    max-height: 400px;
    overflow-y: auto;
}

.result-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #e94560;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff6b8a;
}

/* アラート表示 */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.alert-box {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #e94560;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    animation: alert-pulse 0.5s ease-in-out infinite;
}

@keyframes alert-pulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
    }
    50% {
        box-shadow: 0 0 60px rgba(233, 69, 96, 1);
    }
}

.alert-box h2 {
    color: #e94560;
    font-size: 2rem;
    margin-bottom: 20px;
}

.alert-box p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* VF/VTルート用のスタイル */
.shock-indicator {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-block;
    margin: 10px 0;
    animation: shock-pulse 1s ease-in-out infinite;
}

@keyframes shock-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 65, 108, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(255, 65, 108, 0.8);
    }
}

/* PEA/Asystoleルート用のスタイル */
.no-shock-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    display: inline-block;
    margin: 10px 0;
}

/* 薬剤投与アラート */
.drug-alert {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #1a1a2e;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    margin: 10px 0;
    display: inline-block;
}

/* ショック回数表示 */
.shock-count {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 65, 108, 0.9);
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    z-index: 100;
}

/* レスポンシブ調整 */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .timer-display {
        font-size: 2rem;
    }

    .btn-large {
        padding: 15px 25px;
        font-size: 1rem;
    }

    .input-row {
        flex-direction: column;
    }

    .input-row select,
    .input-row input {
        min-width: 100%;
    }
}
