:root {
    --color-bg: #fff9c4;
    --color-primary: #ffeb3b;
    --color-secondary: #4fc3f7;
    --color-accent: #ff8a80;
    --color-text: #212121;
    --color-white: #ffffff;
    --border-width: 3px;
    --shadow-offset: 4px;
    --border-radius: 12px;
}

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

body {
    font-family: 'Jua', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    background-image: radial-gradient(#000000 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 100vh;
}

/* 유틸리티 */
.comic-btn {
    font-family: 'Jua', sans-serif;
    font-size: 1.2rem;
    padding: 0.8rem 1.5rem;
    border: var(--border-width) solid black;
    border-radius: 50px;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 black;
    cursor: pointer;
    background-color: var(--color-white);
    transition: all 0.2s;
}

.comic-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: calc(var(--shadow-offset) + 2px) calc(var(--shadow-offset) + 2px) 0 black;
}

.comic-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 black;
}

.comic-btn.primary { background-color: var(--color-primary); }
.comic-btn.highlight { background-color: var(--color-accent); color: white; text-shadow: 1px 1px 0 black; }
.comic-btn.large { width: 100%; font-size: 1.5rem; }

.comic-btn-icon { background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.comic-input {
    width: 100%;
    padding: 12px;
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    border: var(--border-width) solid black;
    border-radius: 8px;
    margin-top: 5px;
    background-color: #f9f9f9;
}
.comic-input:focus {
    outline: none;
    background-color: #e3f2fd;
    border-color: var(--color-secondary);
}

/* 레이아웃 */
.comic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: var(--color-white);
    border-bottom: var(--border-width) solid black;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 2rem;
    color: var(--color-text);
    text-shadow: 2px 2px 0 var(--color-secondary);
}

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

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

/* 모달 공통 */
.comic-modal {
    margin: auto;
    padding: 0;
    border: none;
    background: transparent;
    max-width: 100%;
    max-height: 100%;
}
.comic-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: var(--color-white);
    border: var(--border-width) solid black;
    box-shadow: 8px 8px 0 black;
    border-radius: var(--border-radius);
    padding: 30px;
    width: 90vw;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px dashed #ddd;
    padding-bottom: 15px;
}
.modal-header h2 {
    font-size: 1.8rem;
    word-break: keep-all;
}

.form-group { margin-bottom: 20px; }
.form-row { display: flex; gap: 15px; }
.form-group.half { flex: 1; }
.modal-footer { margin-top: 30px; text-align: right; }
.modal-footer.center { text-align: center; }

/* 상세 보기 스타일 */
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-tag { 
    background-color: #eee; 
    border: 2px solid black; 
    border-radius: 20px; 
    padding: 5px 12px; 
    font-size: 0.9rem;
}
.detail-desc {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    background-color: #f0f4c3;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid black;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 30px;
    background: #e1f5fe;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid black;
}
.info-item {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}
.info-item .label {
    font-weight: bold;
    width: 80px;
    margin-right: 10px;
}

.participants-section h3 { margin-bottom: 15px; }
.participants-list {
    list-style: none;
    display: flex;
    flex-direction: column; /* 세로 정렬 */
    gap: 10px;
}
.participants-list li {
    background-color: white;
    border: 2px solid black;
    border-radius: 8px; /* 둥근 사각형 */
    padding: 10px 15px;
    font-size: 1rem;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    width: 100%;
}
.participants-list li.me {
    background-color: var(--color-primary);
    font-weight: bold;
    border-width: 3px;
}

/* Web Component 스타일 (Global) */
study-card { display: block; height: 100%; }

.required-mark {
    color: #ff5252;
    margin-left: 4px;
    font-weight: bold;
}