/* ==== Seite: highscore-panel (hs) ==== */

/* Karten-Stil passend zum Main-Card */
 .hs-panel {
    margin: 0 0 25px 0;
    background: linear-gradient(135deg, #f0f3ff 0%, #f8f9ff 100%);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.10);
    padding: 10px;
    overflow: hidden;
}

.hs-head {
    display: flex;
}

.hs-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 16px;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
}

.hs-toggle > i:first-child {
    color: var(--c-accent);
    font-size: 1.15em;
}

.hs-chev {
    margin-left: 6px;
    transition: transform 0.25s ease;
    color: #999;
}

.hs-chev-open {
    transform: rotate(180deg);
}

.hs-body {
    padding: 6px 12px 14px 12px;
}

.hs-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 10px 4px;
}

 .hs-board-title {
    font-size: 13px;
    font-weight: 600;
    color: #7a7a90;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.hs-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    font-size: 0.95em;
    text-decoration: none;
}

.hs-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

.hs-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hs-btn-sm {
    padding: 7px 12px;
    font-size: 0.85em;
}

.hs-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hs-row {
    display: grid;
    grid-template-columns: 42px 1fr 90px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.07);
    box-shadow: inset 3px 0 0 #aeb4e5;
    transition: background 0.2s;
}

/* Rang 1: goldener Hintergrund + Gold-Rand; restliche Reihen blau mit hellblauem Rand */
.hs-row:first-child {
    background: rgba(245, 179, 1, 0.18);
    box-shadow: inset 3px 0 0 #f5b301;
}

.hs-row:hover {
    background: rgba(102, 126, 234, 0.14);
}

.hs-row:first-child:hover {
    background: rgba(245, 179, 1, 0.28);
}

/* Findehilfe: eigene Zeile nur leicht blaeulich (kein Gold) */
.hs-row.hs-me {
    background: rgba(102, 126, 234, 0.14);
}

.hs-row.hs-me:hover {
    background: rgba(102, 126, 234, 0.2);
}

.hs-rank {
    font-weight: 800;
    color: var(--c-accent);
    text-align: center;
}

.hs-row:first-child .hs-rank {
    color: #f5b301;
}

.hs-rank-cup {
    color: #f5b301;
}

.hs-rank-cup i {
    font-size: 1.05em;
}

.hs-name {
    font-weight: 600;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Badge-Icons hinter dem Namen in der Bestenliste */
.hs-badges {
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    vertical-align: middle;
}

.hs-badge-ic {
    font-size: 0.85em;
    color: var(--c-accent);
}

/* Fortschritts-Tooltip fuer das Badge */
.hs-badge-tip {
    position: fixed;
    z-index: 300;
    left: var(--tip-left, -9999px);
    top: var(--tip-top, -9999px);
    min-width: 190px;
    max-width: 260px;
    padding: 11px 14px;
    background: rgba(24, 24, 50, 0.97);
    color: #fff;
    border: 1px solid rgba(102, 126, 234, 0.5);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    pointer-events: none;
    font-size: 0.85em;
}

.hs-badge-tip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hs-badge-tip-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hs-badge-tip-head i {
    color: var(--c-accent);
    font-size: 1.1em;
}

.hs-badge-tip-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 7px;
}

.hs-badge-tip-fill {
    height: 100%;
    width: var(--hs-fill, 0%);
    background: linear-gradient(90deg, #667eea, #a855f7);
    border-radius: 4px;
    transition: width 0.4s;
}

.hs-badge-tip-meta {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.35;
}

body.dark-theme .hs-badge-tip {
    background: rgba(16, 18, 36, 0.98);
    border-color: rgba(168, 168, 220, 0.3);
}

.hs-score {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--c-text);
}

.hs-badge {
    color: var(--c-accent);
    font-size: 0.85em;
    margin-left: 6px;
}

.hs-empty {
    color: var(--c-muted);
    font-size: 0.92em;
    padding: 14px 6px;
    text-align: center;
}

.hs-settings {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(102, 126, 234, 0.18);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.hs-pin-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(102, 126, 234, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--c-text);
    font-size: 0.95em;
    font-family: inherit;
}

.hs-pin-input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

/* Toast im Spielfeld (Rueckmeldung nach Submit/PIN) */
.game-container {
    position: relative;
}

.hs-toast {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    z-index: 60;
    background: rgba(20, 24, 48, 0.92);
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    max-width: 80%;
    text-align: center;
}

.hs-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hs-toast-error {
    background: rgba(198, 40, 40, 0.95);
}

/* Feier-Toast: "Du bist auf Rang 1!" – gold, größer, länger sichtbar */
.hs-toast--celebrate {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f7d774 0%, #f5b942 55%, #f0912e 100%);
    color: #3d2400;
    font-size: 1.2em;
    font-weight: 700;
    padding: 14px 22px;
    border-radius: 16px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 0 28px rgba(255, 190, 60, 0.55), 0 10px 30px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
    animation: hs-toast-pop 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.hs-toast--celebrate .hs-toast-trophy {
    font-size: 1.5em;
    display: inline-block;
    animation: hs-toast-wiggle 0.9s ease-in-out infinite;
    transform-origin: 50% 80%;
}

.hs-toast--celebrate .hs-toast-spark {
    font-size: 1em;
    animation: hs-toast-twinkle 1.2s ease-in-out infinite;
}

.hs-toast--celebrate .hs-toast-spark:last-child {
    animation-delay: 0.4s;
}

@keyframes hs-toast-pop {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.5);
    }
    70% {
        opacity: 1;
        transform: translateX(-50%) translateY(2px) scale(1.08);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes hs-toast-wiggle {
    0%, 100% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(12deg);
    }
}

