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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(180deg, #160a03 0%, #ff9825 100%);
    color: #ffffff;
    min-height: 100vh;
    width: 100%;
    max-width: 414px;
    margin: 0 auto;
    position: relative;
    overflow-x: hidden;
}

.container {
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header with title image */
.header {
    width: 111%;
    text-align: center;
    margin-bottom: 30px;
}

.title-image {
    width: 350px;
    height: auto;
    max-width: 90%;
}

.wallet-section {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a1a;
}

.btn-secondary {
    background: transparent;
    color: #ffd700;
    border: 2px solid #ffd700;
}

.wallet-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #ffd700;
    font-size: 0.9rem;
    flex-direction: row;
}

.wallet-info span {
    font-weight: bold;
}

#walletAddress {
    color: #ffd700;
    font-weight: bold;
    font-size: 1rem;
}

.hidden {
    display: none !important;
}

/* My Cards Section */
.my-cards-section {
    width: 100%;
    margin-bottom: 30px;
    height: 220px;
}

.my-cards-container {
    background-image: url('./image/mycard-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 20px;
    border-radius: 15px;
    min-height: 225px;
    position: relative;
}

.my-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 48px;
}

.my-cards-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.my-card-slot {
    width: 40px;
    height: 58px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: #713411;
    background-size: cover;
    background-position: center;
}

.my-card-slot.collected {
    background-image: url('./image/my-bg.png');
}

.my-card-slot.empty {
    background-image: url('./image/my-bg2.png');
}

/* Completion Overlay Styles */
.completion-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    z-index: 10;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.completion-message {
    color: #ffd700;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.completion-id {
    color: #ffffff;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid #ffd700;
}

/* Lottery Section */
.lottery-section {
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
}

.lottery-title {
    color: #ffd700;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.get-more-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
}

/* Click to Flip Section */
.click-section {
    width: 100%;
    /* margin-bottom: 30px; */
}

.click-container {
    margin-left: -20px !important;
    background-image: url(./image/click-bg.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    padding: 50px 30px;
    border-radius: 15px;

    width: 111%;
    /* max-width: 350px; */
    margin: 0 auto;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 30px;
    padding: 19px;
}

.flip-card {
    width: 90px;
    height: 90px;
    perspective: 1000px;
    cursor: pointer;
    margin: 0 auto;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.flip-card-back {
    background-image: url('./image/back-bg.png');
}

.flip-card-front {
    background-image: url('./image/card-bg.png');
    transform: rotateY(180deg);
}

.card-pattern,
.card-letter {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.flip-card.disabled {
    cursor: not-allowed;
    opacity: 1;
}

/* Bottom Buttons */
.bottom-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 300px;
}

.share-btn {
    flex: 2;
    height: 50px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-image: url('./image/shark.png');
    background-color: transparent;
    min-height: 50px;
    min-width: 80px;
}

.task-btn {
    flex: 4;
    height: 50px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-image: url('./image/Task.png');
    background-color: transparent;
    min-height: 50px;
    min-width: 160px;
}

/* Rules Section */
.rules-section {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    color: #333;
}

.rules-header {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.rules-tab {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

.rules-tab.active {
    background: #ffd700;
    color: #1a1a1a;
}

.rules-tab.inactive {
    background: rgba(255, 255, 255, 0.5);
    color: #666;
}

.rules-content {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(145deg, #2d2d2d, #1a1a1a);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid #ffd700;
    text-align: center;
    max-width: 300px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    color: #ffd700;
    cursor: pointer;
}

.result-letter {
    font-size: 3rem;
    color: #ffd700;
    font-weight: bold;
    margin: 15px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #444;
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Tasks Modal */
.tasks-modal-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.task-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.task-modal-info {
    flex: 1;
    text-align: left;
}

.task-modal-title {
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.task-modal-desc {
    color: #cccccc;
    font-size: 0.8rem;
}

.task-modal-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.8rem;
}

.task-modal-btn.open {
    background: #ffd700;
    color: #1a1a1a;
}

.task-modal-btn.claim {
    background: #4caf50;
    color: white;
}

.task-modal-btn.claimed {
    background: #666;
    color: #999;
    cursor: not-allowed;
}

/* Invitations Tab Styles */
.invitation-stats {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
}

.invitation-stats p {
    margin: 5px 0;
    font-weight: bold;
}

.invitation-list-header {
    display: flex;
    background: #ffd700;
    color: #1a1a1a;
    padding: 8px 10px;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    margin-top: 15px;
}

.invitation-address {
    flex: 2;
}

.invitation-status {
    flex: 1;
    text-align: center;
}

.invitation-time {
    flex: 1;
    text-align: right;
}

.invitation-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: white;
}

.invitation-item {
    display: flex;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

.invitation-item:last-child {
    border-bottom: none;
}

.invitation-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.invitation-status.success {
    color: green;
    font-weight: bold;
}

.invitation-status.pending {
    color: orange;
    font-weight: bold;
}
