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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
}

header nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
}

header nav a:hover {
    text-decoration: underline;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.875rem;
}

.error {
    color: #e74c3c;
    margin-top: 10px;
}

.success {
    color: #27ae60;
    margin-top: 10px;
}

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

.stat-box {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-box .value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.stat-box .label {
    color: #7f8c8d;
    font-size: 0.875rem;
}

.guess-list {
    max-height: 400px;
    overflow-y: auto;
}

.guess-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.guess-item:last-child {
    border-bottom: none;
}

.guess-item.correct {
    border-left: 4px solid #27ae60;
}

.guess-item.incorrect {
    border-left: 4px solid #e74c3c;
}

.guess-country {
    font-weight: 500;
}

.guess-details {
    color: #7f8c8d;
    font-size: 0.875rem;
}

.map-table {
    width: 100%;
    border-collapse: collapse;
}

.map-table th,
.map-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.map-table th {
    background: #ecf0f1;
    font-weight: 600;
}

.token-list {
    list-style: none;
}

.token-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.bookmarklet-link {
    display: inline-block;
    background: #27ae60;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin: 20px 0;
}

.bookmarklet-link:hover {
    background: #219a52;
}

.instructions {
    background: #ffeaa7;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.instructions h3 {
    margin-bottom: 10px;
}

.instructions ol {
    margin-left: 20px;
}

.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    margin-bottom: 30px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}

.hidden {
    display: none;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Histogram styles */
.histogram-container {
    margin-top: 15px;
}

.histogram-subtitle {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.histogram-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.histogram-label {
    width: 140px;
    min-width: 140px;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    padding-right: 10px;
}

.histogram-link {
    color: #3498db;
    text-decoration: none;
}

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

.histogram-bar-container {
    flex: 1;
    background: #ecf0f1;
    border-radius: 4px;
    height: 28px;
    overflow: hidden;
}

.histogram-bar {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: 30px;
    transition: width 0.3s ease;
}

.histogram-bar.correct {
    background: #27ae60;
    color: white;
}

.histogram-bar.incorrect {
    background: #e74c3c;
    color: white;
}

.histogram-bar.confused {
    background: #f39c12;
    color: white;
}

.histogram-count {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Country link in dashboard */
.country-link {
    color: #3498db;
    text-decoration: none;
    cursor: pointer;
}

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