:root { --bg-color: #1a1a1a; --paper-color: #fdfbf7; --line-color: #a3c4f3; --margin-line: #ff9999; --text-blue: #0033cc; --text-green: #2ecc71; --text-orange: #f39c12; }
body, html { margin: 0; padding: 0; height: 100%; background-color: var(--bg-color); font-family: 'Segoe UI', sans-serif; display: flex; justify-content: center; align-items: center; overflow: hidden; color: white; -webkit-tap-highlight-color: transparent; }
.view { display: none; width: 100%; height: 100%; flex-direction: column; justify-content: center; align-items: center; position: absolute; top: 0; left: 0; }
.view.active { display: flex; }
.panel { background: #2a2a2a; padding: 40px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); text-align: center; max-width: 600px; width: 90%; max-height: 95vh; overflow-y: auto; box-sizing: border-box; }
.panel h1 { font-family: 'Coiny', cursive; font-size: clamp(2rem, 5vw, 2.6rem); color: #4facfe; margin-top: 0; text-shadow: 2px 2px 0px #000; }
.input-group { margin-bottom: 20px; text-align: left; }
.input-group label { display: block; margin-bottom: 5px; color: #ccc; }
.input-group input { width: 100%; padding: 12px; border: 2px solid #444; border-radius: 10px; background: #111; color: white; font-size: 1.1rem; box-sizing: border-box; outline: none; }
.input-group input:focus { border-color: #4facfe; }
.btn { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: #000; border: none; padding: 15px 30px; font-size: 1.2rem; font-family: 'Coiny', cursive; border-radius: 15px; cursor: pointer; width: 100%; margin-bottom: 10px; box-shadow: 0 4px 0 #0081a7; transition: transform 0.2s; }
.btn:hover { transform: scale(1.03); }
.btn-test { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); box-shadow: 0 4px 0 #d35400; margin-top: 20px; }
.toggle-link { color: #888; cursor: pointer; font-size: 0.9rem; text-decoration: underline; display: block; margin-top: 15px; }
.error-msg { color: #ff4757; margin-bottom: 15px; font-size: 1rem; display: none; font-weight: bold; }
.global-score-badge { background: linear-gradient(135deg, #fff3b0 0%, #fde073 100%); color: #000; padding: 15px; border-radius: 20px; margin-bottom: 20px; font-size: clamp(1rem, 3.5vw, 1.3rem); font-family: 'Coiny', cursive; box-shadow: 0 6px 15px rgba(241, 196, 15, 0.3), 0 6px 0 #d4ac0d; display: flex; justify-content: center; align-items: center; }

.age-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 20px 0; }
.age-btn { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; padding: 20px 15px; font-family: 'Coiny', cursive; border-radius: 20px; cursor: pointer; transition: transform 0.2s; box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4), 0 6px 0 #4338ca; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.age-btn:hover { transform: scale(1.03); filter: brightness(1.1); }
.age-btn .age-emoji { font-size: 2rem; }
.age-btn .age-label { font-size: 1.15rem; }
.age-btn.selected { outline: 4px solid #f1c40f; transform: scale(1.05); }
.age-btn.age-6-8 { background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%); color: #000; box-shadow: 0 6px 15px rgba(132, 250, 176, 0.4), 0 6px 0 #059669; }
.age-btn.age-8-10 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: #000; box-shadow: 0 6px 15px rgba(79, 172, 254, 0.4), 0 6px 0 #0284c7; }
.age-btn.age-ado { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); color: white; box-shadow: 0 6px 15px rgba(161, 140, 209, 0.4), 0 6px 0 #7e57c2; }
.age-btn.age-adulte { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; box-shadow: 0 6px 15px rgba(245, 87, 108, 0.4), 0 6px 0 #be185d; }

.mode-btn { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: #000; border: none; padding: 18px; font-size: clamp(1.2rem, 4vw, 1.5rem); font-family: 'Coiny', cursive; border-radius: 20px; cursor: pointer; transition: transform 0.2s; box-shadow: 0 6px 15px rgba(79, 172, 254, 0.4), 0 6px 0 #0284c7; display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 12px; width: 100%; }
.mode-btn:hover { transform: scale(1.03); filter: brightness(1.1); }
.mode-btn.mode-syn { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); box-shadow: 0 6px 15px rgba(67, 233, 123, 0.4), 0 6px 0 #059669; }
.mode-btn.mode-err { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); box-shadow: 0 6px 15px rgba(255, 154, 158, 0.4), 0 6px 0 #c0392b; }

#dictee-layout { display: flex; flex-direction: row; width: 100%; height: 100%; max-width: 1200px; padding: 20px; box-sizing: border-box; gap: 20px; }
#left-sidebar { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; width: 180px; flex-shrink: 0; padding-top: 20px; gap: 15px; }
#btn-quit { background: transparent; border: 3px solid #ff4757; color: #ff4757; padding: 10px 20px; border-radius: 10px; cursor: pointer; font-weight: bold; font-family: 'Coiny', cursive; font-size: 1.2rem; width: 100%; transition: all 0.2s; }
#btn-quit:hover { background: #ff4757; color: white; transform: scale(1.05); }
#timer { font-size: 2.5rem; color: #00f2fe; font-family: 'Coiny', cursive; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
#timer.over { color: #ff4757; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

#btn-replay { background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); color: #000; border: none; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-family: 'Coiny', cursive; font-size: 0.95rem; width: 100%; box-shadow: 0 4px 0 #d97706; transition: transform 0.2s; }
#btn-replay:hover { transform: scale(1.05); }
#btn-replay:active { transform: translateY(2px); box-shadow: 0 2px 0 #d97706; }

#grade-widget { background: rgba(255,255,255,0.1); border: 2px dashed #aaa; padding: 10px; border-radius: 15px; text-align: center; cursor: pointer; transition: transform 0.2s; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 5px; }
#grade-widget:hover { transform: scale(1.05); background: rgba(255,255,255,0.15); border-color: #fff; }
.rank-intro { font-family: 'Coiny', cursive; font-size: 0.9rem; color: #fdfbf7; margin-bottom: 5px; opacity: 0.8; }
.grade-hint { opacity: 0.3; transform: scale(0.6); pointer-events: none; }
.grade-hint img { width: 50px; height: 50px; object-fit: contain; }
.grade-current { display: flex; flex-direction: column; align-items: center; }
.grade-current img { width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.5)); }
#grade-name { color: #fff; font-family: 'Caveat', cursive; font-size: 1.4rem; margin-top: 5px; line-height: 1.2; }

#game-container { flex: 1 1 0; background-color: var(--paper-color); background-image: linear-gradient(var(--line-color) 1px, transparent 1px); background-size: 100% 40px; background-position: 0 40px; background-attachment: local; position: relative; box-shadow: 0 0 20px rgba(0,0,0,0.5); border-radius: 5px; overflow-y: auto; overflow-x: hidden; padding-bottom: 150px; }
.sheet-decorations { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 0; overflow: visible; }
.header-margin-top { height: 80px; width: 100%; position: relative; }
.lines { display: none; } 
.margin { position: absolute; top: 0; left: 80px; bottom: -5000px; width: 2px; background-color: var(--margin-line); z-index: 2; }
.holes { position: absolute; top: 0; left: 25px; bottom: 0; display: flex; flex-direction: column; justify-content: space-around; z-index: 3; }
.hole { width: 20px; height: 20px; background-color: var(--bg-color); border-radius: 50%; box-shadow: inset 2px 2px 5px rgba(0,0,0,0.5); }

#narrator-tag { position: absolute; top: 15px; right: 40px; background-color: #f1c40f; color: #000; padding: 10px 15px; font-family: 'Caveat', cursive; font-size: 1.1rem; box-shadow: 2px 4px 6px rgba(0,0,0,0.3); transform: rotate(2deg); z-index: 10; border-bottom-right-radius: 20px 5px; cursor: pointer; }
#narrator-tag:hover { background-color: #f39c12; }

#countdown-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: transparent; display: none; justify-content: center; align-items: center; z-index: 200; }
#countdown-number { font-family: 'Coiny', cursive; font-size: clamp(8rem, 15vw, 15rem); color: #e74c3c; font-weight: normal; text-shadow: 4px 6px 10px rgba(0,0,0,0.3); text-align: center; animation: popIn 0.8s ease-in-out infinite alternate; }
@keyframes popIn { from { transform: scale(0.9); opacity: 0.8; } to { transform: scale(1.1); opacity: 1; } }

#text-container { position: relative; z-index: 5; padding: 0px 40px 0px 100px; font-family: 'Caveat', cursive; font-size: 2.2rem; line-height: 40px; color: var(--text-blue); min-height: 200px; }
.dictee-title { font-size: 2.6rem; font-weight: bold; text-decoration: underline; color: #002080; line-height: 40px; }
.past-text { color: #666; transition: color 0.5s; }
.current-word { display: inline-block; min-width: 80px; border-bottom: 2px dashed var(--text-blue); margin: 0 5px; text-align: center; }
.correct-first { color: var(--text-green); font-weight: bold; }
.correct-after { color: var(--text-orange); font-weight: bold; text-decoration: underline wavy; }

#qcm-container { display: none; justify-content: center; flex-wrap: wrap; gap: 15px; margin: 10px 0 20px 80px; position: relative; z-index: 10; }
.qcm-btn { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); color: #fff; border: none; padding: 15px 30px; font-size: 2rem; font-family: 'Caveat', cursive; border-radius: 30px; cursor: pointer; box-shadow: 0 8px 15px rgba(161, 140, 209, 0.4), inset 0 2px 4px rgba(255,255,255,0.4); text-shadow: 1px 1px 2px rgba(0,0,0,0.2); transition: transform 0.2s; user-select: none; }
.qcm-btn:nth-child(2) { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.qcm-btn:nth-child(3) { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.qcm-btn:nth-child(4) { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.qcm-btn:hover:not(:disabled) { transform: scale(1.1); }
.qcm-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#postit-modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-2deg); background-color: #f1c40f; padding: 30px; width: 90%; max-width: 380px; box-shadow: 5px 10px 15px rgba(0,0,0,0.5); z-index: 1000; color: #000; font-family: 'Caveat', cursive; font-size: 1.9rem; border-bottom-right-radius: 40px 5px; box-sizing: border-box; }
#postit-modal h3 { margin-top: 0; color: #d35400; font-family: 'Coiny', cursive; font-size: 1.4rem; }
.close-btn { background: transparent; border: 3px solid #d35400; color: #d35400; font-family: 'Coiny', cursive; font-size: 1.1rem; padding: 10px 20px; cursor: pointer; margin-top: 20px; border-radius: 10px; transition: all 0.2s; }
.close-btn:hover { background: #d35400; color: #fff; }

.stamps-zone { display: flex; justify-content: space-around; align-items: center; flex-wrap: wrap; padding: 20px 10px; margin-top: 20px; margin-left: 80px; min-height: 120px; position: relative; z-index: 5; gap: 20px; }
.stamp { display: none; font-family: 'Caveat', cursive; font-weight: bold; padding: 10px 20px; border: 4px solid; border-radius: 10px; opacity: 0; filter: drop-shadow(4px 4px 5px rgba(0,0,0,0.3)); background: rgba(253, 251, 247, 0.6); }
@keyframes stampAnim { 0% { transform: scale(3); opacity: 0; } 50% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1) rotate(var(--rot)); opacity: 0.9; } }
.stamp.show { display: inline-block; animation: stampAnim 0.5s forwards ease-in-out; }
#stamp-fautes { color: #2980b9; border-color: #2980b9; --rot: -5deg; }
#stamp-note { color: #c0392b; border-color: #c0392b; border-radius: 50%; width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; --rot: 8deg; }
#stamp-app { color: #27ae60; border-color: #27ae60; border-radius: 50% / 30%; --rot: -3deg; }

#postits-recap { display: none; margin: 20px 20px 20px 100px; padding: 15px; background: rgba(241, 196, 15, 0.08); border: 3px dashed #f39c12; border-radius: 12px; position: relative; z-index: 5; }
#postits-recap h3 { font-family: 'Coiny', cursive; color: #d35400; margin: 0 0 15px 0; font-size: 1.4rem; text-align: center; }
#postits-recap .postits-hint { font-family: 'Caveat', cursive; color: #8e44ad; text-align: center; font-size: 1.1rem; margin: -10px 0 15px 0; opacity: 0.8; }
.postits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 15px; }
.postit-item { background: #f1c40f; color: #000; padding: 15px; font-family: 'Caveat', cursive; font-size: 1.3rem; box-shadow: 4px 6px 10px rgba(0,0,0,0.3); border-bottom-right-radius: 30px 5px; transform: rotate(-1deg); transition: transform 0.2s, box-shadow 0.2s; line-height: 1.3; user-select: none; border: none; text-align: left; width: 100%; box-sizing: border-box; position: relative; }
.postit-item:nth-child(even) { transform: rotate(1.5deg); background: #f4d03f; }
.postit-item:nth-child(3n) { transform: rotate(-2deg); background: #f7dc6f; }
.postit-item:hover { transform: rotate(0deg) scale(1.03); box-shadow: 6px 8px 15px rgba(0,0,0,0.4); }
.postit-item.speaking { background: #e67e22; animation: pulsePostit 0.8s infinite; }
@keyframes pulsePostit { 0%,100% { box-shadow: 0 0 0 0 rgba(230,126,34,0.7); } 50% { box-shadow: 0 0 0 12px rgba(230,126,34,0); } }
.postit-item .postit-word { font-weight: bold; color: #d35400; font-size: 1.6rem; display: block; margin-bottom: 6px; text-decoration: underline; }
.postit-item .postit-explain { font-size: 1.25rem; display: block; }
.postit-item .postit-play-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.15); border: 2px solid #d35400; color: #d35400; padding: 6px 14px; border-radius: 20px; font-family: 'Coiny', cursive; font-size: 0.95rem; cursor: pointer; margin-top: 10px; transition: all 0.2s; }
.postit-item .postit-play-btn:hover { background: #d35400; color: #fff; }
.postit-item.speaking .postit-play-btn { background: #d35400; color: #fff; }

#end-actions { display: none; justify-content: center; gap: 20px; padding: 20px 20px 60px 80px; position: relative; z-index: 5; flex-wrap: wrap; }
.end-btn { padding: 15px 30px; font-size: clamp(1.1rem, 3vw, 1.4rem); font-family: 'Coiny', cursive; border-radius: 15px; cursor: pointer; border: none; box-shadow: 0 5px 0 rgba(0,0,0,0.2), 0 10px 15px rgba(0,0,0,0.2); transition: transform 0.2s; }
.end-btn:hover { transform: scale(1.05) translateY(-2px); }
.end-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.2); }
#btn-next { background: #2ecc71; color: white; box-shadow: 0 5px 0 #27ae60, 0 10px 15px rgba(0,0,0,0.2); }
#btn-redo { background: #f39c12; color: white; box-shadow: 0 5px 0 #d35400, 0 10px 15px rgba(0,0,0,0.2); }
#btn-home { background: #34495e; color: white; box-shadow: 0 5px 0 #2c3e50, 0 10px 15px rgba(0,0,0,0.2); }

#tree-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2000; justify-content: center; align-items: center; flex-direction: column; }
#tree-container { width: 90%; max-width: 500px; height: 80vh; background: #2a2a2a; border-radius: 20px; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; border: 4px solid #4facfe; box-sizing: border-box; }
.tree-node { display: flex; align-items: center; background: #111; padding: 15px; border-radius: 15px; gap: 20px; border: 2px solid transparent; transition: all 0.3s; }
.tree-node.unlocked { border-color: #2ecc71; background: rgba(46, 204, 113, 0.1); }
.tree-node.locked { opacity: 0.5; filter: grayscale(100%); }
.tree-node img { width: 60px; height: 60px; object-fit: contain; }
.tree-info { flex-grow: 1; text-align: left; }
.tree-name { font-family: 'Caveat', cursive; font-size: 1.8rem; color: white; }
.tree-pts { font-family: 'Coiny', cursive; font-size: 1rem; color: #4facfe; }
#close-tree-btn { background: #ff4757; color: white; border: none; padding: 10px 30px; font-family: 'Coiny', cursive; font-size: 1.2rem; border-radius: 10px; margin-top: 20px; cursor: pointer; }

#mistakes-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2100; justify-content: center; align-items: center; flex-direction: column; padding: 20px; box-sizing: border-box; }
#mistakes-container { width: 90%; max-width: 700px; max-height: 80vh; background: #2a2a2a; border-radius: 20px; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; border: 4px solid #ff9a9e; box-sizing: border-box; }
#mistakes-container h2 { font-family: 'Coiny', cursive; color: #ff9a9e; margin: 0 0 10px 0; text-align: center; }
.mistake-item { background: #1a1a1a; border-left: 5px solid #ff4757; padding: 12px 15px; border-radius: 8px; text-align: left; color: #eee; }
.mistake-item .mistake-word { font-family: 'Caveat', cursive; font-size: 1.8rem; color: #f39c12; font-weight: bold; }
.mistake-item .mistake-explain { font-size: 0.95rem; color: #bbb; margin-top: 4px; }
.mistake-item .mistake-meta { font-size: 0.75rem; color: #666; margin-top: 6px; font-style: italic; }
.mistake-empty { text-align: center; color: #888; font-size: 1.2rem; padding: 30px 10px; font-family: 'Caveat', cursive; }
.mistake-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; }
.mistake-actions button { padding: 15px 25px; font-family: 'Coiny', cursive; border: none; border-radius: 12px; cursor: pointer; font-size: 1rem; }
#btn-close-mistakes { background: #ff4757; color: white; }
#btn-clear-mistakes { background: #555; color: #fff; }
#mistakes-badge { background: #ff4757; color: white; border-radius: 50%; min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-family: 'Coiny', cursive; margin-left: 8px; padding: 0 6px; }

#info-modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-1.5deg); background-color: #f1c40f; padding: 30px; width: 90%; max-width: 420px; box-shadow: 6px 12px 20px rgba(0,0,0,0.55); z-index: 3000; color: #000; font-family: 'Caveat', cursive; font-size: 1.7rem; border-bottom-right-radius: 40px 5px; border-top-left-radius: 15px; box-sizing: border-box; text-align: center; }
#info-modal h3 { margin: 0 0 15px 0; color: #d35400; font-family: 'Coiny', cursive; font-size: 1.4rem; }
#info-modal p { margin: 0; line-height: 1.3; white-space: pre-line; }
#info-modal .info-buttons { display: flex; justify-content: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
#info-modal .info-btn { background: transparent; border: 3px solid #d35400; color: #d35400; font-family: 'Coiny', cursive; font-size: 1rem; padding: 8px 20px; cursor: pointer; border-radius: 10px; transition: all 0.2s; }
#info-modal .info-btn:hover { background: #d35400; color: #fff; }
#info-modal .info-btn.confirm { border-color: #c0392b; color: #c0392b; }
#info-modal .info-btn.confirm:hover { background: #c0392b; color: #fff; }
#info-modal .info-btn.cancel { border-color: #7f8c8d; color: #7f8c8d; }
#info-modal .info-btn.cancel:hover { background: #7f8c8d; color: #fff; }

#postit-cascade { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-2deg); background-color: #f1c40f; padding: 30px; width: 90%; max-width: 420px; box-shadow: 6px 12px 25px rgba(0,0,0,0.55); z-index: 2500; color: #000; font-family: 'Caveat', cursive; border-bottom-right-radius: 40px 5px; box-sizing: border-box; text-align: center; }
#postit-cascade .postit-cascade-progress { font-family: 'Coiny', cursive; font-size: 0.95rem; color: #7f8c8d; margin-bottom: 15px; }
#postit-cascade .postit-cascade-word { font-family: 'Caveat', cursive; font-size: 2.5rem; color: #d35400; font-weight: bold; text-decoration: underline; display: block; margin-bottom: 10px; }
#postit-cascade .postit-cascade-explain { font-size: 1.6rem; line-height: 1.3; display: block; margin-bottom: 20px; }
#postit-cascade .postit-cascade-buttons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
#postit-cascade .pca-btn { background: transparent; border: 3px solid #d35400; color: #d35400; font-family: 'Coiny', cursive; font-size: 1rem; padding: 10px 20px; cursor: pointer; border-radius: 10px; transition: all 0.2s; }
#postit-cascade .pca-btn:hover { background: #d35400; color: #fff; }
#postit-cascade .pca-btn.pca-play { border-color: #8e44ad; color: #8e44ad; }
#postit-cascade .pca-btn.pca-play:hover { background: #8e44ad; color: #fff; }

#syno-container { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 20px; box-sizing: border-box; gap: 25px; }
#syno-header { text-align: center; }
#syno-progress { font-family: 'Coiny', cursive; color: #00f2fe; font-size: 1.3rem; margin-bottom: 10px; }
#syno-word-box { background: #fdfbf7; padding: 30px 50px; border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.4); }
#syno-word { font-family: 'Caveat', cursive; font-size: clamp(3rem, 10vw, 5rem); color: #0033cc; font-weight: bold; }
#syno-question { font-family: 'Coiny', cursive; color: #4facfe; font-size: 1.4rem; margin-top: 10px; }
#syno-options { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; max-width: 800px; }
.syno-btn { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; padding: 30px 20px; font-size: 2rem; font-family: 'Caveat', cursive; border-radius: 20px; cursor: pointer; box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4), 0 6px 0 #4338ca; transition: transform 0.2s; min-height: 90px; }
.syno-btn:hover:not(:disabled) { transform: scale(1.05); }
.syno-btn:disabled { cursor: not-allowed; }
.syno-btn.bonne { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); box-shadow: 0 6px 0 #059669, 0 0 25px rgba(67,233,123,0.8); color: #000; transform: scale(1.05); }
.syno-btn.mauvaise { background: linear-gradient(135deg, #ff4757 0%, #c0392b 100%); box-shadow: 0 6px 0 #7f1d1d, 0 0 25px rgba(255,71,87,0.8); }
#syno-timer { font-size: 2rem; color: #00f2fe; font-family: 'Coiny', cursive; }
#syno-timer.over { color: #ff4757; }

@media (max-width: 768px) {
    #dictee-layout { flex-direction: column; padding: 10px; gap: 10px; }
    
    #left-sidebar { 
        width: 100%; 
        display: grid; 
        grid-template-columns: 1fr auto 1fr; 
        align-items: center; 
        padding-top: 5px; 
        border-bottom: 2px dashed #444; 
        padding-bottom: 10px; 
        gap: 10px; 
    }
    
    #btn-quit { width: 100%; padding: 10px 5px; font-size: 1rem; margin: 0; box-sizing: border-box; }
    #timer { font-size: 1.8rem; margin: 0; text-align: center; }
    #btn-replay { width: 100%; padding: 10px 5px; font-size: 0.85rem; margin: 0; box-sizing: border-box; }
    
    #grade-widget { 
        grid-column: 1 / -1; 
        display: flex; flex-direction: row; padding: 5px 10px; width: 100%; gap: 10px; 
        background: rgba(255,255,255,0.1); border-radius: 10px; flex-wrap: wrap; 
        justify-content: center; align-items: center; box-sizing: border-box;
    }
    .rank-intro { width: 100%; text-align: center; font-size: 0.9rem; margin-bottom: 2px; }
    .grade-hint { display: none; }
    .grade-current { flex-direction: row; gap: 12px; align-items: center; }
    
    .grade-current img { width: 55px; height: 55px; } 
    #grade-name { font-size: 1.2rem; margin-top: 0; }
    
    .margin { left: 45px; }
    .holes { left: 10px; }
    #text-container { padding: 0 10px 0 55px; font-size: 1.8rem; line-height: 40px; }
    .dictee-title { font-size: 2.2rem; line-height: 40px; }
    #qcm-container { margin-left: 55px; }
    .qcm-btn { font-size: 1.5rem; padding: 10px 20px; }
    #narrator-tag { font-size: 0.9rem; padding: 5px 10px; right: 10px; }
    .stamps-zone { margin-left: 55px; margin-top: 20px; gap: 15px; flex-wrap: wrap; }
    #postits-recap { margin: 20px 10px 20px 55px; }
    #end-actions { padding: 20px 10px 60px 55px; }
    #syno-options { grid-template-columns: 1fr; }
    #syno-word-box { padding: 20px 25px; }
    .syno-btn { font-size: 1.6rem; padding: 20px 15px; }
}