* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2333;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --green: #00d26a;
    --green-dim: rgba(0, 210, 106, 0.15);
    --red: #ff4757;
    --red-dim: rgba(255, 71, 87, 0.15);
    --blue: #58a6ff;
    --gold: #ffc107;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px;
    padding-bottom: 80px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 16px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-title .logo {
    font-size: 24px;
}

.header-title h1 {
    font-size: 18px;
    font-weight: 700;
}

.win-rate {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.win-rate-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.win-rate-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--green);
}

/* Signal Card */
.signal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.signal-card.active {
    border-color: var(--blue);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.1);
}

.signal-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.signal-asset {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.asset-icon {
    font-size: 28px;
}

.asset-name {
    font-size: 22px;
    font-weight: 700;
}

.signal-direction {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.direction-arrow {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
}

.direction-arrow.call {
    background: var(--green-dim);
    color: var(--green);
    border: 2px solid var(--green);
}

.direction-arrow.put {
    background: var(--red-dim);
    color: var(--red);
    border: 2px solid var(--red);
}

.direction-text {
    font-size: 32px;
    font-weight: 800;
}

.direction-text.call {
    color: var(--green);
}

.direction-text.put {
    color: var(--red);
}

/* Meta */
.signal-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.meta-item {
    flex: 1;
}

.meta-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.meta-value {
    font-size: 16px;
    font-weight: 600;
}

.confidence-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    margin: 6px 0;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--green));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Timer */
.signal-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.timer-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.timer-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: var(--bg-primary);
    stroke-width: 6;
}

.timer-progress {
    fill: none;
    stroke: var(--blue);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 700;
}

.timer-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Next Signal */
.next-signal {
    text-align: center;
    padding: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 16px;
}

.next-signal-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.next-signal-timer {
    font-size: 36px;
    font-weight: 800;
    color: var(--blue);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 4px;
}

.tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.history-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-icon {
    font-size: 20px;
}

.history-asset {
    font-weight: 600;
    font-size: 14px;
}

.history-direction {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.history-direction.call {
    color: var(--green);
    background: var(--green-dim);
}

.history-direction.put {
    color: var(--red);
    background: var(--red-dim);
}

.history-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-result {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.history-result.win {
    color: var(--green);
    background: var(--green-dim);
}

.history-result.loss {
    color: var(--red);
    background: var(--red-dim);
}

.history-result.pending {
    color: var(--gold);
    background: rgba(255, 193, 7, 0.15);
}

.history-time {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-card.win {
    border-color: var(--green);
}

.stat-card.loss {
    border-color: var(--red);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-card.win .stat-value {
    color: var(--green);
}

.stat-card.loss .stat-value {
    color: var(--red);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
}