@keyframes hs-toast-twinkle {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

body.dark-theme .hs-toast--celebrate {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2), 0 0 32px rgba(255, 190, 60, 0.6), 0 12px 34px rgba(0, 0, 0, 0.5);
}

/* Banner: veraltete Spielsitzung -> Neu laden */
.hs-version-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f5b301;
    color: #3a2a00;
    font-weight: 700;
    font-size: 0.95em;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.hs-version-banner .hs-btn {
    background: #3a2a00;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: 600;
}

.hs-backup-code {
    margin: 10px 0 4px 0;
    padding: 12px;
    background: rgba(245, 179, 1, 0.15);
    border: 1px dashed #f5b301;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-weight: 800;
    letter-spacing: 3px;
    font-size: 1.15em;
    text-align: center;
    color: #b8860b;
}

.hs-link {
    background: none;
    border: none;
    padding: 0;
    color: #764ba2;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9em;
    font-family: inherit;
}

.hs-msg {
    margin-top: 10px;
    font-size: 0.9em;
    color: #2e7d32;
    font-weight: 600;
}

.hs-msg.hs-error {
    color: var(--c-danger);
}

/* Dark Theme */
body.dark-theme .hs-panel {
    background: none;
    border-color: var(--c-border);
}

/* fruitmatch3: Panel im zentrierten Flex-Container auf volle Breite */
body.page-fruitmatch3 .game-container .hs-panel {
    width: 100%;
    margin-bottom: 7px;
}

/* fruitmatch3: Controls-Pille ueber die volle Spielbreite, Buttons mittig */
body.page-fruitmatch3 .game-toolbar .controls {
    width: 100%;
    justify-content: center;
}

/* fruitmatch3: "Neues Spiel" nach links, die uebrigen Buttons als Gruppe nach rechts */
body.page-fruitmatch3 .game-toolbar .controls #startBtn {
    margin-right: auto;
}

body.dark-theme .hs-board-title {
    color: #8a8a9c;
}

body.dark-theme .hs-row {
    background: rgba(102, 126, 234, 0.12);
    box-shadow: inset 3px 0 0 #8fa3d9;
}

body.dark-theme .hs-row:hover {
    background: rgba(102, 126, 234, 0.2);
}

body.dark-theme .hs-row:first-child:hover {
    background: rgba(245, 179, 1, 0.26);
}

body.dark-theme .hs-row.hs-me {
    background: rgba(102, 126, 234, 0.22);
}

body.dark-theme .hs-row.hs-me:hover {
    background: rgba(102, 126, 234, 0.3);
}

body.dark-theme .hs-row:first-child {
    background: rgba(245, 179, 1, 0.16);
    box-shadow: inset 3px 0 0 #f5b301;
}

body.dark-theme .hs-score {
    color: #e8e8f0;
}

body.dark-theme .hs-empty {
    color: #8a8a9a;
}

body.dark-theme .hs-pin-input {
    background: rgba(20, 24, 48, 0.7);
    color: #e8e8f0;
    border-color: rgba(102, 126, 234, 0.45);
}

body.dark-theme .hs-chev {
    color: #6f6f80;
}


/* ==== Geteilte Panel-Regeln (aus ehemaliger highscores-Sektion) ==== */

.hs-game-card {
    background: linear-gradient(135deg, #f0f3ff 0%, #f8f9ff 100%);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.10);
    padding: 14px;
    overflow: hidden;
}

.hs-game-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.hs-game-icon {
    font-size: 1.5em;
}

.hs-game-name {
    flex: 1;
    font-weight: 700;
    font-size: 1.05em;
}

.hs-play {
    text-decoration: none;
}

.hs-game-board .hs-row {
    grid-template-columns: 34px 1fr 80px;
}

.hs-empty.hs-error {
    color: var(--c-danger);
}

body.dark-theme .hs-game-card {
    background: none;
    border-color: var(--c-border);
}

body.dark-theme .hs-empty.hs-error {
    color: #ef9a9a;
}

.hs-player-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 12px 0 0 0;
    font-size: 0.82em;
    color: var(--c-muted);
}

.hs-player-status i {
    color: var(--c-accent);
}

.hs-player-status .hs-link {
    color: var(--c-accent);
}

body.dark-theme .hs-player-status {
    color: #aaa;
}

/* Aufklappbare Eintraege (Datum, Dauer, Statistik) */
.hs-row {
    cursor: pointer;
}

.hs-detail {
    display: none;
    padding: 10px 10px 8px 10px;
    font-size: 0.8em;
    color: #777;
}

.hs-detail.open {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hs-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hs-detail-item,
.hs-detail-stats {
    display: grid;
    grid-template-columns: 42px auto 1fr;
    align-items: center;
    gap: 8px;
}

.hs-game-board .hs-detail-item,
.hs-game-board .hs-detail-stats {
    grid-template-columns: 34px auto 1fr;
}

.hs-detail-label {
    white-space: nowrap;
}

.hs-detail-value {
    text-align: right;
    overflow-wrap: break-word;
    word-break: break-word;
}

.hs-detail-stats {
    margin-top: 0;
}

.hs-detail-stats i {
    color: var(--c-accent);
}

.hs-detail-item i {
    color: var(--c-accent);
}

.hs-detail-item > i,
.hs-detail-stats > i {
    justify-self: center;
}

.hs-detail-unprot {
    color: var(--c-muted);
}

.hs-detail-prot {
    color: var(--c-accent);
    font-weight: 600;
}

body.dark-theme .hs-detail {
    color: #9a9aaa;
}

.hs-detail-profile {
    color: var(--c-accent);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}

.hs-detail-profile:hover {
    text-decoration: none;
    color: #4f5bd5;
}

body.dark-theme .hs-detail-profile {
    color: #aab6ff;
}

body.dark-theme .hs-detail-profile:hover {
    color: #fff;
}