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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    color: #fff;
    font-size: 0.9rem;
}

.btn-login, .btn-logout {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: #a0a0a0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.login-prompt {
    text-align: center;
}

.login-prompt h2 {
    color: #fff;
    margin-bottom: 1rem;
}

.login-prompt p {
    color: #a0a0a0;
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #a0a0a0;
    font-size: 1.1rem;
}

.back-link {
    color: #64b5f6;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 500px;
    margin: 0 auto 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #fff;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #64b5f6;
}

.form-group input::placeholder {
    color: #666;
}

.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.error-message {
    background: rgba(239, 83, 80, 0.2);
    border: 1px solid #ef5350;
    color: #ef5350;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.feature h3 {
    color: #fff;
    margin-bottom: 0.5rem;
}

.feature p {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.player-header {
    text-align: center;
    margin-bottom: 2rem;
}

.player-header h2 {
    font-size: 2rem;
    color: #fff;
    text-transform: capitalize;
    margin-bottom: 1.5rem;
}

.overall-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 0.85rem;
    color: #a0a0a0;
    text-transform: uppercase;
}

.stat.win .stat-value {
    color: #4caf50;
}

.stat.loss .stat-value {
    color: #f44336;
}

.stat.draw .stat-value {
    color: #ff9800;
}

section {
    margin-bottom: 2.5rem;
}

section h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: #a0a0a0;
    margin-bottom: 1.5rem;
}

.phases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.phase-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.phase-card h4 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.phase-moves {
    font-size: 0.85rem;
    color: #a0a0a0;
    margin-bottom: 1rem;
}

.phase-win-rate {
    font-size: 2.5rem;
    font-weight: 700;
    color: #64b5f6;
    margin-bottom: 0.5rem;
}

.phase-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.phase-card.opening .phase-win-rate {
    color: #4caf50;
}

.phase-card.middlegame .phase-win-rate {
    color: #ff9800;
}

.phase-card.endgame .phase-win-rate {
    color: #64b5f6;
}

.two-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.openings-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.openings-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.openings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.opening-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.opening-name {
    font-weight: 500;
}

