/* --- THEME & COLOR PALETTE (CSS VARIABLES) --- */
:root {
    --main-orange: #FF6700; /* Xiaomi Orange */
    --main-dark-bg: #0A0A0A;
    --main-card-bg: #121212;
    --main-text-light: #E0E0E0;
    --success-green: #2a9a47;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

/* --- GLOBAL RESET & BASE STYLES --- */
* {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    box-sizing: border-box;
}

body {
    background-color: var(--main-dark-bg);
    color: var(--main-text-light);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- DYNAMIC PARTICLE BACKGROUND ANIMATION --- */
.bubble-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.bubble {
    position: absolute;
    bottom: -150px;
    background-color: rgba(255, 103, 0, 0.1);
    border-radius: 50%;
    animation: fizz 25s linear infinite;
    opacity: 0;
}

@keyframes fizz {
    0% {
        transform: translateY(0) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1.5);
        opacity: 0;
    }
}

.bubble:nth-child(2),
.bubble:nth-child(4),
.bubble:nth-child(6) {
    background-color: rgba(0, 123, 255, 0.1);
}

/* --- CORE LAYOUT --- */
.screen {
    max-width: 1024px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--main-card-bg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.wrapper {
    padding: 25px;
    max-width: 640px;
    margin: 0 auto;
    flex-grow: 1;
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3,
h4,
.faq-headline,
.others-say {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--main-text-light);
    line-height: 1.2;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    font-weight: 900;
}

h3 {
    font-size: 2.25rem;
    margin-bottom: 10px;
}

h4 {
    font-size: 2.75rem;
    margin-bottom: 20px;
    color: var(--main-orange);
}

.intro-txt,
.end-text,
p {
    font-size: 1.05rem;
    margin-bottom: 15px;
    color: #fff;
}

.color {
    font-weight: 700;
    color: var(--main-orange);
}

/* --- HEADER & TIMER --- */
.header {
    padding: 15px 25px;
    background: var(--main-card-bg);
    color: var(--main-text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--main-text-light);
}

.logo img {
    width: 38px;
    height: auto;
    display: block;
    background: #fff;
    border-radius: 6px;
}

.logo span {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.header button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--main-text-light);
    font-size: 24px;
    transition: transform 0.2s ease;
}

.header button:hover {
    transform: scale(1.1);
    color: var(--main-orange);
}

.timer-top {
    display: none;
    text-align: center;
    background: var(--main-orange);
    color: #fff;
    padding: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 500;
}

.top-timer {
    font-weight: 900;
}

/* --- MSRP BADGE ON PRODUCT IMAGE --- */
.intro-img {
    max-width: 448px;
    margin: 32px auto;
    position: relative;
}

.intro-img img {
    display: block;
    background: var(--main-text-light);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.msrp-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 80px;
    height: 80px;
    background: var(--main-orange);
    color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.msrp-badge span {
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
    display: block;
}

/* --- ACTION BUTTONS --- */
.started {
    padding: 20px 0;
    position: sticky;
    bottom: 0;
    margin-top: 20px;
}

.started button,
.started a {
    cursor: pointer;
    display: block;
    width: 100%;
    background: var(--main-orange);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    text-align: center;
    border: none;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 5px 15px rgba(255, 103, 0, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.started button:hover,
.started a:hover {
    background: #e05a00;
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(255, 103, 0, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

/* --- QUIZ STYLES --- */
.step2 {
    display: none;
}

.question-number {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #ccc;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 20px;
}

.question-number span {
    color: var(--main-orange);
}

.question p {
    color: #999;
    margin-bottom: 2rem;
}

.question button {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.15);
    padding: 15px 20px;
    margin-bottom: 15px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.question button:hover {
    background: rgba(255, 103, 0, 0.2);
    border-color: var(--main-orange);
}

/* --- LOADING ANIMATION --- */
.step3 {
    display: none;
    text-align: center;
}

.loading-text {
    font-size: 1.25rem;
    color: #999;
    margin-bottom: 30px;
}

.loading-steps {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 1.1rem;
    color: #ccc;
    transition: all 0.3s ease;
}

.step-icon {
    position: relative;
    width: 24px;
    height: 24px;
}

.spinner,
.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.spinner {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid var(--main-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
}

.checkmark {
    color: var(--success-green);
    opacity: 0;
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: draw-check 0.4s ease forwards;
}

.loading-step.working .spinner {
    opacity: 1;
}

.loading-step.done .spinner {
    opacity: 0;
}

.loading-step.done .checkmark {
    opacity: 1;
    animation: draw-check 0.4s ease forwards 0.1s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes draw-check {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- SUCCESS PAGE --- */
.step4 {
    display: none;
}

.step4 .intro-img {
    margin: 0 auto 32px;
    max-width: 384px;
}

.end-list {
    margin-bottom: 20px;
    list-style: none;
    counter-reset: end-list-counter;
}

.end-list li {
    padding: 20px 20px 20px 50px;
    font-size: 1rem;
    border-top: 2px dashed rgba(255, 103, 0, 0.2);
    position: relative;
}

.end-list li::before {
    counter-increment: end-list-counter;
    content: counter(end-list-counter);
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: var(--main-orange);
    color: #fff;
    border-radius: 50%;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.end-list li:first-child {
    border-top: 0;
}

.end-list li span {
    font-weight: 700;
    color: var(--main-text-light);
}

/* --- COMMENTS SECTION --- */
.comments {
    margin-top: 64px;
}

.others-say {
    font-size: 1.75rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--main-orange);
    padding-bottom: 10px;
    color: white;
}

.sorting-box {
    padding: 8px 0;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 103, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sorting-box > p {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: #ccc;
}

.inner-sorting-box {
    font-size: 0.9rem;
}

.sort > button {
    cursor: pointer;
    color: var(--main-text-light);
    background: transparent;
    border: 1px solid rgba(255, 103, 0, 0.5);
    border-radius: 6px;
    padding: 4px 8px;
    font-weight: 700;
}

.dropdown-sort {
    display: none;
    z-index: 50;
    position: absolute;
    background: var(--main-card-bg);
    border: 1px solid rgba(255, 103, 0, 0.5);
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.dropdown-sort button {
    background: transparent;
    border: none;
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    cursor: pointer;
    color: white;
}

.dropdown-sort button:hover,
.dropdown-sort button.selected {
    background-color: rgba(255, 103, 0, 0.1);
}

.add-comment {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    background: #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: bold;
}

.comment-input {
    flex: 1;
    padding: 10px;
    border: 2px solid rgba(255, 103, 0, 0.3);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.comment-input:focus {
    outline: none;
    border-color: var(--main-orange);
    background: rgba(255, 255, 255, 0.1);
}

.post-button {
    padding: 10px 15px;
    background: var(--main-orange);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.comment {
    display: flex;
    gap: 15px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.comment-author {
    font-weight: bold;
    color: var(--main-orange);
}

.comment-date {
    color: #999;
    font-size: 0.85rem;
}

.comment-text {
    margin-bottom: 10px;
    line-height: 1.5;
}

.comment-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #999;
}

.comment-action {
    cursor: pointer;
}

.comment-action:hover {
    color: var(--main-orange);
}

.load-more {
    background: var(--main-orange);
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 12px 16px;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 20px;
    transition: background-color 0.2s;
}

.load-more:hover {
    background-color: #e05a00;
}

/* --- FOOTER --- */
.footer {
    text-align: center;
    padding: 30px 20px;
    background: var(--main-dark-bg);
    color: #ccc;
    margin-top: 40px;
    border-top: 4px solid var(--main-orange);
}

.footer-links {
    margin: 16px 0 24px;
}

.footer-links a {
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.trade-names,
.disclaimer-box p {
    font-size: 0.75rem;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto 20px;
    color: #aaa;
}

.disclaimer-box p a {
    color: #fff;
    font-weight: 700;
}

/* --- RESPONSIVE --- */
@media screen and (max-width: 639px) {
    .wrapper {
        padding: 15px;
        max-width: 100%;
    }
    h1 { font-size: 1.5rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 2rem; }
    .intro-txt, .end-text, p { font-size: 0.9rem; }
    .question-number { font-size: 1.3rem; }
    .question p { font-size: 0.95rem; margin-bottom: 1.5rem; }
    .question button { font-size: 1rem; padding: 12px 16px; }
    .others-say { font-size: 1.5rem; }
    .footer-links a { display: block; margin: 10px 0; }
    .msrp-badge { width: 60px; height: 60px; font-size: 0.6rem; }
    .msrp-badge span { font-size: 1rem; }
    .add-comment { flex-direction: column; }
    .avatar-placeholder { align-self: flex-start; }
    .post-button { align-self: flex-end; width: fit-content; }
    .comment { flex-direction: column; }
    .comment-header { flex-direction: column; align-items: flex-start; gap: 5px; }
    .step4 .intro-img { margin: 0 auto 20px; max-width: 100%; }
    .step4 .end-list li { padding: 15px 15px 15px 40px; font-size: 0.9rem; }
    .step4 .end-list li::before { width: 25px; height: 25px; font-size: 1rem; }
    .step4 .started { padding: 15px 0; }
    .step4 .started button { padding: 15px 20px; font-size: 1.1rem; }
}