:root { --primary: #6366f1; --primary-light: #eef2ff; --bg: #fcfcfd; --text: #1e293b; --text-light: #64748b; --border: #e2e8f0; --accent: #f43f5e; --white: #ffffff; --success: #10b981; --warning: #eab308; --shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02); }
* { box-sizing: border-box; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
body { font-family: 'Inter', sans-serif; margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
nav { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); padding: 1.2rem 5%; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 2000; border-bottom: 1px solid var(--border); }
.logo { font-weight: 900; font-size: 1.5rem; color: var(--primary); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-item { cursor: pointer; font-weight: 700; color: var(--text); padding: 8px 16px; border-radius: 12px; font-size: 1rem; position: relative; }
.nav-item:hover, .nav-item.active { color: var(--primary); }
.badge { position: absolute; top: 0px; right: -5px; background: var(--accent); color: white; font-size: 0.7rem; font-weight: 900; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; border: 2px solid white; padding: 0 4px; z-index: 10; animation: pop 0.3s ease-out; }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.user-nav { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; color: var(--text); padding: 6px 15px; border-radius: 20px; background: var(--white); border: 2px solid var(--border); transition: all 0.2s; }
.user-nav:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 4px 10px rgba(99,102,241,0.1); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 900;}
.auth-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 25px; }
.auth-tab { flex: 1; text-align: center; padding: 12px; cursor: pointer; font-weight: 800; color: var(--text-light); font-size: 1.1rem; }
.auth-tab.active { color: var(--primary); border-bottom: 3px solid var(--primary); margin-bottom: -2px; }
.role-selector { display: flex; gap: 15px; margin-bottom: 15px; }
.role-option { flex: 1; padding: 12px; text-align: center; border: 2px solid var(--border); border-radius: 15px; cursor: pointer; font-weight: 800; color: var(--text-light); }
.role-option.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.third-party-login { display: flex; gap: 15px; margin-top: 20px; }
.third-party-btn { flex: 1; padding: 12px; border: 2px solid var(--border); border-radius: 15px; text-align: center; cursor: pointer; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text); }
.third-party-btn:hover { background: var(--bg); border-color: #cbd5e1; }
.container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.hidden { display: none !important; }
.back-link { cursor: pointer; font-weight: 700; color: var(--primary); font-size: 1.1rem; display: inline-block; margin-bottom: 20px; }
.back-link:hover { text-decoration: underline; }
.hero-title { font-size: 2.8rem; font-weight: 900; margin-bottom: 40px; color: var(--text); letter-spacing: -1px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.hub-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.hub-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; } 
.main-card { background: var(--white); padding: 30px 20px; border-radius: 25px; border: 1px solid var(--border); cursor: pointer; text-align: center; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.main-card:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: 0 20px 40px -12px rgba(99,102,241,0.15); }
.card-icon { font-size: 50px; margin-bottom: 15px; display: block; }
.main-card h2 { margin: 0 0 8px 0; font-weight: 800; font-size: 1.3rem; }
.main-card p { color: var(--text-light); margin: 0; font-size: 0.9rem; line-height: 1.4; }
.srs-stat-box { background: var(--primary-light); padding: 20px; border-radius: 20px; text-align: center; border: 1px solid #c7d2fe; flex: 1; }
.srs-stat-num { font-size: 2.5rem; font-weight: 900; color: var(--primary); margin: 10px 0 0 0; }
.srs-stat-label { font-size: 1rem; color: var(--text-light); font-weight: 600; }
.msg-board { margin-top: 60px; background: var(--white); border-radius: 25px; padding: 40px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.msg-item { display: flex; gap: 15px; margin-bottom: 25px; padding-bottom: 25px; border-bottom: 1px dashed var(--border); position: relative; }
.msg-item.pinned { background: #fefce8; padding: 20px; border-radius: 15px; border: 1px solid #fef08a; border-left: 5px solid var(--warning); }
.msg-avatar { width: 45px; height: 45px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 900; flex-shrink: 0; }
.msg-content { flex: 1; }
.msg-header { display: flex; justify-content: space-between; margin-bottom: 8px; align-items: center; }
.msg-name { font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; }
.msg-time { font-size: 0.85rem; color: var(--text-light); }
.msg-text { color: var(--text); line-height: 1.6; font-size: 1.05rem; white-space: pre-wrap; }
.msg-admin-controls { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.chat-container { display: flex; flex-direction: column; gap: 15px; max-height: 350px; overflow-y: auto; padding: 15px; background: #f8fafc; border-radius: 15px; border: 1px solid var(--border); margin-bottom: 15px; }
.chat-bubble { max-width: 85%; padding: 12px 18px; border-radius: 18px; font-size: 0.95rem; line-height: 1.5; position: relative; word-break: break-word; }
.chat-left { align-self: flex-start; background: #e2e8f0; color: #1e293b; border-bottom-left-radius: 4px; }
.chat-right { align-self: flex-end; background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.chat-time { font-size: 0.75rem; opacity: 0.7; margin-top: 5px; text-align: right; }
.read-container { background: var(--white); padding: 40px; border-radius: 30px; border: 1px solid var(--border); box-shadow: var(--shadow); }
#read-display { font-size: 1.25rem; line-height: 2.2; color: #334155; padding: 20px; min-height: 300px; }
.read-word { cursor: pointer; border-radius: 4px; padding: 0 4px; border-bottom: 2px solid transparent; }
.read-word:hover { background: #eef2ff; color: var(--primary); border-bottom-color: var(--primary); }
.sub-line { padding: 8px 15px; border-radius: 12px; transition: all 0.3s ease; margin-bottom: 5px; font-size: 1.2rem; line-height: 1.8; color: var(--text-light); }
.sub-line.active-sub { color: var(--primary); font-weight: 800; background: var(--primary-light); transform: scale(1.02); margin-left: 10px; }
.l-quiz-q { font-weight: 800; margin-bottom: 15px; font-size: 1.2rem; color: var(--text); line-height: 1.5; }
.l-quiz-opt { display: flex; align-items: center; padding: 12px 15px; margin-bottom: 10px; border-radius: 12px; border: 2px solid var(--border); cursor: pointer; transition: all 0.2s; background: var(--bg); font-size: 1.05rem; }
.l-quiz-opt:hover { border-color: var(--primary); background: var(--primary-light); }
.l-quiz-opt input { margin-right: 12px; transform: scale(1.2); cursor: pointer; }
.l-quiz-exp { margin-top: 15px; font-size: 1rem; color: var(--text-light); background: #f8fafc; padding: 15px; border-radius: 12px; border-left: 5px solid var(--primary); display: none; line-height: 1.6; }
.cloze-input { border: none; border-bottom: 2px solid var(--border); background: #f8fafc; font-family: inherit; font-size: 1.2rem; color: var(--primary); min-width: 80px; text-align: center; padding: 4px; margin: 0 5px; border-radius: 6px 6px 0 0; outline: none; transition: all 0.3s; font-weight: 700; }
.cloze-input:focus { border-bottom-color: var(--primary); background: #eef2ff; }
.cloze-input.correct { border-bottom-color: var(--success); color: var(--success); background: #ecfdf5; }
.cloze-input.wrong { border-bottom-color: var(--accent); color: var(--accent); background: #fff1f2; text-decoration: line-through; }
.cloze-ans { font-weight: 800; color: var(--success); margin-left: 5px; font-size: 1.1rem; }
.sortable-item { padding: 15px 20px; margin-bottom: 12px; background: var(--white); border: 2px solid var(--border); border-radius: 12px; cursor: grab; font-size: 1.1rem; line-height: 1.5; color: var(--text); box-shadow: 0 2px 4px rgba(0,0,0,0.02); display: flex; align-items: center; transition: transform 0.2s; }
.sortable-item:active { cursor: grabbing; transform: scale(0.98); border-color: var(--primary); }
.vocab-tag { padding: 8px 18px; background: var(--primary-light); color: var(--primary); border-radius: 20px; font-weight: 800; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; font-size: 1.05rem; }
.vocab-tag:hover { background: var(--primary); color: white; transform: scale(1.05); box-shadow: 0 4px 10px rgba(99,102,241,0.3); }
.vocab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.vocab-header h1 { font-size: 2.2rem; font-weight: 900; margin: 0; }
.word-item { background: var(--white); padding: 25px 30px; border-radius: 20px; border: 1px solid var(--border); margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.word-en-def { color: var(--text-light); font-size: 0.95rem; background: var(--bg); padding: 12px 15px; border-radius: 12px; margin-top: 10px; line-height: 1.5; }
.group-header { margin: 30px 0 15px 0; padding-left: 15px; border-left: 5px solid var(--primary); font-size: 1.4rem; font-weight: 900; color: var(--text); }
.game-stage { background: var(--white); border-radius: 30px; padding: 40px; border: 2px solid var(--border); min-height: 500px; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; position: relative; overflow: hidden; }
.match-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; width: 100%; }
.match-card { background: var(--white); border: 2px solid var(--border); border-radius: 15px; padding: 20px; text-align: center; cursor: pointer; font-weight: 700; font-size: 1.1rem; }
.match-card.selected { border-color: var(--primary); background: #eef2ff; color: var(--primary); }
.memory-card { height: 100px; perspective: 1000px; cursor: pointer; }
.memory-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.6s; transform-style: preserve-3d; }
.memory-card.flipped .memory-inner { transform: rotateY(180deg); }
.memory-card.matched { opacity: 0; pointer-events: none; transition: opacity 0.5s; }
.memory-front, .memory-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-weight: 700; border: 2px solid var(--border); }
.memory-front { background: var(--primary); color: var(--primary); }
.memory-back { background: var(--white); transform: rotateY(180deg); color: var(--text); }
.mole-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; max-width: 500px; }
.hole { background: #cbd5e1; height: 110px; border-radius: 20px; position: relative; overflow: hidden; border: 4px solid #94a3b8; }
.mole { position: absolute; bottom: -100%; width: 100%; height: 100%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; transition: 0.2s; cursor: pointer; }
.mole.up { bottom: 0; }
.balloon-area { position: absolute; inset: 0; pointer-events: none; }
.balloon { position: absolute; bottom: -100px; padding: 15px 25px; background: var(--primary); color: white; border-radius: 50px; font-weight: bold; cursor: pointer; pointer-events: auto; animation: floatUp linear forwards; }
@keyframes floatUp { to { bottom: 120%; } }
.type-word { position: absolute; top: -50px; font-size: 2rem; font-weight: 900; color: var(--accent); transition: top 0.1s linear; }
.quiz-option { width: 100%; padding: 15px; margin-bottom: 10px; border: 2px solid var(--border); border-radius: 15px; font-size: 1.2rem; font-weight: 600; cursor: pointer; background: var(--white); }
.quiz-option:hover { background: #eef2ff; border-color: var(--primary); }
.box-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; max-width: 600px; }
.blind-box { background: var(--primary); color: white; height: 120px; display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 900; border-radius: 20px; cursor: pointer; }
.blind-box.opened { background: #eef2ff; color: var(--primary); font-size: 1.2rem; cursor: default; border: 2px solid var(--primary); }
.anagram-tile { display: inline-block; padding: 15px 25px; margin: 5px; font-size: 1.5rem; font-weight: 800; background: var(--white); border: 2px solid var(--border); border-radius: 15px; cursor: pointer; }
.anagram-tile:hover { transform: scale(1.1); border-color: var(--primary); }
.keyboard { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 20px; }
.key-btn { padding: 10px 15px; font-weight: 700; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; background: white; }
.key-btn.disabled { opacity: 0.5; pointer-events: none; background: #e2e8f0; }
.wheel-display { font-size: 3rem; font-weight: 900; padding: 40px; border-radius: 50%; background: var(--primary-light); color: var(--primary); width: 250px; height: 250px; display: flex; align-items: center; justify-content: center; margin-bottom: 30px; transition: transform 0.1s; }
.btn { background: var(--primary); color: white; padding: 14px 28px; border: none; border-radius: 16px; font-weight: 700; cursor: pointer; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn:hover { transform: scale(1.03); filter: brightness(1.1); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
input[type="text"], input[type="password"], textarea, select, input[type="date"] { width: 100%; border: 2px solid var(--border); border-radius: 15px; padding: 15px; font-family: inherit; font-size: 1.1rem; outline: none; resize: none; margin-bottom: 15px; box-sizing: border-box; transition: border-color 0.2s; }
input[type="date"] { border-radius: 8px; border: 2px solid var(--border); outline: none; transition: 0.2s; font-family: inherit; }
input[type="date"]:focus { border-color: var(--primary); }
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.modal { background: var(--white); padding: 40px; border-radius: 30px; width: 100%; max-width: 450px; box-shadow: var(--shadow); position: relative; margin: auto; max-height: 90vh; overflow-y: auto; }
#api-loading { position: fixed; inset: 0; background: rgba(255,255,255,0.85); z-index: 10001; display: none; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; color: var(--primary); font-size: 1.2rem; backdrop-filter: blur(4px); }
.modal-close-btn { position: absolute; top: 15px; right: 20px; font-size: 2rem; cursor: pointer; color: var(--text-light); transition: color 0.2s; line-height: 1; }
.modal-close-btn:hover { color: var(--accent); }
@keyframes pulse-btn { 0% { transform: scale(1); box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2); } 50% { transform: scale(1.02); box-shadow: 0 15px 25px -5px rgba(16, 185, 129, 0.5); } 100% { transform: scale(1); box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2); } }
.btn-guest { animation: pulse-btn 2.5s infinite; background: var(--success); color: white; border: none; padding: 18px; border-radius: 16px; width: 100%; font-size: 1.15rem; font-weight: 900; cursor: pointer; transition: all 0.3s; margin-bottom: 25px; }
.btn-guest:hover { transform: scale(1.04); filter: brightness(1.1); animation: none; }