.opening-stats {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.opening-item.good .opening-stats {
    color: #4caf50;
}

.opening-item.bad .opening-stats {
    color: #f44336;
}

.no-data {
    color: #666;
    font-style: italic;
}

.time-controls-section {
    margin-bottom: 2.5rem;
}

.time-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.tc-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tc-name {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 0.5rem;
}

.tc-win-rate {
    font-size: 1.75rem;
    font-weight: 700;
    color: #64b5f6;
}

.tc-games {
    font-size: 0.85rem;
    color: #666;
}

.advice-section h3 {
    margin-bottom: 1rem;
}

.advice-grid {
    display: grid;
    gap: 1rem;
}

.advice-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.advice-phase {
    font-size: 0.85rem;
    color: #64b5f6;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.advice-issue {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.advice-suggestion {
    color: #a0a0a0;
    font-size: 0.95rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.pricing-card.featured {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pricing-header h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
}

.price span {
    font-size: 1rem;
    font-weight: 400;
    color: #a0a0a0;
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    display: flex;
    align-items: center;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-features li::before {
    content: "\2713";
    color: #4caf50;
    font-weight: bold;
    margin-right: 0.75rem;
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #a0a0a0;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.pricing-faq {
    max-width: 600px;
    margin: 0 auto;
}

.pricing-faq h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.faq-item h4 {
    color: #fff;
    margin-bottom: 0.5rem;
}

.faq-item p {
    color: #a0a0a0;
}

.success-card {
    text-align: center;
    max-width: 600px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: #fff;
}

.success-card h2 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.success-card > p {
    color: #a0a0a0;
    margin-bottom: 2rem;
}

.success-features {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.success-features h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.success-features ul {
    list-style: none;
}

.success-features li {
    padding: 0.5rem 0;
    color: #e0e0e0;
    display: flex;
    align-items: center;
}

.success-features li::before {
    content: "\2713";
    color: #4caf50;
    font-weight: bold;
    margin-right: 0.75rem;
}

.success-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.success-actions .btn-primary,
.success-actions .btn-secondary {
    flex: 1;
    min-width: 200px;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #a0a0a0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #fff;
}

.premium-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #1a1a2e;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tier-info {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.tier-info a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.tier-info a:hover {
    text-decoration: underline;
}

.btn-upgrade {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.scout-card, .scout-preview {
    margin-top: 2rem;
}

.scout-card h2, .scout-preview h2 {
    color: #fff;
    margin-bottom: 0.5rem;
}

.pro-feature {
    color: #ffd700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.scout-features {
    list-style: none;
    margin: 1rem 0 1.5rem;
}

.scout-features li {
    padding: 0.5rem 0;
    color: #a0a0a0;
    display: flex;
    align-items: center;
}

.scout-features li::before {
    content: "\2713";
    color: #667eea;
    font-weight: bold;
    margin-right: 0.75rem;
}

.billing-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.toggle-label {
    color: #a0a0a0;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.toggle-label.active {
    color: #fff;
    font-weight: 500;
}

.save-badge {
    background: #4caf50;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.price-note {
    color: #4caf50;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.results-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.results-card h2 {
    color: #fff;
    text-transform: capitalize;
    margin-bottom: 1.5rem;
    text-align: center;
}

.head-to-head-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.head-to-head-section h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.stat-box {
    text-align: center;
}

.stat-box .stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stat-box .stat-value.win {
    color: #4caf50;
}

.stat-box .stat-value.loss {
    color: #f44336;
}

.stat-box .stat-value.draw {
    color: #ff9800;
}

.stat-box .stat-label {
    font-size: 0.85rem;
    color: #a0a0a0;
}

.weakness-section {
    margin-bottom: 2rem;
}

.weakness-section h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.weakness-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.weakness-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.weakness-name {
    font-weight: 500;
    color: #fff;
}

.weakness-stat {
    font-weight: 600;
}

.weakness-stat.loss {
    color: #f44336;
}

.weakness-games {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.advice-tip {
    color: #4caf50;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 6px;
}

.phase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.phase-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.phase-box.vulnerable {
    border: 1px solid #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.phase-name {
    display: block;
    color: #fff;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.phase-loss {
    display: block;
    color: #f44336;
    font-weight: 600;
}

.phase-games {
    display: block;
    color: #a0a0a0;
    font-size: 0.85rem;
}

.action-buttons {
    text-align: center;
    margin-top: 2rem;
}

.upgrade-prompt {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 2rem;
}

.upgrade-prompt h3 {
    color: #fff;
    margin-bottom: 0.5rem;
}

.upgrade-prompt p {
    color: #a0a0a0;
    margin-bottom: 1rem;
}

.upgrade-prompt .btn-primary {
    width: auto;
    display: inline-block;
}

.pricing-grid.three-tier {
    max-width: 1100px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pricing-features li.feature-disabled {
    color: #666;
}

.pricing-features li.feature-disabled::before {
    content: "\2717";
    color: #666;
}

.btn-secondary.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.training-videos-section {
    margin-top: 2rem;
}

.training-videos-section h3 {
    color: #fff;
    margin-bottom: 1rem;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.video-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, border-color 0.2s;
}

.video-card:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.5);
}

.video-card a {
    text-decoration: none;
}

.video-title {
    color: #fff;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.video-channel {
    color: #667eea;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.video-reason {
    color: #a0a0a0;
    font-size: 0.85rem;
}

.tier-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.tier-badge.basic {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.tier-badge.pro {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #1a1a2e;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .overall-stats {
        gap: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .billing-toggle {
        flex-wrap: wrap;
    }
    
    .stats-grid {
        gap: 1rem;
    }
}
