:root {
    --bg-color: #0c0c14;
    --card-bg: #161625;
    --input-bg: #1f1f33;
    --accent: #DC007B;
    --accent-hover: #b30063;
    --text: #e0e0e0;
    --text-dim: #a0a0b0;
    --error: #ff5252;
    --success: #00c853;
    --border: #2a2a40;
}

#alacarteNext,
#alacarteStart {
    display: block;
    margin: 0 auto 12px auto;
}

.send-status {
    color: #444;
    text-align: center;
    margin-bottom: 8px;
}

.progress-track {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    width: 0%;
    transition: width 0.2s ease;
}

.progress-label {
    color: var(--text-dim);
    text-align: center;
    font-size: 13px;
}

.send-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    margin-top: 10px;
    color: #444;
}

.send-actions {
    justify-content: center;
}

.avatar-info {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.avatar-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.avatar-name {
    font-weight: 700;
    color: #000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.menu-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sub-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 0;
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0;
}

.sub-card {
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 2;
}

.sub-item {
    background: #E6E6E6;
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    width: 100%;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
}

.sub-item.active {
    background: #D10073;
    color: #fff;
}

.subtab-content.hidden {
    display: none;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    background: #fff;
    color: #000;
}

textarea:focus {
    outline: none;
    border-color: #D10073;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.menu-item {
    background: #60D6E9;
    border: none;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-item.active {
    border: none;
    background: #D10073;
    color: #fff;
}

.menu-item:hover {
    background: #60D6E9;
}

.tab-container {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.tab-content.hidden {
    display: none;
}

.tab-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    color: #000;
}

.balance-display {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.18);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.18);
}

.balance-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #f2f2f2;
    font-weight: 600;
}

.balance-icon {
    font-size: 16px;
}

.result-header .avatar-info {
    flex: 1;
}

.result-header .logout-btn {
    margin-left: auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.hidden-section {
    margin-top: 8px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    max-width: 520px;
    width: 100%;
    align-items: center;
}

.field-group label {
    font-weight: 700;
    color: #000;
}

.name-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.field-group input[type="text"] {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
}

#greetName {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.2);
    background: #E6E6E6;
    color: #000;
}

.field-group input[type="text"].readonly {
    opacity: 0.7;
    cursor: not-allowed;
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    justify-items: stretch;
}

.radio-item {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 10px;
    background: #E6E6E6;
    color: #000;
    justify-content: flex-start;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

#greetCountValue {
    min-width: 28px;
    text-align: right;
    color: var(--text);
    font-weight: 600;
}

.cost-row {
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

.primary-btn {
    width: auto;
    min-width: 160px;
    align-self: center;
    background: #5895DB;
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.primary-btn:hover {
    background: #477cc1;
}

.secondary-btn {
    width: auto;
    min-width: 160px;
    align-self: center;
    background: #DC007B;
    border: none;
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

#searchPersonBtn {
    min-width: 160px;
    padding: 12px 16px;
    padding: 8px 12px;
    font-size: 14px;
}

#editPersonBtn {
    min-width: 110px;
    padding: 6px 10px;
    font-size: 13px;
    align-self: center;
}

#greetGo {
    min-width: 140px;
    padding: 8px 12px;
    font-size: 14px;
    display: block;
    margin: 8px auto 0 auto;
}

#greetCost,
#greetCountValue {
    color: #000;
}

.placeholder-text {
    color: #000;
    font-style: italic;
}

/* Daily Tasks Grid */
.task-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    padding: 10px;
}

.daily-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.task-card {
    background: #ff85c0; /* Fallback base color for pink */
    background: radial-gradient(circle, #ffb3d9 0%, #ff85c0 40%, #ff5cb3 100%);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.task-card.disabled {
    filter: grayscale(0.7);
    opacity: 0.6;
    pointer-events: none;
}

.task-card.random-card {
    background: linear-gradient(135deg, #70DBEC 0%, #C7F1F9 100%);
}

.task-header {
    background: #fff;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 800;
    font-size: 18px;
    color: #000;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

.task-star {
    display: block;
}

.task-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.task-title {
    text-align: center;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
    margin-bottom: 12px;
    line-height: 1.2;
}

.task-image {
    font-size: 64px;
    margin: auto 0;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.task-progress {
    font-weight: 800;
    font-size: 16px;
    color: #000;
    margin-top: 12px;
}

.task-checkline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #000;
    font-weight: 700;
    margin-top: 12px;
    background: rgba(255,255,255,0.75);
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
}

.task-checkline input.task-check {
    width: 18px;
    height: 18px;
    accent-color: #DC007B;
}

.task-card.disabled .task-checkline {
    background: rgba(255,255,255,0.6);
    color: #555;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 16px;
    padding: 20px;
    width: min(420px, 90%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.confirm-dialog {
    background: #E6E6E6;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 16px;
    padding: 20px;
    width: min(420px, 90%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.modal-dialog h3 {
    text-align: center;
}

#confirmModal .modal-dialog {
    background: #E6E6E6;
    border: 1px solid rgba(0,0,0,0.15);
    color: #000;
}

#confirmModal h3,
#confirmModal .confirm-text,
#confirmModal .confirm-level {
    color: #000;
}

#confirmModal #confirmName {
    color: #DC007B;
}

.confirm-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.confirm-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #000;
}

.confirm-level {
    color: #000;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

#dailySuccess .modal-dialog {
    max-width: 320px;
    text-align: center;
}

#alacarteConfirmModal .modal-dialog {
    max-width: 620px;
}

#alacarteConfirmModal .confirm-actions {
    flex-wrap: wrap;
    gap: 10px;
}

#alacarteNotfoundModal .modal-dialog {
    max-width: 520px;
}

