/* ===== Mobile-first CSS ===== */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: #f5f5f5;
    color: #333;
    height: 100%;
    overflow-x: hidden;
}

.page-container {
    min-height: 100vh;
    padding-bottom: 80px; /* space for bottom nav */
}

/* Header */
.app-header {
    background: #2c7a7b;
    color: white;
    padding: 12px 16px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Content */
.content {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-around;
    padding: 4px 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 8px;
    text-decoration: none;
    color: #888;
    min-width: 48px;
    min-height: 48px;
    font-size: 0.7rem;
    transition: color 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.nav-item.active {
    color: #2c7a7b;
}

.nav-icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    min-width: 48px;
    transition: transform 0.1s, opacity 0.2s;
    text-align: center;
}

.btn:active {
    transform: scale(0.97);
}

.btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn.loading::after {
    content: '...';
}

.btn-primary {
    background: #2c7a7b;
    color: white;
}

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

.btn-secondary {
    background: #e2e8f0;
    color: #333;
}

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

/* Player cards */
.player-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.player-card {
    background: white;
    border-radius: 10px;
    padding: 10px 4px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    user-select: none;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
}

.player-card:active {
    transform: scale(0.97);
}

.player-card.selected {
    border-color: #2c7a7b;
    background: #e6fffa;
    color: #2c7a7b;
    box-shadow: 0 0 0 3px rgba(44, 122, 123, 0.3);
}

.player-card.admin-add {
    border-style: dashed;
    border-color: #2c7a7b;
    color: #2c7a7b;
    font-size: 1.2rem;
}

/* Admin delete button on player card */
.player-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    background: none;
    border: none;
    padding: 2px 4px;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.5;
    line-height: 1;
}
.player-delete:active {
    opacity: 1;
    transform: scale(1.1);
}

/* Forms */
input, select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    min-height: 48px;
    -webkit-appearance: none;
}

input:focus, select:focus {
    outline: none;
    border-color: #2c7a7b;
}

/* Toast */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 200;
    pointer-events: none;
    white-space: nowrap;
}

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

.toast.success {
    background: #38a169;
}

.toast.error {
    background: #e53e3e;
}

/* Admin badge */
.admin-badge {
    display: inline-block;
    background: #d69e2e;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* Utility */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mt-2 { margin-top: 16px; }
.w-full { width: 100%; }

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

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

th {
    font-weight: 600;
    color: #666;
}
