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

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* Typography Helpers */
h1, h2, h3, h4, p { margin-top: 0; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.text-center { text-align: center; }

/* Layout */
.page-wrapper {
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The Card (Gleam Dupe) */
.gleam-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    position: relative;
    margin-bottom: 30px;
}

/* Card Hero Image */
.card-hero {
    width: 100%;
    height: 240px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.card-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Card Header */
.card-header {
    padding: 24px 24px 16px;
    text-align: center;
}
.card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}
.card-header p {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 0;
}

/* Stats Bar */
.card-stats {
    display: flex;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}
.stat-box {
    flex: 1;
    text-align: center;
    padding: 16px 10px;
}
.stat-box:first-child {
    border-right: 1px solid #e2e8f0;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
}

/* Action List */
.action-list {
    background: #fff;
}
.action-row {
    border-bottom: 1px solid #f1f5f9;
}
.action-row:last-child {
    border-bottom: none;
}

.row-header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.row-header:hover {
    background-color: #f8fafc;
}

/* Completed state styling */
.action-row.completed .row-header {
    background-color: #f0fdf4;
}
.action-row.completed .row-label {
    color: #166534;
    text-decoration: line-through;
    opacity: 0.7;
}
.action-row.completed .points {
    display: none;
}
.action-row.completed .check-icon {
    display: block !important;
    width: 20px;
    height: 20px;
    color: #16a34a;
}

/* Needs-entry state styling (shaking animation class) */
.action-row.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    background-color: #fef2f2;
}
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.row-icon {
    width: 24px;
    height: 24px;
    color: #475569;
    margin-right: 16px;
    flex-shrink: 0;
}
.row-icon svg {
    width: 100%;
    height: 100%;
}
.row-label {
    flex-grow: 1;
    font-weight: 500;
    font-size: 0.95rem;
    color: #334155;
    transition: color 0.2s;
}
.row-badge {
    flex-shrink: 0;
    margin-left: 12px;
}
.points {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Expandable Content */
.row-content {
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
.content-inner {
    padding: 20px 24px;
}
.content-desc {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 16px;
}

/* Forms & Inputs */
.input-group {
    margin-bottom: 12px;
}
input[type="text"], input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.error-msg {
    color: #dc2626;
    font-size: 0.85rem;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 4px;
    border-left: 3px solid #ef4444;
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.btn-primary {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-primary:hover:not(:disabled) {
    background-color: #1d4ed8;
}

/* Share Panel */
.share-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.share-input-wrap input {
    flex-grow: 1;
    background: #fff;
    cursor: copy;
}
.share-input-wrap .btn {
    width: auto;
    background: #e2e8f0;
    color: #334155;
}
.share-input-wrap .btn:hover {
    background: #cbd5e1;
}

.social-share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.btn-social {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}
.btn-social:hover {
    transform: scale(1.05);
}
.btn-social.fb { background: #1877F2; }
.btn-social.tw { background: #000000; }

/* Footer */
.card-footer {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.card-footer a {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}
.modal-lg {
    max-width: 600px;
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
}
.rules-content {
    font-size: 0.9rem;
    color: #475569;
    white-space: pre-wrap;
}

/* Powered by slot */
#wbx-powered-by-slot {
    margin-top: auto;
    padding-top: 20px;
    width: 100%;
}

@media (max-width: 600px) {
    .page-wrapper {
        padding: 20px 10px;
    }
    .gleam-card {
        margin-bottom: 20px;
    }
    .card-hero {
        height: 200px;
    }
}