#alacarteNotfoundModal input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.2);
    background: #E6E6E6;
    color: #000;
    margin-top: 8px;
}

#alacarteNotfoundModal .confirm-body {
    justify-content: center;
}

.notfound-btn {
    min-width: 180px;
    padding: 12px 18px;
}

#alacarteNotfoundModal .confirm-actions {
    gap: 16px;
    justify-content: center;
}

.secondary-btn {
    background: #DC007B;
    border: none;
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    min-width: 160px;
}

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

#confirmModal .confirm-actions button {
    min-width: 160px;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('background.webp') no-repeat center center / cover;
    filter: blur(8px);
    transform: scale(1.03);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-card, .result-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.login-card {
    background: rgba(255, 255, 255, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #ACCAED;
    backdrop-filter: blur(10px);
}

.login-card h1 {
    color: #DC007B;
}

.login-card .input-group label {
    color: #578ECE;
}

.login-card .input-group input {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(172, 202, 237, 0.6);
    color: #000000;
}

.login-card .input-group input::placeholder {
    color: rgba(0, 0, 0, 0.6);
}

.login-card .remember-item span {
    color: #578ECE;
}

.login-card .status-container {
    color: #ACCAED;
}

.login-card button#loginBtn {
    background-color: #578ECE;
    color: #fff;
}

.login-card button#loginBtn:hover {
    background-color: #4778b7;
}

#corsBadge {
    display: none !important;
}

.login-card .remember-item input {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #DC007B;
    border-radius: 4px;
    background: transparent;
    position: relative;
    cursor: pointer;
}

.login-card .remember-item input:checked {
    background: #DC007B;
    border-color: #DC007B;
}

.login-card .remember-item input:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

h1, h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.subtitle {
    color: var(--text-dim);
    text-align: center;
    font-size: 14px;
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #000;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 12px 16px;
    color: #000;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #60D6E9;
    box-shadow: 0 0 0 2px rgba(96, 214, 233, 0.25);
}

button {
    width: 100%;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    background-color: var(--accent-hover);
}

button:active {
    transform: scale(0.98);
}

.status-container {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-dim);
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(124, 77, 255, 0.3);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.result-card h2 {
    color: var(--success);
    margin-bottom: 24px;
}

.result-card {
    position: relative;
    padding-bottom: 40px;
    background: #E6E6E6;
    border: 1px solid rgba(0,0,0,0.08);
    color: #000;
}

.welcome-text {
    color: #000;
    font-size: 16px;
    text-align: center;
}

.next-refresh {
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
    margin-top: 8px;
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 2px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.36), rgba(255,255,255,0.22));
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 16px;
    color: #ACCAED;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
    width: 100%;
    position: relative;
}

#confirmModal .avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    border: none;
    object-fit: cover;
    background: #fff;
    box-shadow: none;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: 2px solid rgba(255,255,255,0.7);
    object-fit: cover;
    background-color: rgba(0,0,0,0.25);
    box-shadow: 0 6px 12px rgba(0,0,0,0.35);
}

.avatar-row .logout-btn {
    position: static;
    margin-left: auto;
    margin-right: 4px;
    margin-top: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 12px;
}

.result-header .logout-btn {
    background-color: #DC007B;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

.result-header .logout-btn:hover {
    background-color: #b30063;
}

.token-group {
    margin-bottom: 24px;
    position: relative;
}

.token-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.token-group textarea {
    width: 100%;
    height: 80px;
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-dim);
    font-size: 12px;
    font-family: monospace;
    resize: none;
    word-break: break-all;
}

.copy-btn {
    margin-top: 8px;
    padding: 8px;
    font-size: 12px;
    background-color: var(--border);
}

.copy-btn:hover {
    background-color: var(--input-bg);
}

.remember-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0 16px;
}

.remember-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #578ECE;
    user-select: none;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: rgba(220, 0, 123, 0.08);
}

.remember-item input {
    accent-color: #DC007B;
}

.cors-badge {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--input-bg);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.cors-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.cors-badge.active .dot { background-color: var(--success); }
.cors-badge.inactive .dot { background-color: var(--error); }
.cors-badge.active .label { color: var(--success); }
.cors-badge.inactive .label { color: var(--error); }

.login-card { position: relative; }

/* Overlay styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(124, 77, 255, 0.12), transparent 45%),
                radial-gradient(circle at 70% 70%, rgba(0, 200, 83, 0.12), transparent 40%),
                rgba(12, 12, 20, 0.75);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.overlay-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.72);
    gap: 14px;
}

.alert-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.overlay h1 {
    font-size: 22px;
    margin-bottom: 8px;
}

.overlay p {
    color: var(--text-dim);
    margin-bottom: 14px;
}

.step {
    background-color: var(--input-bg);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    text-align: left;
    border: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.step-num {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    background-color: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.step p {
    margin: 0;
    line-height: 1.4;
}

.store-btn {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 12px;
    transition: background-color 0.2s;
}

.btn-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.store-btn:hover {
    background-color: var(--accent-hover);
}

.instruction-video {
    width: 100%;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid var(--border);
}

.footer-note {
    font-size: 12px;
    margin-top: 20px;
    color: var(--accent);
    font-weight: 500;
}
