/* Trivia Preview in Slider */
.trivia-ring {
    display: inline-block;
    padding: 3px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5a623, #f7931e, #f5a623);
}

.trivia-ring.completed {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
}

.trivia-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 194px;
    border-radius: 10px;
    border: 2px solid #fff;
    background: linear-gradient(180deg, #4EAEE8 0%, #3498db 100%);
    color: white;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
}

.trivia-preview-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.trivia-preview-title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.trivia-ring.completed .trivia-preview {
    opacity: 0.7;
}

.trivia-preview-image {
    width: 120px;
    height: 194px;
    border-radius: 10px;
    border: 2px solid #fff;
    object-fit: cover;
    display: block;
}

.trivia-ring.completed .trivia-preview-image {
    opacity: 0.7;
}

/* Trivia Modal Fullscreen */
.trivia-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: linear-gradient(180deg, #2095F2 0%, #207BF2 100%);
    display: none;
    flex-direction: column;
}

.trivia-modal.active {
    display: flex;
}

/* Trivia Header */
.trivia-header {
    position: absolute;
    top: calc(24px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.trivia-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trivia-header-icon {
    width: 32px;
    height: 32px;
}

.trivia-header-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.trivia-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 28px;
    padding: 0;
    line-height: 1;
    text-decoration: none;
}

/* Timer Circle */
.trivia-timer-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    margin-top: calc(3rem + env(safe-area-inset-top, 0px));
}

.trivia-timer {
    position: relative;
    width: 100px;
    height: 100px;
}

.trivia-timer-svg {
    transform: rotate(-90deg);
    width: 100px;
    height: 100px;
}

.trivia-timer-bg {
    fill: #00000030;
    stroke: white;
    stroke-width: 5;
}

.trivia-timer-progress {
    fill: none;
    stroke: #34C759;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 226;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.trivia-timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 700;
    color: white;
}

/* Question Card */
.trivia-question-card {
    margin: 1rem 1.785rem auto 1.785rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.trivia-question-card.no-timer {
    margin-top: 80px;
}

.trivia-question-text {
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-align: center;
    line-height: 1.4;
    
    margin: 0;
    
    padding: 0.75rem 1rem;
    border-radius: 12px 12px 0 0;
    
    background-color: #262626;
}

/* Answer Options */
.trivia-answers {
    background-color: white;
    
    display: flex;
    flex-direction: column;
    gap: 12px;
    
    border-radius: 0 0 12px 12px;
    padding: 0.75rem 1rem;
}

.trivia-answer-btn {
    width: 100%;
    padding: .5rem 0;
    
    border: none;
    
    border-radius: 15px;
    background: #efefef;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    
    text-decoration: none;
}

.trivia-answer-btn:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.trivia-answer-btn.selected {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.trivia-answer-btn.correct {
    border-color: #34C759;
    background: #34C759;
    color: white;
}

.trivia-answer-btn.incorrect {
    border-color: #FF0004;
    background: #FF0004;
    color: white;
}

.trivia-answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.trivia-answer-btn.correct.shake {
    animation: correctShake 0.4s ease-in-out;
    will-change: transform;
}

@keyframes correctShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
}

/* Results Screen */
.trivia-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
    padding-top: 80px;
    text-align: center;
    color: white;
}

.trivia-results.active {
    display: flex;
}

.trivia-results-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.trivia-results-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.trivia-results-score {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 8px;
}

.trivia-results-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.trivia-results-btn {
    background: white;
    color: #3498db;
    border: none;
    border-radius: 50px;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.trivia-results-btn:hover {
    transform: scale(1.05);
}

/* Progress Bars (Story-style) */
.trivia-progress {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10002;
}

.trivia-progress-bar-wrapper {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.trivia-progress-bar {
    width: 0%;
    height: 100%;
    background: #fff;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.trivia-progress-bar.completed {
    width: 100%;
}

.trivia-progress-bar.active {
    width: 50%;
}

/* Home indicator bar */
.trivia-home-indicator {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    margin: 8px auto;
}

.trivia-background-img {
    position: absolute;
    
    z-index: -1;
}

.trivia-background-img.top-left {
    top: -25%;
    left: -25%;
}

.trivia-background-img.top-right {
    top: 25%;
    right: 0;
}

.trivia-background-img.bottom-left {
    bottom: 10%;
    left: 0;
}

.trivia-background-img.bottom-right {
    bottom: -25%;
    right: -25%;
    transform: rotate(-180deg);
}

