:root {
    --primary-color: #FF9F1C;
    /* Orange */
    --secondary-color: #2EC4B6;
    /* Teal */
    --accent-color: #FFBF69;
    --background-color: #CBF3F0;
    --card-bg: #FFFFFF;
    --text-color: #333333;
    --font-main: 'Fredoka', 'Outfit', sans-serif;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.divider {
    width: 1px;
    height: 24px;
    background-color: #eee;
    margin: 0 4px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}

.user-profile.hidden {
    display: none;
}

#user-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary-color);
}

#user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.login-content {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.login-content h2 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 1.8rem;
}

.login-content p {
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Controls */
.icon-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--secondary-color);
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1) rotate(10deg);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
    width: auto;
    border-radius: 20px;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background: var(--primary-color);
    color: white;
}

.btn.secondary {
    background: var(--secondary-color);
    color: white;
    display: inline-block;
    text-align: center;
}

/* Word Container */
.word-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 300px;
}

.empty-state {
    text-align: center;
    margin-top: 50px;
    font-size: 1.2rem;
    color: #666;
}

.empty-state .small {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 8px;
}


/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus {
    border-color: var(--secondary-color);
    outline: none;
}

/* Word Cards */
.word-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 3px solid transparent;
    position: relative;
    cursor: default;
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.word-card.playing {
    border-color: var(--primary-color);
    background-color: #FFF8E7;
    transform: scale(1.02);
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.english-word {
    font-size: 2rem;
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    cursor: pointer;
}

.english-word:hover {
    text-decoration: underline;
}

.korean-meaning {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 12px;
}

.english-example {
    background: #F0F4F8;
    padding: 12px;
    border-radius: 12px;
    color: #444;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.english-example:hover {
    background: #E0E7EF;
}

.english-example i {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.card-controls {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.play-word-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.play-word-btn:hover {
    background: #25a094;
}

.delete-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
}

.delete-btn:hover {
    background: #fbecec;
}