/* ==========================================================================
   HavenCraft — Vote Portal Styles
   Unslopped, refined, high-craft gaming aesthetic.
   Follows 4px grid rhythm, quiet chrome, tabular metrics, and crisp surfaces.
   ========================================================================== */

/* 1. Header & Hero (Consistent with Home Page) */
.page-header.vote-page-header {
    padding-top: calc(var(--nav-height) + 36px);
    padding-bottom: 28px;
    text-align: center;
}

.vote-hero-subline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.page-header.vote-page-header h1 {
    font-size: clamp(2rem, 3.8vw, 2.75rem);
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

.page-header.vote-page-header .description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 2. Container & Section */
.vote-section {
    padding: 0 0 72px;
}

.vote-container {
    max-width: 1120px;
    margin: 0 auto;
}

/* 3. Player Input Section (Unified single card containing search & stats) */
.player-input-section {
    background: var(--surface);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px 22px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 36px;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.player-input-section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
    font-family: var(--font-heading);
}

.input-group {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    box-sizing: border-box;
}

.vote-input {
    flex: 1;
    width: 100%;
    height: 46px;
    min-height: 46px;
    box-sizing: border-box;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.vote-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.vote-input::placeholder {
    color: var(--text-muted);
}

.btn-vote-submit {
    height: 46px;
    min-height: 46px;
    box-sizing: border-box;
    padding: 0 24px;
    background: var(--primary);
    color: #0c141d;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
}

.btn-vote-submit:hover {
    background: #02d69f;
    transform: translateY(-1px);
}

.btn-vote-submit:active {
    transform: translateY(0);
}

/* 4. Player Stats Panel (Embedded seamlessly inside the search card) */
.status-notification {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin: 16px auto 12px;
    max-width: 760px;
    width: 100%;
    display: flex;
    align-items: center;
    animation: fadeIn 0.25s ease;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.player-stat-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.player-stat-identity {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    text-align: left;
}

.player-stat-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-heading);
    line-height: 1.2;
}

.player-stat-dot {
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.55;
    user-select: none;
    line-height: 1;
}

.player-stat-last {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.2;
}

.player-stat-last strong {
    color: var(--text-secondary);
    font-weight: 500;
}

.status-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 200, 150, 0.1);
    border: 1px solid rgba(0, 200, 150, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.status-icon.error {
    background: rgba(255, 80, 80, 0.1);
    border-color: rgba(255, 80, 80, 0.2);
    color: #ff5555;
}

.player-stat-metrics {
    display: flex;
    gap: 20px;
    align-items: center;
    text-align: center;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-val {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-heading);
}

.metric-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
    letter-spacing: 0.02em;
}

.metric-item.highlight .metric-val {
    color: var(--primary);
    font-weight: 700;
}

.metric-item.highlight .metric-lbl {
    color: var(--primary);
    opacity: 0.9;
}

.player-stat-empty,
.player-stat-state {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
}

.player-stat-empty h3,
.status-content h3 {
    margin: 0 0 2px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.player-stat-empty p,
.status-content p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.status-content h3.error-title {
    color: #ff5555;
}

/* 5. Player Input Footer (Tip + Compact Reminder Button) */
.player-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 16px auto 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    max-width: 760px;
    width: 100%;
    box-sizing: border-box;
}

.tip-box {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-align: left;
}

.tip-box i {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.vote-reminder-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.reminder-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.btn-reminder-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.btn-reminder-toggle:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-reminder-toggle.active {
    background: rgba(0, 200, 150, 0.12);
    border-color: rgba(0, 200, 150, 0.35);
    color: var(--primary);
}

/* 6. Tab Navigation (Quiet segmented control) */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 9px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface-hover);
}

.tab-btn.active {
    color: #ffffff;
    background: rgba(0, 200, 150, 0.12);
    border-color: rgba(0, 200, 150, 0.35);
    font-weight: 600;
}

.tab-btn.active i {
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 7. Section Title (Centered, clean, no rogue left border) */
.section-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text);
    font-family: var(--font-heading);
    border-left: none !important;
    padding-left: 0 !important;
}

/* 8. Voting Sites Grid (4-columns on desktop: 4 + 4 = 8, perfectly balanced) */
.vote-sites-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.vote-site-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
    position: relative;
}

.vote-site-card:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.vote-site-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary);
    transition: border-color 0.15s ease;
}

.vote-site-card:hover .vote-site-icon {
    border-color: rgba(0, 200, 150, 0.3);
}

.vote-site-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
    font-family: var(--font-heading);
    line-height: 1.3;
}

.vote-site-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
    min-height: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-site-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-bottom: 14px;
}

.vote-site-status.available {
    background: rgba(0, 200, 150, 0.08);
    border: 1px solid rgba(0, 200, 150, 0.18);
    color: var(--primary);
}

.vote-site-status.cooldown {
    background: rgba(255, 170, 0, 0.08);
    border: 1px solid rgba(255, 170, 0, 0.18);
    color: #ffaa00;
}

