@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

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

body {
    font-family: 'Noto Sans JP', sans-serif; /* Noto Sans JP を優先 */
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    padding: 20px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

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

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

h1 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
}

/* PCでフォームが横に伸びすぎないよう調整 */
.card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin: 0 auto 20px auto; /* 中央寄せ */
    max-width: 600px; /* 800pxだと少し広いので、入力画面は600pxくらいが綺麗です */
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.main-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.tab {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab:hover {
    color: #2c3e50;
    background: rgba(44, 62, 80, 0.05);
}

.tab.active {
    color: #2c3e50;
    border-bottom-color: #2c3e50;
    background: transparent;
}

.main-tabs .tab {
    flex: none;
    background: #e8e8e8;
    color: #2c3e50;
    border-radius: 10px;
    border-bottom: none;
    font-weight: 500;
    padding: 12px 30px;
}

.main-tabs .tab:hover {
    background: #d5d5d5;
    color: #2c3e50;
}

.main-tabs .tab.active {
    background: #2c3e50;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

label {
    display: block;
    margin: 15px 0 5px;
    font-weight: bold;
    color: #333;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2c3e50;
}

.radio-group, .checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.radio-group label, .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

.highlight-box {
    background: #fff3cd;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-logout {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-delete {
    padding: 5px 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.match-card {
    border-left: 5px solid #ddd;
}

.match-card.win {
    border-left-color: #28a745;
}

.match-card.lose {
    border-left-color: #dc3545;
}

.match-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.match-date {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.match-result {
    font-weight: bold;
    font-size: 18px;
}

.match-card.win .match-result {
    color: #28a745;
}

.match-card.lose .match-result {
    color: #dc3545;
}

.match-body {
    margin-bottom: 10px;
}

.death-types {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.next-focus {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-style: italic;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}
.stat-label {
    color: #666;
    margin-top: 5px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .card {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    /* ヘッダー */
    .header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .header h1 {
        margin-bottom: 10px;
    }
    
    .header > div {
        display: flex;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }
    
    /* ログイン画面のタブ（縦並び） */
    #login-screen .tabs {
        flex-direction: column;
        gap: 5px;
        border-bottom: none;
    }
    
    #login-screen .tab {
        width: 100%;
        padding: 12px;
        border: 1px solid #ddd;
        border-radius: 8px;
        border-bottom: none;
    }
    
    #login-screen .tab.active {
        border: 2px solid #2c3e50;
        background: #f8f9fa;
    }
    
    /* メインタブ（横並び維持） */
    .main-tabs {
        flex-direction: row;
        gap: 5px;
        overflow-x: auto;
    }
    
    .main-tabs .tab {
        flex: 1;
        min-width: 80px;
        padding: 10px 5px;
        font-size: 0.9em;
    }
    
    /* フォーム */
    label {
        margin-top: 12px;
        margin-bottom: 5px;
        font-size: 0.95em;
    }
    
    input, select, textarea {
        font-size: 16px;
        padding: 12px;
    }
    
    textarea {
        min-height: 80px;
    }
    
    /* ラジオボタン・チェックボックス */
    .radio-group, .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .radio-group label, .checkbox-group label {
        padding: 10px;
        background: #f8f9fa;
        border-radius: 8px;
    }
    
    /* ボタン */
    .btn-primary {
        padding: 14px;
        font-size: 1em;
    }
    
    .btn-logout {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .btn-delete {
        width: 100%;
        margin-top: 10px;
    }
    
    /* 試合カード */
    .match-card {
        padding: 15px;
    }
    
    .match-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .match-result {
        font-size: 1.2em;
        text-align: left;
    }
    
    .match-date {
        font-size: 0.85em;
    }
    
    .match-body {
        font-size: 0.9em;
    }
    
    .death-types {
        font-size: 0.85em;
    }
    
    .next-focus {
        font-size: 0.9em;
        padding: 8px;
    }
    
    /* 統計 */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-item {
        padding: 15px 10px;
    }
    
    .stat-value {
        font-size: 1.8em;
    }
    
    .stat-label {
        font-size: 0.85em;
    }
    
    /* ハイライトボックス */
    .highlight-box {
        padding: 12px;
        font-size: 0.9em;
    }
}

/* 超小型スマホ（iPhone SE など） */
@media (max-width: 375px) {
    body {
        padding: 5px;
    }
    
    .card {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.3em;
    }
    
    .main-tabs .tab {
        font-size: 0.8em;
        padding: 8px 3px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* タブの表示・非表示を制御 */
    .tab-content {
        display: none;
    }

    .tab-content.active {
        display: block;
    }
}