:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.rating-summary {
    position: fixed;
    top: 80px;
    /* header height + margin */
    right: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    width: 120px;
    border: 1px solid var(--border-color);
}

.rating-summary h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
}

.rating-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rating-summary li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
    font-weight: bold;
}

.rating-summary span {
    color: var(--primary-color);
    font-size: 16px;
}

@media (max-width: 1000px) {
    .rating-summary {
        position: fixed;
        bottom: 0;
        top: auto;
        right: 0;
        left: 0;
        width: 100vw;
        max-width: 100vw;
        display: flex;
        justify-content: space-evenly;
        align-items: center;
        padding: 8px 6px;
        border-radius: 0;
        box-sizing: border-box;
        border-top: 1px solid #cbd5e1;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(8px);
        overflow-x: hidden;
    }

    .rating-summary h3 {
        display: none;
        /* 모바일에서는 제목 숨김 */
        margin: 0;
        border: none;
        padding: 0;
    }

    .rating-summary ul {
        display: flex;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        justify-content: space-evenly;
        align-items: center;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    .rating-summary li {
        font-size: 13px;
        padding: 2px 4px;
        white-space: nowrap;
    }

    .container {
        padding-bottom: 80px;
        /* 하단 바 가림 방지 */
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.login-container {
    max-width: 400px;
    margin-top: 100px;
    background: var(--card-background);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

header {
    background-color: #fff;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: flex-end;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

h1,
h2,
h3 {
    margin-top: 0;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 18px;
    box-sizing: border-box;
    /* Important for width: 100% */
}

.btn {
    display: inline-block;
    padding: 15px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
    box-sizing: border-box;
}

.btn-primary:hover {
    background-color: #357abd;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

.team-list {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.team-card {
    background: var(--card-background);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.team-card.error {
    border: 2px solid #e74c3c;
}

.team-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.team-id {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    margin-right: 10px;
}

.team-name {
    margin: 0;
    font-size: 18px;
}

.team-topic {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.rating-options {
    display: flex;
    gap: 10px;
}

.radio-label {
    flex: 1;
    position: relative;
}

.radio-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    display: block;
    padding: 10px;
    text-align: center;
    background: #f0f0f0;
    border-radius: 5px;
    transition: all 0.2s;
    font-weight: bold;
}

.radio-label input:checked+.radio-custom {
    background: var(--primary-color);
    color: white;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
}

.text-center {
    text-align: center;
}

/* 마우스 호버 시 버튼 기능 설명 툴팁 */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(17, 24, 39, 0.94);
    color: #ffffff;
    padding: 7px 11px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 9999;
}

[data-tooltip]::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(17, 24, 39, 0.94) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease;
    z-index: 9999;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}