.status-dot-small {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.btn-vote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 36px;
    padding: 0 12px;
    margin-top: auto;
    background: rgba(0, 200, 150, 0.12);
    color: var(--primary);
    border: 1px solid rgba(0, 200, 150, 0.28);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-vote:hover {
    background: var(--primary);
    color: #0c141d;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-vote.cooldown-active {
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    pointer-events: none;
}

.countdown-display {
    font-variant-numeric: tabular-nums;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* 9. Leaderboard Tab */
.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.leaderboard-tab {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.leaderboard-tab:hover {
    color: var(--text-secondary);
    border-color: var(--border-strong);
}

.leaderboard-tab.active {
    background: rgba(0, 200, 150, 0.12);
    border-color: rgba(0, 200, 150, 0.35);
    color: var(--primary);
    font-weight: 600;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.leaderboard-item:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.leaderboard-item.rank-1 {
    border-color: rgba(255, 215, 0, 0.25);
    background: rgba(255, 215, 0, 0.02);
}

.leaderboard-item.rank-2 {
    border-color: rgba(192, 192, 192, 0.2);
}

.leaderboard-item.rank-3 {
    border-color: rgba(205, 127, 50, 0.2);
}

.rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.rank-1 .rank-badge {
    background: #ffd700;
    color: #1a1d26;
}

.rank-2 .rank-badge {
    background: #c0c0c0;
    color: #1a1d26;
}

.rank-3 .rank-badge {
    background: #cd7f32;
    color: #1a1d26;
}

.rank-badge.default {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.player-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--surface-hover);
    overflow: hidden;
    flex-shrink: 0;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 2px;
    text-decoration: none;
    font-family: var(--font-heading);
}

.player-rank-title {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.vote-count {
    text-align: right;
}

.vote-count .number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
}

.vote-count .label {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.88rem;
}

/* 10. Rewards Detailed Grid & Streak */
.rewards-detailed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 36px;
}

.reward-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.reward-detail-card:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.reward-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.reward-detail-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    color: var(--primary);
}

.reward-detail-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-heading);
}

.reward-detail-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.streak-bonus-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    max-width: 720px;
    margin: 0 auto;
}

.streak-bonus-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
}

.streak-bonus-title i {
    color: #ff9900;
}

.streak-bonus-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.streak-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.streak-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.streak-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-strong);
}

.streak-days {
    padding: 5px 12px;
    background: rgba(0, 200, 150, 0.12);
    border: 1px solid rgba(0, 200, 150, 0.28);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--primary);
    white-space: nowrap;
}

.streak-reward {
    flex: 1;
}

.streak-reward-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.streak-reward-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 1px;
}

/* 11. Wall of Fame */
.wall-message {
    text-align: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    max-width: 560px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wall-message i {
    color: #ff5577;
    font-size: 0.95rem;
}

.wall-message p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
}

.fame-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 18px;
    text-align: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.fame-card:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.fame-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    margin: 0 auto 12px;
    overflow: hidden;
    border: 2px solid var(--border);
}

.fame-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.fame-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    font-family: var(--font-heading);
}

.fame-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.fame-badge.champion {
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

.fame-badge.legend {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
}

.fame-badge.supporter {
    background: rgba(0, 200, 150, 0.12);
    border: 1px solid rgba(0, 200, 150, 0.3);
    color: var(--primary);
}

.fame-votes {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.fame-votes strong {
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
}

/* 12. Responsive Breakpoints */
@media (min-width: 600px) and (max-width: 959px) {
    .vote-sites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .page-header.vote-page-header {
        padding-top: calc(var(--nav-height) + 24px);
        padding-bottom: 20px;
    }
    .page-header.vote-page-header h1 {
        font-size: 1.95rem;
    }
    .player-input-section {
        padding: 20px 16px;
        margin-bottom: 28px;
    }
    .input-group {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        max-width: 100%;
    }
    .vote-input {
        flex: none;
        width: 100%;
        height: 46px;
        min-height: 46px;
        box-sizing: border-box;
        font-size: 1rem;
    }
    .btn-vote-submit {
        flex: none;
        width: 100%;
        height: 46px;
        min-height: 46px;
        box-sizing: border-box;
        justify-content: center;
    }
    .player-input-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        max-width: 100%;
    }
    .tip-box {
        justify-content: center;
    }
    .vote-reminder-compact {
        justify-content: space-between;
        width: 100%;
    }
    .status-notification {
        padding: 10px 14px;
        margin-top: 12px;
        margin-bottom: 8px;
        width: 100%;
        max-width: 100%;
    }
    .player-stat-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    .player-stat-identity {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 6px;
        text-align: center;
    }
    .player-stat-metrics {
        width: 100%;
        justify-content: space-around;
        gap: 8px;
    }
    .vote-sites-grid {
        grid-template-columns: 1fr;
    }
    .rewards-detailed-grid {
        grid-template-columns: 1fr;
    }
    .tab-navigation {
        gap: 6px;
    }
    .tab-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}
