@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #0f1410;
    --bg-card: rgba(18, 28, 18, 0.92);
    --border: rgba(90, 143, 58, 0.45);
    --border-strong: #5a8f3a;
    --accent: #7cb342;
    --accent-hover: #8bc34a;
    --accent-dim: #a8d88a;
    --text: #f0f4ef;
    --text-muted: #9eb098;
    --danger: #e57373;
    --danger-bg: rgba(229, 115, 115, 0.15);
    --success: #81c784;
    --success-bg: rgba(129, 199, 132, 0.12);
    --input-bg: rgba(0, 0, 0, 0.35);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    --radius: 16px;
    --radius-sm: 10px;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(61, 122, 42, 0.25), transparent),
        radial-gradient(ellipse 60% 50% at 80% 90%, rgba(45, 90, 39, 0.2), transparent),
        linear-gradient(160deg, #0f1410 0%, #1a2e1a 50%, #0d120d 100%);
    z-index: -1;
}

a { color: var(--accent-dim); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.page-narrow { max-width: 480px; }

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #5a8f3a, #3d6b28);
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}

.nav-links { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.card + .card { margin-top: 20px; }

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--accent-dim);
}

.hero { text-align: center; padding: 36px 28px; }

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.hero .subtitle {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 1.05rem;
}

.address-box {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin: 20px 0 24px;
}

.address-field {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1.15rem;
    color: var(--accent-dim);
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(180deg, var(--accent), #558b2f);
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 179, 66, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--accent-hover), var(--accent));
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { background: rgba(255,255,255,0.1); }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(229, 115, 115, 0.35);
}

.btn-danger:hover { background: rgba(229, 115, 115, 0.25); }

.btn-sm { padding: 8px 14px; font-size: 0.875rem; }

.btn-icon { padding: 14px 16px; min-width: 52px; }

.btn-icon svg { display: block; flex-shrink: 0; }

.btn-icon.copied {
    background: linear-gradient(180deg, #689f38, #558b2f);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    text-align: left;
}

.info-item {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.info-item label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-item span { font-weight: 600; font-size: 0.95rem; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
}

.status-badge.online {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(129, 199, 132, 0.3);
}

.status-badge.offline {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(229, 115, 115, 0.3);
}

.status-badge.checking {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.online .status-dot { animation: pulse 2s infinite; }

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

.form-group { margin-bottom: 18px; text-align: left; }

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.15);
}

.form-input::placeholder { color: #6a7a64; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.3);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: var(--accent);
    color: #fff;
}

.msg {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.msg.error { background: var(--danger-bg); color: #ffcdd2; border: 1px solid rgba(229,115,115,0.3); }
.msg.ok { background: var(--success-bg); color: #c8e6c9; border: 1px solid rgba(129,199,132,0.3); }

.hidden { display: none !important; }

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #2e4a2e;
    color: var(--accent-dim);
    padding: 12px 24px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s;
    z-index: 100;
    box-shadow: var(--shadow);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Player profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.skin-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

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

.profile-info h2 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.profile-info p { color: var(--text-muted); font-size: 0.9rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.stat-card {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-dim);
    line-height: 1.2;
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.player-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.player-list li:last-child { border-bottom: none; }

.player-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.player-name img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    image-rendering: pixelated;
    background: rgba(0,0,0,0.3);
}

.player-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.section-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
    font-size: 0.95rem;
}

.cta-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-header h1 { font-size: 1.5rem; }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(124, 179, 66, 0.15);
    color: var(--accent-dim);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

@media (max-width: 560px) {
    .address-box { flex-direction: column; }
    .profile-header { justify-content: center; text-align: center; }
}
