/* ==========================================================================
   Rätsel – Spielgefühl: Titelbild, Rang, Münzen, Trophäen, Vorspann
   ========================================================================== */

/* ---------- Titelbild ---------- */
.rt-title-screen {
    min-height: calc(100vh - var(--header-height) - 7rem); display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; gap: 0.6rem; position: relative;
}
.rt-title-screen::before {
    content: ''; position: absolute; inset: 6% 4%; border: 3px double #c9a766; border-radius: 28px; pointer-events: none;
    background: radial-gradient(ellipse at 50% 30%, rgba(255, 250, 230, 0.7), transparent 70%);
    z-index: -1;
}
.rt-title-hat { font-size: 5.5rem; line-height: 1; filter: drop-shadow(0 12px 14px rgba(60, 35, 10, 0.45)); animation: rtBob 4s ease-in-out infinite; }
.rt-title-pre { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.3em; color: var(--text-muted); font-weight: 700; }
.rt-title-big {
    font-family: var(--rt-serif); font-weight: 800; font-size: clamp(2.4rem, 9vw, 4.4rem); line-height: 1.05; letter-spacing: -0.01em;
    background: linear-gradient(180deg, #7c3f08, #3a2a14 70%); -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 2px 0 rgba(255, 245, 215, 0.6);
}
.rt-title-rank { margin-top: 0.4rem; color: var(--text-muted); }
.rt-title-rank b { color: var(--accent-amber); font-family: var(--rt-serif); font-size: 1.1rem; }
.rt-title-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-top: 1.6rem; }
.rt-btn.big { padding: 0.85rem 1.8rem; font-size: 1.1rem; border-radius: 14px; font-family: var(--rt-serif); }
.rt-pagebody .rt-btn:not(.primary) { background: #fff8e4; border: 2px solid #c9a766; color: #4a3517; box-shadow: 0 3px 0 #b7975a; }
.rt-pagebody .rt-btn:not(.primary):hover:not(:disabled) { background: #fffdf2; border-color: #a9833f; }
.rt-pagebody .rt-btn.ghost { background: transparent; box-shadow: none; border-style: dashed; }

/* ---------- Karte: Rang & Münzen ---------- */
.rt-rank { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; margin-top: 0.9rem; }
.rt-rank-name {
    font-family: var(--rt-serif); font-weight: 700; font-size: 1.25rem; padding: 0.15rem 1.1rem; border-radius: 999px; color: #2a1604;
    background: var(--rt-brass); box-shadow: 0 3px 10px rgba(180, 83, 9, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.rt-rank-next { font-size: 0.78rem; color: var(--text-muted); }
.rt-rank .rt-progress { width: min(320px, 80%); margin: 0; }
.rt-coinbadge { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--rt-serif); font-weight: 700; }
.rt-coinbadge .rt-coin { margin: 0; }
.rt-stat b .rt-coinbadge { font-size: 1.9rem; color: var(--accent-amber); }
.rt-bar-right { display: inline-flex; align-items: center; gap: 0.6rem; }
.rt-bar-right .rt-coinbadge { padding: 0.25rem 0.7rem; border-radius: 999px; background: #f8edd3; border: 1px solid #c9a766; font-size: 0.95rem; color: var(--text-main); }

/* ---------- Trophäen ---------- */
.rt-trophies { max-width: 640px; margin: 0 auto 1.4rem; background: var(--bg-surface); border: 2px solid var(--border-color-hover); border-radius: 16px; padding: 0.7rem 1rem; }
.rt-trophies summary { cursor: pointer; font-family: var(--rt-serif); font-weight: 700; font-size: 1.05rem; }
.rt-trophy-list { list-style: none; margin-top: 0.7rem; display: grid; gap: 0.35rem; font-size: 0.88rem; color: var(--text-muted); }
.rt-trophy-list li { display: flex; align-items: baseline; gap: 0.5rem; opacity: 0.65; }
.rt-trophy-list li.got { opacity: 1; color: var(--text-main); }
.rt-trophy-list li b { color: var(--text-main); }
.rt-trophy-list li span { font-size: 1.1rem; }

/* ---------- Kacheln erscheinen nacheinander ---------- */
.rt-tile { animation: rtTileIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes rtTileIn { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }

/* ---------- Spielansicht ---------- */
.rt-solved-tag { margin-left: 0.8rem; color: var(--accent-emerald); text-transform: none; letter-spacing: 0; font-weight: 700; }
.rt-speak { display: flex; align-items: flex-start; gap: 0.8rem; margin-bottom: 1.2rem; }
.rt-avatar {
    flex: none; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.9rem;
    background: radial-gradient(circle at 30% 25%, #fff8e4, #e8d3a0); border: 3px solid #b8945a; box-shadow: 0 4px 10px rgba(90, 60, 20, 0.3);
}
.rt-bubble {
    position: relative; flex: 1; margin: 0; padding: 0.9rem 1.1rem; border-radius: 6px 18px 18px 18px; background: #fffaf0;
    border: 2px solid #c9a766; box-shadow: 0 4px 12px rgba(90, 60, 20, 0.15);
}
.rt-bubble::before {
    content: ''; position: absolute; left: -10px; top: 14px; width: 16px; height: 16px; background: #fffaf0; transform: rotate(45deg);
    border-left: 2px solid #c9a766; border-bottom: 2px solid #c9a766;
}
.rt-bubble p:last-child { margin-bottom: 0; }
.rt-bubble.rt-text { margin-bottom: 0; }
@media (max-width: 520px) { .rt-avatar { width: 40px; height: 40px; font-size: 1.4rem; } .rt-speak { gap: 0.6rem; } }

/* Falsch / Richtig: Stempel über dem Rätsel, Wackeln */
.rt-stage.wrong { animation: rtWrong 0.45s; }
@keyframes rtWrong { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.rt-flash {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--rt-serif); font-weight: 800;
    font-size: 7rem; pointer-events: none; z-index: 30; animation: rtFlash 0.9s ease-out forwards; border-radius: 18px;
}
.rt-flash.bad { color: #be123c; background: rgba(190, 18, 60, 0.12); }
.rt-flash.good { color: #15803d; background: rgba(21, 128, 61, 0.12); }
@keyframes rtFlash { 0% { opacity: 0; transform: scale(0.4); } 25% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1); } }
.rt-stage.done > .rt-flash { opacity: 1; }

/* Münzen-Anzeige der Hinweis-Schaltfläche */
.rt-hintwrap .rt-btn .rt-coin { margin-right: 0.45rem; }
.rt-coin { font-family: var(--rt-serif); font-weight: 800; }

/* Ergebnis */
.rt-result-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 0.2rem; }
.rt-rbadge { padding: 0.15rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: #fff3c4; border: 1px solid #d9a21b; color: #6b4a06; }
.rt-rbadge.dim { background: rgba(255, 255, 255, 0.6); border-color: #b9c9a1; color: #55663a; font-weight: 600; }
.rt-rankup { margin: 0.7rem 0 0; font-family: var(--rt-serif); font-size: 1.15rem; color: #7c3f08; animation: rtPop 0.6s both 0.3s; }

/* Vorspann */
.rt-splash {
    position: fixed; inset: 0; z-index: 1900; display: flex; align-items: center; justify-content: center; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(50, 30, 10, 0.55), rgba(20, 12, 4, 0.8)); animation: rtSplash 1.5s ease both;
}
.rt-splash-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 1.6rem 2.6rem; text-align: center;
    background: linear-gradient(170deg, #fbf1d8, #efdcae); border: 4px double var(--tile-accent, #b8945a); border-radius: 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); color: #3a2a14; animation: rtSplashCard 1.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.rt-splash-no { font-size: 0.85rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--tile-accent, #92400e); font-weight: 800; }
.rt-splash-card b { font-family: var(--rt-serif); font-size: clamp(1.6rem, 6vw, 2.4rem); line-height: 1.1; }
.rt-splash-pic { font-weight: 700; color: #b45309; }
@keyframes rtSplash { 0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rtSplashCard { 0% { transform: scale(0.7) rotate(-3deg); opacity: 0; } 25% { transform: scale(1.04) rotate(0); opacity: 1; } 80% { transform: scale(1); } 100% { transform: scale(1.06); } }

/* Toasts */
.rt-toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 0.5rem; z-index: 2100; width: min(92vw, 380px); }
.rt-toast {
    display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 1rem; border-radius: 16px; background: linear-gradient(170deg, #fff6dc, #f0dca6);
    border: 3px solid #c58a1b; box-shadow: 0 12px 30px rgba(60, 35, 10, 0.4); color: #3a2a14; animation: rtToastIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rt-toast.out { animation: rtToastOut 0.5s both; }
.rt-toast-ico { font-size: 1.9rem; }
.rt-toast b { display: block; font-family: var(--rt-serif); }
.rt-toast span:not(.rt-toast-ico) { font-size: 0.85rem; color: #6b5428; }
@keyframes rtToastIn { from { opacity: 0; transform: translateY(30px) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes rtToastOut { to { opacity: 0; transform: translateY(20px); } }

/* Ton-Schalter */
.rt-sound {
    position: fixed; right: 16px; bottom: 16px; width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; z-index: 1500;
    background: #fff8e4; border: 2px solid #c9a766; box-shadow: 0 3px 0 #b7975a, 0 8px 18px rgba(60, 35, 10, 0.25); display: flex; align-items: center; justify-content: center;
}
.rt-sound:hover { background: #fffdf2; }

@media (prefers-reduced-motion: reduce) {
    .rt-title-hat, .rt-tile, .rt-splash, .rt-splash-card, .rt-flash, .rt-toast { animation: none; }
    .rt-splash { display: none; }
}
