* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app {
    max-width: 900px;
    width: 100%;
    background-color: #1e1e1e;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.8);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.header-left .title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 0.5px;
}
.header-left .subtitle {
    font-size: 0.95rem;
    color: #aaa;
    margin-top: 4px;
}

/* Language Selector */
.lang-selector {
    position: relative;
    display: inline-block;
}
.lang-btn {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 30px;
    padding: 8px 16px;
    color: #eee;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.lang-btn:hover {
    background: #333;
}
.lang-flag {
    font-size: 1.2rem;
}
.lang-arrow {
    transition: transform 0.2s;
}
.lang-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    width: 200px;
    z-index: 10;
    display: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}
.lang-dropdown.open {
    display: block;
}
.lang-dropdown .lang-option {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #3a3a3a;
}
.lang-dropdown .lang-option:last-child {
    border-bottom: none;
}
.lang-dropdown .lang-option:hover {
    background: #3a3a3a;
}
.lang-dropdown .lang-option .flag {
    font-size: 1.2rem;
}
.lang-dropdown .lang-option .name {
    color: #ddd;
}

/* Definition toggle */
.definition-toggle {
    text-align: left;
    margin: 6px 0 10px 0;
}
.btn-definition {
    background: transparent;
    border: none;
    color: #8ab4f8;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: background 0.2s;
}
.btn-definition:hover {
    background: #2a2a2a;
    text-decoration: underline;
}
.definition-content {
    background: #252525;
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ccc;
    border-left: 3px solid #ffd700;
    display: none; /* ẩn mặc định */
}
.definition-content.open {
    display: block;
}
.definition-content p {
    margin: 0;
}

/* Stats */
.stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 12px;
    background: #252525;
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 16px;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}
.stat-icon {
    font-size: 1.2rem;
}
.stat-label {
    color: #aaa;
}
.stat-value {
    font-weight: 600;
    color: #fff;
    min-width: 50px;
}
.stat-lucky .stat-value { color: #ffd700; }
.stat-unlucky .stat-value { color: #ff6b6b; }
.stat-status .stat-value { color: #6bcfff; }

/* Message */
.message-area {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 20px;
    min-height: 54px;
    display: flex;
    align-items: center;
    border-left: 4px solid #ffd700;
}
#messageText {
    font-size: 1rem;
    color: #ddd;
}

/* Grid */
.grid-container {
    margin-bottom: 24px;
}
.grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
}
.cell {
    aspect-ratio: 1 / 1;
    background: #2d2d2d;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ccc;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    border: 1px solid #3a3a3a;
}
.cell:hover:not(.clicked):not(.disabled) {
    background: #3a3a3a;
    transform: scale(1.02);
    border-color: #666;
}
.cell.lucky {
    background: #2a4a2a;
    border-color: #ffd700;
    color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
    cursor: default;
}
.cell.unlucky {
    background: #4a2222;
    border-color: #ff6b6b;
    color: #ff6b6b;
    box-shadow: 0 0 12px rgba(255, 107, 107, 0.2);
    cursor: default;
}
.cell.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Actions */
.actions {
    display: flex;
    justify-content: center;
}
.btn-reset {
    background: #2a2a2a;
    border: 1px solid #555;
    color: #eee;
    padding: 12px 32px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-reset:hover {
    background: #3a3a3a;
    border-color: #ffd700;
    color: #ffd700;
}

/* Footer */
.footer {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    border-top: 1px solid #2a2a2a;
    padding-top: 16px;
}

/* Scrollbar */
.lang-dropdown::-webkit-scrollbar {
    width: 6px;
}
.lang-dropdown::-webkit-scrollbar-track {
    background: #1e1e1e;
}
.lang-dropdown::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 8px;
}