/* SHARD Prediction Market Panel - Morrhollow Terminal Style */

:root {
    --pred-green-glow: #4ade80;
    --pred-green-accent: #10b981;
    --pred-gold-accent: rgba(212, 175, 55, 0.9);
    --pred-gold-border: rgba(212, 175, 55, 0.4);
    --pred-bg-dark: rgba(15, 15, 25, 0.95);
    --pred-bg-darker: rgba(8, 8, 15, 0.98);
}

.panel-shard-prediction {
    position: fixed;
    top: 80px;
    left: calc(50% - 500px);
    width: 1000px;
    max-width: calc(100vw - 40px);
    height: auto;
    max-height: 90vh;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 40px rgba(74, 222, 128, 0.15),
        0 0 20px rgba(212, 175, 55, 0.1);
    font-family: 'RemiliaMincho', serif;
    font-size: 12px;
    color: #E5E7EB;
    user-select: none;
    background: transparent;
    border: 1px solid var(--pred-gold-border);
}

.panel-shard-prediction::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        var(--pred-bg-dark) 0%,
        var(--pred-bg-darker) 50%,
        var(--pred-bg-dark) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
}

/* Header */
.shard-prediction-header {
    background: rgba(8, 8, 15, 0.6);
    padding: 12px 16px;
    border-bottom: 1px solid rgba(74, 222, 128, 0.2);
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
}

.shard-prediction-header h2 {
    font-family: 'RemiliaMincho', serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0;
    color: rgba(186, 166, 116, 0.95);
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.shard-prediction-subtitle {
    font-size: 9px;
    color: rgba(186, 166, 116, 0.6);
    letter-spacing: 0.5px;
}

.shard-prediction-header-actions {
    position: absolute;
    top: 12px;
    right: 16px;
}

.shard-prediction-refresh-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--pred-green-glow);
    width: 24px;
    height: 24px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.shard-prediction-refresh-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--pred-green-glow);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
    transform: rotate(180deg);
}

/* Tabs */
.shard-prediction-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(74, 222, 128, 0.1);
}

.shard-prediction-tab {
    flex: 1;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(74, 222, 128, 0.15);
    border-radius: 3px;
    color: rgba(186, 166, 116, 0.7);
    font-family: 'RemiliaMincho', serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
}

.shard-prediction-tab:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(74, 222, 128, 0.3);
    color: rgba(186, 166, 116, 0.9);
}

.shard-prediction-tab.active {
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--pred-green-glow);
    color: var(--pred-green-glow);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.2);
}

/* Body */
.shard-prediction-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.shard-prediction-body::-webkit-scrollbar {
    width: 6px;
}

.shard-prediction-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.shard-prediction-body::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.3);
    border-radius: 3px;
}

.shard-prediction-body::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 222, 128, 0.5);
}

/* Market Grid */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 16px;
}

/* Market Card - Polymarket-inspired */
.shard-market-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(8px);
}

.shard-market-card:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: rgba(74, 222, 128, 0.6);
    box-shadow:
        0 0 20px rgba(74, 222, 128, 0.25),
        0 8px 16px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.65);
}

.market-card-header {
    margin-bottom: 12px;
    position: relative;
}

.hot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.market-question {
    font-size: 11px;
    font-weight: 600;
    color: rgba(186, 166, 116, 0.95);
    margin-bottom: 6px;
    line-height: 1.3;
    padding-right: 60px;
}

.market-metric {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.metric-label {
    font-size: 8px;
    color: rgba(186, 166, 116, 0.6);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.metric-target {
    font-size: 11px;
    font-weight: 700;
    color: var(--pred-green-glow);
    font-family: 'Courier New', monospace;
}

/* Odds Visual */
.market-odds-visual {
    margin: 16px 0;
}

.odds-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    margin-bottom: 8px;
}

.odds-bar-yes {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.8), rgba(34, 197, 94, 0.6));
    transition: width 0.3s ease;
}

.odds-bar-no {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.6), rgba(239, 68, 68, 0.8));
    transition: width 0.3s ease;
}

.odds-percentages {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.odds-yes, .odds-no {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.4);
}

