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

body {
    background-color: #0f0f0f;
    color: #f1f1f1;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
}

/* 共通ヘッダー */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background-color: #0f0f0f;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #272727;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-badge {
    background: #ff0000;
    color: #fff;
    font-size: 0.8rem;
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 900;
}

.header-actions .btn-create {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #272727;
    color: #f1f1f1;
    padding: 8px 16px;
    border-radius: 18px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.header-actions .btn-create:hover {
    background-color: #3f3f3f;
}

/* カテゴリタグバー（YouTube風ピルボタン） */
.tags-bar {
    display: flex;
    gap: 12px;
    padding: 12px 24px;
    overflow-x: auto;
    white-space: nowrap;
    background-color: #0f0f0f;
}

.tag-pill {
    background-color: #272727;
    color: #f1f1f1;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.tag-pill:hover {
    background-color: #3f3f3f;
}

.tag-pill.active {
    background-color: #f1f1f1;
    color: #0f0f0f;
    font-weight: 600;
}

/* 一覧グリッド */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 16px 24px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px 16px;
}

.video-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.thumb-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #212121;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.video-card:hover .thumb-container img {
    transform: scale(1.02);
}

.video-details {
    display: flex;
    gap: 12px;
}

.channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #555;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    color: #fff;
}

.meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
    color: #f1f1f1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.channel-name, .stats {
    font-size: 0.82rem;
    color: #aaa;
    line-height: 1.3;
}

.stats {
    display: flex;
    gap: 6px;
}

.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: #888;
}

.empty-state a {
    color: #3ea6ff;
    text-decoration: none;
}

/* アップロード画面専用 */
.upload-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.upload-card {
    background: #212121;
    padding: 32px;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.upload-card h2 {
    margin-bottom: 24px;
    font-size: 1.3rem;
    border-bottom: 1px solid #333;
    padding-bottom: 12px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #aaa;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    background: #121212;
    border: 1px solid #3f3f3f;
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: #3ea6ff;
    outline: none;
}

.btn-primary {
    background-color: #cc0000;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #ff0000;
}

.alert-error {
    background: #441212;
    color: #ff8585;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success {
    background: #12381e;
    color: #7ce39f;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}