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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

.container {
    background: #ffffff;
    padding: 40px 28px;
    border-radius: 24px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    text-align: center;
    max-width: 480px;
    width: 100%;
}

/* Header */
.header {
    margin-bottom: 32px;
}

.logo {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

h1 {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    color: #86868b;
    font-weight: 400;
}

/* Ball Display */
.ball-display {
    margin-bottom: 24px;
    padding: 20px 16px;
    background: #f5f5f7;
    border-radius: 16px;
}

.winning-numbers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    color: #c7c7cc;
    font-size: 14px;
    padding: 30px 0;
}

/* Set Row: label + 6 numbers */
.set-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.set-label {
    font-size: 13px;
    font-weight: 700;
    color: #86868b;
    width: 20px;
    flex-shrink: 0;
    text-align: center;
}

.set-nums {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 36px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.number.drawn {
    opacity: 1;
    transform: translateY(0);
}

/* Number Colors by range */
.number.range-1 { background: #007aff; }
.number.range-10 { background: #ff9500; }
.number.range-20 { background: #ff3b30; }
.number.range-30 { background: #6e6e73; }
.number.range-40 { background: #34c759; }

/* Draw Button */
#draw-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1d1d1f;
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 980px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    font-family: inherit;
    letter-spacing: -0.2px;
    margin-bottom: 28px;
}

#draw-button:hover {
    background: #424245;
    transform: scale(1.04);
}

#draw-button:active {
    transform: scale(0.97);
}

#draw-button:disabled {
    background: #d2d2d7;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

#draw-button:hover .btn-icon {
    transform: translateX(3px);
}

/* My Numbers Form */
.my-numbers {
    text-align: left;
    margin-bottom: 24px;
    padding-top: 4px;
    border-top: 1px solid #f0f0f0;
}

.my-numbers h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #86868b;
    margin-bottom: 12px;
    padding: 0 4px;
}

.form-numbers {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.form-numbers input {
    width: 100%;
    height: 40px;
    border: 1.5px solid #e8e8ed;
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    color: #1d1d1f;
    background: #f5f5f7;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.form-numbers input::-webkit-outer-spin-button,
.form-numbers input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-numbers input:focus {
    outline: none;
    border-color: #007aff;
    background: #fff;
}

.form-nickname {
    width: 100%;
    height: 40px;
    border: 1.5px solid #e8e8ed;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
    color: #1d1d1f;
    background: #f5f5f7;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.form-nickname:focus {
    outline: none;
    border-color: #007aff;
    background: #fff;
}

.form-actions {
    display: flex;
    gap: 8px;
}

.btn-secondary {
    flex: 1;
    height: 40px;
    border: 1.5px solid #e8e8ed;
    border-radius: 980px;
    background: #fff;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f5f5f7;
}

.btn-submit {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 980px;
    background: #007aff;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: #0063d1;
}

.form-msg {
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    color: #34c759;
    min-height: 20px;
}

.form-msg.error {
    color: #ff3b30;
}

/* Recent Wins */
.recent-wins {
    text-align: left;
    margin-bottom: 24px;
    padding-top: 4px;
    border-top: 1px solid #f0f0f0;
}

.recent-wins h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #86868b;
    margin-bottom: 10px;
    padding: 0 4px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f5f5f7;
    border-radius: 10px;
}

.recent-round {
    font-size: 11px;
    font-weight: 600;
    color: #aeaeb2;
    min-width: 42px;
}

/* History */
.history {
    text-align: left;
}

.history h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #86868b;
    margin-bottom: 12px;
    padding: 0 4px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 4px;
}

.history-group {
    background: #f5f5f7;
    border-radius: 12px;
    padding: 12px;
    animation: slideIn 0.3s ease;
}

.history-round {
    font-size: 12px;
    font-weight: 700;
    color: #86868b;
    margin-bottom: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.history-item .round {
    font-size: 11px;
    font-weight: 600;
    color: #aeaeb2;
    min-width: 16px;
}

.history-item .nums {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.history-item .mini-ball {
    width: 28px;
    height: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.mini-ball.range-1 { background: #007aff; }
.mini-ball.range-10 { background: #ff9500; }
.mini-ball.range-20 { background: #ff3b30; }
.mini-ball.range-30 { background: #6e6e73; }
.mini-ball.range-40 { background: #34c759; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty state */
.history-list:empty::after {
    content: '아직 추첨 기록이 없습니다';
    display: block;
    text-align: center;
    padding: 20px;
    color: #d2d2d7;
    font-size: 14px;
}