.odds-yes {
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.odds-no {
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.odds-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.odds-yes .odds-label {
    color: rgba(34, 197, 94, 0.9);
}

.odds-no .odds-label {
    color: rgba(239, 68, 68, 0.9);
}

.odds-value {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.odds-yes .odds-value {
    color: rgba(34, 197, 94, 1);
}

.odds-no .odds-value {
    color: rgba(239, 68, 68, 1);
}

/* Market Stats Row */
.market-stats-row {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.market-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-icon {
    font-size: 12px;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #E5E7EB;
    font-family: 'Courier New', monospace;
}

.stat-label {
    font-size: 0.65rem;
    color: rgba(212, 175, 55, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Market Detail View */
.market-detail-view {
    max-width: 960px;
    margin: 0 auto;
}

.back-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: rgba(212, 175, 55, 0.9);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'RemiliaMincho', serif;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 16px;
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.detail-header {
    margin-bottom: 24px;
}

.detail-question {
    font-size: 1.5rem;
    font-weight: 600;
    color: #E5E7EB;
    margin-bottom: 8px;
    line-height: 1.4;
    text-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
}

.detail-description {
    font-size: 10px;
    color: rgba(212, 175, 55, 0.8);
    line-height: 1.6;
}

/* Chart Section */
.chart-section {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 16px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chart-header h3 {
    font-size: 11px;
    font-weight: 600;
    color: #E5E7EB;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chart-legend {
    display: flex;
    gap: 16px;
    font-size: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(229, 231, 235, 0.8);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.current {
    background: rgba(74, 222, 128, 0.8);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.legend-dot.target {
    background: rgba(212, 175, 55, 0.8);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

.legend-dot.yes {
    background: rgba(34, 197, 94, 0.9);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.legend-dot.no {
    background: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.winning-yes {
    color: rgba(34, 197, 94, 1);
    font-weight: 600;
}

.winning-no {
    color: rgba(239, 68, 68, 1);
    font-weight: 600;
}

.market-chart-container {
    width: 100%;
    height: 300px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

/* Market Info Row */
.market-info-row {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.market-info-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
}

.market-info-item.winning-yes {
    border: 1px solid rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.1);
}

.market-info-item.winning-no {
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
}

.info-label {
    font-size: 9px;
    color: rgba(186, 166, 116, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-value {
    font-size: 12px;
    font-weight: 700;
    color: rgba(229, 231, 235, 0.95);
    font-family: 'Courier New', monospace;
}

.market-info-item.winning-yes .info-value {
    color: rgba(34, 197, 94, 1);
}

.market-info-item.winning-no .info-value {
    color: rgba(239, 68, 68, 1);
}

/* Betting Section */
.betting-section {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 4px;
    padding: 12px;
}

.betting-title {
    font-size: 12px;
    font-weight: 600;
    color: #E5E7EB;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Position Selector - Polymarket-inspired */
.position-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.position-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'RemiliaMincho', serif;
    position: relative;
    overflow: hidden;
}

.position-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 0;
}

.position-yes {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(34, 197, 94, 0.3);
    color: rgba(34, 197, 94, 0.8);
}

.position-yes::before {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
}

.position-yes:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.position-yes:hover::before {
    opacity: 1;
}

.position-yes.selected {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.9);
    box-shadow:
        0 0 25px rgba(34, 197, 94, 0.5),
        0 4px 16px rgba(34, 197, 94, 0.3);
    color: rgba(34, 197, 94, 1);
    transform: scale(1.02);
}

.position-yes.selected::before {
    opacity: 1;
}

.position-no {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 0.8);
}

.position-no::before {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
}

.position-no:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.position-no:hover::before {
    opacity: 1;
}

.position-no.selected {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow:
        0 0 25px rgba(239, 68, 68, 0.5),
        0 4px 16px rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 1);
    transform: scale(1.02);
}

.position-no.selected::before {
    opacity: 1;
}

.position-btn > * {
    position: relative;
    z-index: 1;
}

.position-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.position-odds {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.position-payout {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Bet Amount Section */
.bet-amount-section {
    margin-bottom: 16px;
}

.amount-label {
    display: block;
    font-size: 10px;
    color: rgba(212, 175, 55, 0.9);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

.amount-input-wrapper {
    display: flex;
    gap: 8px;
}

.amount-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #E5E7EB;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.amount-input:focus {
    outline: none;
    border-color: rgba(74, 222, 128, 0.6);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.3);
}

.max-btn {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: rgba(212, 175, 55, 0.9);
    padding: 0 20px;
    border-radius: 6px;
    font-family: 'RemiliaMincho', serif;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.15s ease;
}

.max-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.amount-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: rgba(212, 175, 55, 0.6);
}

/* Bet Summary */
.bet-summary {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 3px;
    padding: 16px;
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.summary-row.summary-profit {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.summary-label {
    font-size: 10px;
    color: rgba(229, 231, 235, 0.8);
}

.summary-value {
    font-size: 11px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #E5E7EB;
}

.summary-win {
    color: rgba(34, 197, 94, 1);
}

.summary-profit .summary-value {
    font-size: 13px;
    color: rgba(74, 222, 128, 1);
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

/* Place Bet Button */
.place-bet-btn {
    width: 100%;
    background: linear-gradient(135deg,
        rgba(74, 222, 128, 0.8),
        rgba(74, 222, 128, 0.6));
    border: 2px solid rgba(74, 222, 128, 0.8);
    color: white;
    padding: 14px;
    border-radius: 3px;
    font-family: 'RemiliaMincho', serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.place-bet-btn:hover {
    background: linear-gradient(135deg,
        rgba(74, 222, 128, 1),
        rgba(74, 222, 128, 0.8));
    box-shadow: 0 0 25px rgba(74, 222, 128, 0.6);
    transform: translateY(-2px);
}

.select-position-hint {
    text-align: center;
    padding: 40px 20px;
    font-size: 12px;
    color: rgba(212, 175, 55, 0.7);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #E5E7EB;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.95rem;
    color: rgba(212, 175, 55, 0.7);
}

/* Bets List */
.bets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bet-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 3px;
    padding: 12px;
    transition: all 0.15s ease;
}

.bet-card:hover {
    border-color: rgba(74, 222, 128, 0.5);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}

.bet-question {
    font-size: 11px;
    font-weight: 600;
    color: #E5E7EB;
    margin-bottom: 12px;
}

.bet-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bet-position {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.05em;
}

.bet-position.yes {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: rgba(34, 197, 94, 1);
}

.bet-position.no {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: rgba(239, 68, 68, 1);
}

.bet-amount {
    font-size: 12px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: rgba(212, 175, 55, 0.9);
}

.bet-expected {
    font-size: 10px;
    color: rgba(229, 231, 235, 0.7);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(74, 222, 128, 0.2);
    border-top-color: rgba(74, 222, 128, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
    .panel-shard-prediction {
        left: 20px;
        right: 20px;
        width: auto;
    }

    .market-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .panel-shard-prediction {
        top: 60px;
        left: 10px;
        right: 10px;
        max-height: calc(100vh - 70px);
    }

    .chart-legend {
        flex-direction: column;
        gap: 8px;
    }

    .market-chart-container {
        height: 300px;
    }

    .position-selector {
        flex-direction: column;
    }
}
