/* ===========================
   CSS Variables & Theme
   =========================== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(30, 30, 50, 0.8);
    --bg-card-hover: rgba(40, 40, 65, 0.9);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(102, 126, 234, 0.5);
    
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.3);
    
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(240, 147, 251, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ===========================
   App Container
   =========================== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 40px;
}

/* ===========================
   Header
   =========================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 30px;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.5);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-lang {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-lang:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.btn-add-reward {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-glow);
}

.btn-add-reward:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 50px rgba(102, 126, 234, 0.5);
}

.btn-add-reward:active {
    transform: scale(0.98);
}

.plus-icon {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ===========================
   Rewards Container
   =========================== */
.rewards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===========================
   Reward Card
   =========================== */
.reward-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
    animation: cardAppear 0.5s ease forwards;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reward-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.reward-card.completed {
    border-color: rgba(56, 239, 125, 0.5);
    box-shadow: 0 0 30px rgba(56, 239, 125, 0.2);
}

.reward-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.reward-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reward-emoji {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.reward-name {
    font-size: 1.3rem;
    font-weight: 700;
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-icon.btn-delete:hover {
    background: rgba(245, 87, 108, 0.3);
    border-color: rgba(245, 87, 108, 0.5);
    color: #f5576c;
}

/* Progress Section */
.progress-section {
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-count {
    font-size: 1.1rem;
    font-weight: 600;
}

.progress-count .current {
    font-size: 1.5rem;
    background: var(--warning-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Empty Filter Message */
.empty-filter-message {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
    margin: 20px 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1.6;
}

.progress-remaining {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-bar {
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--warning-gradient);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    position: relative;
    min-width: 0;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill.completed {
    background: var(--success-gradient);
}

/* Sticker Buttons */
.sticker-buttons {
    display: flex;
    gap: 12px;
}

.btn-sticker {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-sticker-add {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-sticker-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

.btn-sticker-add:active {
    transform: scale(0.98);
}

.btn-sticker-minus {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    flex: 0 0 60px;
}

.btn-sticker-minus:hover {
    background: rgba(245, 87, 108, 0.2);
    border-color: rgba(245, 87, 108, 0.5);
    color: #f5576c;
}

.btn-claim {
    flex: 1;
    background: var(--success-gradient);
    color: white;
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(56, 239, 125, 0.4); }
    50% { box-shadow: 0 4px 40px rgba(56, 239, 125, 0.6); }
}

.btn-claim:hover {
    animation: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 40px rgba(56, 239, 125, 0.6);
}

/* ===========================
   Filter Section
   =========================== */
.filter-section {
    display: flex;
    gap: 12px;
    padding: 0 0 20px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

/* ===========================
   Completed Reward Styles
   =========================== */
.reward-card.completed-status {
    opacity: 0.9;
    background: rgba(30, 30, 50, 0.6);
}

.completed-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--success-gradient);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    margin-left: 8px;
}

.btn-restart {
    flex: 0 0 auto;
    background: var(--warning-gradient);
    color: white;
}

.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(247, 151, 30, 0.5);
}

/* ===========================
   Read-only Sticker Grid
   =========================== */
.sticker-grid.readonly .grid-cell {
    cursor: not-allowed;
    opacity: 0.9;
}

.sticker-grid.readonly .grid-cell:hover {
    transform: none;
    box-shadow: none;
}

.detail-readonly-notice {
    padding: 20px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--radius-md);
    text-align: center;
    margin: 20px 0;
}

.detail-readonly-notice h3 {
    font-size: 1.1rem;
    color: #ffc107;
    margin-bottom: 12px;
    font-weight: 700;
}

.detail-readonly-notice p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.detail-readonly-notice .btn-restart {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

/* ===========================
   Empty State
   =========================== */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    min-height: 50vh;
}

.empty-state.visible {
    display: flex;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.empty-state h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.8;
}

/* ===========================
   Buttons
   =========================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 50px rgba(102, 126, 234, 0.5);
}

.btn-primary.btn-large {
    padding: 20px 48px;
    font-size: 1.2rem;
}

.btn-secondary {
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* ===========================
   Modal
   =========================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-normal);
}

.modal-overlay.visible .modal {
    transform: scale(1) translateY(0);
}

.modal-small {
    max-width: 360px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.btn-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-close:hover {
    background: rgba(245, 87, 108, 0.3);
    color: #f5576c;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    justify-content: flex-end;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--border-glow);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* Emoji Picker */
.emoji-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.emoji-option {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.emoji-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.emoji-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* Number Input */
.number-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.number-input input {
    flex: 1;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    -moz-appearance: textfield;
}

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

.btn-number {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-number:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sticker Count Modal */
.sticker-modal-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.sticker-count-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.sticker-count-btn {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sticker-count-btn:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    transform: scale(1.02);
}

/* ===========================
   Celebration Overlay
   =========================== */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 35, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.celebration-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.celebration-content {
    text-align: center;
    z-index: 1;
}

.celebration-emoji {
    font-size: 8rem;
    animation: celebrateBounce 0.6s ease infinite;
}

@keyframes celebrateBounce {
    0%, 100% { transform: scale(1) rotate(-5deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.celebration-content h2 {
    font-size: 3rem;
    font-weight: 900;
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 20px 0 10px;
}

.celebration-content p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Confetti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===========================
   Emoji Picker Modal
   =========================== */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.emoji-grid-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.emoji-grid-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.emoji-grid-item.selected {
    border-color: var(--border-glow);
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.modal-large {
    max-width: 600px;
    width: 90%;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .btn-add-reward span:last-child {
        display: none;
    }
    
    .btn-add-reward {
        padding: 12px 16px;
    }
    
    .reward-card {
        padding: 20px;
    }
    
    .reward-emoji {
        font-size: 2rem;
    }
    
    .reward-name {
        font-size: 1.1rem;
    }
    
    .emoji-picker {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .sticker-buttons {
        flex-direction: column;
    }
    
    .btn-sticker-minus {
        flex: unset;
        order: 2;
    }
}

/* iPad optimization */
@media (min-width: 768px) and (max-width: 1024px) {
    .app-container {
        padding: 30px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .reward-card {
        padding: 30px;
    }
    
    .reward-emoji {
        font-size: 3rem;
    }
    
    .reward-name {
        font-size: 1.5rem;
    }
    
    .btn-sticker {
        padding: 20px 32px;
        font-size: 1.2rem;
    }
}

/* ===========================
   Detail Screen
   =========================== */
.detail-screen {
    display: none;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 120px;
}

.detail-screen.visible {
    display: block;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-back span:first-child {
    font-size: 1.2rem;
}

.detail-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-emoji {
    font-size: 2rem;
}

.detail-name {
    font-size: 1.3rem;
    font-weight: 700;
}

.detail-count {
    background: var(--warning-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Detail Progress Section */
.detail-progress-section {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

.detail-progress-section .detail-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-progress-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-progress-right {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: normal;
    text-align: right;
}

.detail-count .current {
    font-size: 2rem;
    font-weight: 800;
    background: var(--warning-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-count .divider {
    color: var(--text-muted);
    font-weight: 400;
    margin: 0 2px;
}

.detail-count .target {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===========================
   Sticker Grid (Simplified)
   =========================== */
.sticker-grid-container {
    padding: 0 20px 20px;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
}

.grid-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 2rem;
    position: relative;
}

.grid-cell:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.grid-cell.has-sticker {
    animation: stickerPop 0.3s ease;
}

.grid-cell.empty:hover::after {
    content: '+';
    position: absolute;
    font-size: 1.5rem;
    color: var(--text-muted);
}

@keyframes stickerPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}


}

.sticker-option {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sticker-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.sticker-option.selected {
    border-color: var(--border-glow);
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4);
}

/* Grid Actions (Clear All Button) */
.grid-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 20px 12px 20px;
}

.btn-clear-all-grid {
    padding: 8px 16px;
    background: rgba(247, 87, 108, 0.15);
    border: 1px solid rgba(247, 87, 108, 0.3);
    border-radius: var(--radius-sm);
    color: #f7576c;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-clear-all-grid:hover {
    background: rgba(247, 87, 108, 0.25);
    transform: translateY(-2px);
}

/* Add Emoji Button in Palette */
.sticker-option.add-button {
    background: rgba(102, 126, 234, 0.2);
    border: 2px dashed var(--border-glow);
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
}

.sticker-option.add-button:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: scale(1.15);
}

/* Detail Claim Section */
.detail-claim-section {
    display: none;
    position: fixed;
    bottom: 100px;
    left: 20px;
    right: 20px;
    z-index: 99;
}

.detail-claim-section.visible {
    display: block;
}

.detail-claim-section .btn-claim {
    width: 100%;
}

/* ===========================
   Emoji Tabs
   =========================== */
.emoji-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.emoji-tab {
    flex-shrink: 0;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.emoji-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.emoji-tab.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* Larger Modal for Emoji */
.modal-large {
    max-width: 560px;
}

.modal-large .emoji-picker {
    grid-template-columns: repeat(8, 1fr);
    max-height: 200px;
    overflow-y: auto;
}

/* Sticker Selector Button */
.btn-sticker-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    border-radius: 24px;
    border: 2px dashed var(--primary);
    background: linear-gradient(135deg, var(--surface) 0%, var(--secondary-bg) 100%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-sticker-selector:hover {
    transform: translateY(-2px);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.2);
}

.btn-sticker-selector:active {
    transform: scale(0.98);
}

.sticker-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sticker-preview {
    font-size: 1.5rem;
    line-height: 1;
}

.sticker-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.btn-sticker-selector:hover .sticker-arrow {
    transform: translateY(2px);
}

/* Floating Sticker Button */
.btn-sticker-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 24px;
    border-radius: 28px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
    z-index: 100;
}

.btn-sticker-floating .sticker-preview {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.btn-sticker-floating .sticker-label {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.btn-sticker-floating:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 32px rgba(102, 126, 234, 0.6);
}

.btn-sticker-floating:active {
    transform: scale(0.96);
}
@keyframes stickerChange {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.4) rotate(-15deg); }
    100% { transform: scale(1) rotate(0deg); }
}



/* Clickable Reward Info */
.reward-info-clickable {
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 8px;
    margin: -8px;
    border-radius: var(--radius-md);
}

.reward-info-clickable:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===========================
   Detail Screen Responsive
   =========================== */
@media (max-width: 600px) {
    .detail-header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }
    
    .btn-back span:last-child {
        display: none;
    }
    
    .detail-title {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    /* Floating sticker button - full width on mobile */
    .btn-sticker-floating {
        left: 16px;
        right: 16px;
        width: auto;
        justify-content: center;
        border-radius: 16px;
    }
    

    
    .table-cell {
        min-height: 50px;
        padding: 8px 4px;
        font-size: 0.8rem;
    }
    
    .sticker-cell {
        font-size: 1.4rem;
    }
    
    .sticker-palette {
        padding: 12px 16px;
    }
    
    .sticker-option {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }
}

@media (min-width: 768px) {
    .sticker-table-container {
        padding: 0 30px;
    }
    
    .sticker-palette {
        padding: 20px 30px;
    }
    
    .table-cell {
        min-height: 70px;
        font-size: 1rem;
    }
    
    .sticker-cell {
        font-size: 2rem;
    }
    
    .sticker-option {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }
}
