/**
 * Funquizo Games - Central Shared Result Screen Stylesheet
 * Reusable for all current and future time-based Funquizo mini-games.
 */

.gr-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow-y: auto;
    animation: grFadeIn 0.22s ease-out forwards;
}

@keyframes grFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.gr-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    width: 100%;
    max-width: 460px;
    padding: 1.8rem 1.4rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12), 0 0 30px rgba(124, 58, 237, 0.08);
    margin: auto;
    box-sizing: border-box;
    color: #1e293b;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.gr-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #f8fafc;
    color: #334155;
    font: inherit;
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.gr-close:hover {
    background: #e2e8f0;
}

.gr-close:focus-visible {
    outline: 3px solid #7c3aed;
    outline-offset: 2px;
}

/* Badge (PB or Finished) */
.gr-badge {
    display: inline-block;
    padding: 0.35rem 0.95rem;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}

.gr-badge--pb {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid #10b981;
    color: #059669;
}

.gr-badge--done {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid #c4b5fd;
    color: #7c3aed;
}

/* Total Time Hero */
.gr-time-hero {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
    font-size: clamp(2.4rem, 8vw, 3.2rem);
    font-weight: 950;
    font-family: 'JetBrains Mono', monospace, sans-serif;
    color: #1e293b;
    letter-spacing: -0.02em;
    margin-bottom: 0.65rem;
    text-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
}

.gr-time-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.gr-time-unit {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 700;
    color: #64748b;
}

/* Reflex Rating Pill */
.gr-tier-box {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 99px;
    padding: 0.35rem 0.95rem;
    margin-bottom: 1.15rem;
}

.gr-tier-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gr-tier-name {
    font-size: 0.88rem;
    color: #7c3aed;
    font-weight: 900;
}

/* Stats Row (3 Columns) */
.gr-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.75rem 0.4rem;
    margin-bottom: 0.9rem;
}

.gr-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gr-stat-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.gr-stat-val {
    font-size: 0.92rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace, sans-serif;
    color: #1e293b;
}

/* Personbästa Row */
.gr-best-row {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.45rem;
    margin-bottom: 1.15rem;
    font-size: 0.92rem;
    color: #475569;
}

.gr-best-label {
    font-weight: 700;
}

.gr-best-val {
    color: #d97706;
    font-family: 'JetBrains Mono', monospace, sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
}

/* Action Buttons */
.gr-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
}

.gr-btn {
    width: 100%;
    padding: 1.05rem 1.25rem;
    border-radius: 16px;
    border: none;
    font-size: 1.02rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}

.gr-btn--primary {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.gr-btn--primary:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.45);
}

.gr-btn--primary:active {
    transform: scale(0.98);
}

.gr-btn--secondary {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.gr-btn--secondary:hover {
    background: #e2e8f0;
}

.gr-btn--secondary:active {
    transform: scale(0.98);
}

/* High Score Box */
.gr-highscore-box {
    background: linear-gradient(135deg, #faf5ff, #fefce8);
    border: 1px solid #fde047;
    border-radius: 18px;
    padding: 1.1rem 1.15rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.gr-hs-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.gr-hs-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.gr-hs-title {
    display: block;
    font-size: 0.96rem;
    font-weight: 900;
    color: #854d0e;
    margin-bottom: 0.25rem;
}

.gr-hs-sub {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.38;
}

.gr-hs-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.gr-btn-register {
    display: block;
    width: 100%;
    background: #f59e0b;
    color: #ffffff;
    text-align: center;
    font-weight: 900;
    font-size: 0.92rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
    box-sizing: border-box;
}

.gr-btn-register:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.gr-btn-login {
    display: block;
    text-align: center;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: underline;
    padding: 0.25rem;
}

.gr-btn-login:hover {
    color: #1e293b;
}

/* Splits Chips */
.gr-splits-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
    margin-top: 0.2rem;
    margin-bottom: 1.25rem;
}

.gr-split-chip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'JetBrains Mono', monospace, sans-serif;
}

.gr-split-chip--fast {
    border-color: #7dd3fc;
    background: #f0f9ff;
}

.gr-split-num {
    font-size: 0.62rem;
    font-weight: 700;
    color: #94a3b8;
}

.gr-split-time {
    font-size: 0.78rem;
    font-weight: 800;
    color: #1e293b;
}

.gr-split-chip--fast .gr-split-time {
    color: #0284c7;
}

/* Navigation Links */
.gr-nav-links {
    margin-top: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.gr-back-link {
    color: #475569;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border-radius: 99px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    transition: all 0.18s ease;
}

.gr-back-link:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateX(-2px);
}

.gr-hub-link {
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    transition: color 0.15s ease;
}

.gr-hub-link:hover {
    color: #64748b;
    text-decoration: underline;
}
