* { box-sizing: border-box; margin: 0; padding: 0; }
html { max-width: 100%; }
body { font-family: 'DM Mono', monospace; font-weight: 400; background: #1a1a1a; color: #d1d5db; min-height: 100vh; max-width: 100%; overflow-x: hidden; }
a { color: #2196F3; text-decoration: none; }
a:hover { text-decoration: underline; color: #1976D2; }
h1 { color: #ffffff; margin-bottom: 16px; overflow-wrap: anywhere; }
h2 { color: #ffffff; margin: 20px 0 10px; font-size: 16px; text-transform: uppercase; letter-spacing: 0.5px; overflow-wrap: anywhere; }
p, li, dd, .msg, .empty-state, .user-callout { overflow-wrap: anywhere; }
img, video, canvas, svg { max-width: 100%; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px; min-width: 0; }
.card { background: #2d2d2d; border-radius: 12px; padding: 20px; margin-bottom: 16px; border: 3px solid #404040; box-shadow: 0 8px 32px rgba(0,0,0,0.4); min-width: 0; overflow: hidden; overflow-wrap: anywhere; }
.card > *, .stat-card > *, .user-overview-card > * { max-width: 100%; min-width: 0; }
.card-sm { max-width: 450px; margin: 80px auto; }
.card-md { max-width: 700px; margin: 40px auto; }
.card-narrow { max-width: 600px; margin-left: auto; margin-right: auto; }
table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #404040; }
th { background: #2196F3; color: #ffffff; font-weight: 400; text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px; border: none; }
th:first-child { border-top-left-radius: 0; }
th:last-child { border-top-right-radius: 0; }
td { color: #d1d5db; background: #1a1a1a; }
tr:nth-child(even) td { background: #222222; }
tr:hover td { background: #2a2a2a; }
input[type=text], input[type=password], select, textarea { background: #1a1a1a; color: #ffffff; border: 2px solid #404040; padding: 10px 12px; border-radius: 8px; width: 100%; min-width: 0; max-width: 100%; margin: 4px 0; font-size: 14px; font-family: 'DM Mono', monospace; transition: all 0.2s ease; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #2196F3; background: #222222; }
button, input[type=submit], .btn { background: #2196F3; color: #ffffff; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 400; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; text-align: center; text-transform: uppercase; letter-spacing: 1px; transition: all 0.2s ease; font-family: 'DM Mono', monospace; min-height: 40px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
button:hover, input[type=submit]:hover, .btn:hover { background: #1976D2; color: #ffffff; transform: translateY(-1px); }
.btn-secondary { background: #404040; color: #ffffff; }
.btn-secondary:hover { background: #5a5a5a; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-warn { background: #f39c12; color: #1a1a1a; }
.btn-warn:hover { background: #e67e22; }
.btn-success { background: #2ecc71; color: #1a1a1a; }
.btn-success:hover { background: #27ae60; }
.btn-sm { padding: 5px 12px; font-size: 12px; min-height: 32px; }
.btn-block { width: 100%; }
.btn-action { min-width: 110px; }
.status-active { color: #2ecc71; font-weight: bold; }
.status-pending { color: #f39c12; font-weight: bold; }
.status-suspended { color: #e74c3c; font-weight: bold; }
.status-ended { color: #e74c3c; }
label { font-size: 14px; color: #e0e0e0; display: block; margin: 8px 0 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.msg-ok { background: #1a3a1a; border: 2px solid #2ecc71; }
.msg-err { background: #3a1a1a; border: 2px solid #e74c3c; }
.nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px 0; margin-bottom: 16px; border-bottom: 2px solid #404040; gap: 16px; min-width: 0; }
.brand-link { font-size: 18px; font-weight: 400; color: #2196F3; overflow-wrap: anywhere; }
.brand-link:hover { text-decoration: none; color: #7cc4ff; }
.nav-links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav-links > *, .page-actions > *, .section-actions > *, .btn-toolbar > *, .actions-cell > * { min-width: 0; max-width: 100%; }
.nav-links a { padding: 7px 10px; border-radius: 8px; color: #d1d5db; }
.nav-links a:hover { background: #2a2a2a; text-decoration: none; color: #fff; }
.logout-btn { background: none; border: none; color: #e74c3c; cursor: pointer; font: inherit; padding: 7px 10px; min-height: 0; letter-spacing: 0; text-transform: none; }
.logout-btn:hover { background: #2a2a2a; color: #ff8a80; transform: none; }
.nav-link-active { background: #2196F3; color: #fff !important; }
.nav-link-admin { border: 1px solid #404040; }
.page-shell { margin-bottom: 18px; min-width: 0; }
.page-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; min-width: 0; }
.page-hero > div { min-width: 0; }
.eyebrow { color: #7cc4ff; text-transform: uppercase; letter-spacing: 1.2px; font-size: 12px; margin-bottom: 6px; }
.page-copy { color: #9ca3af; max-width: 720px; line-height: 1.6; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.subnav-link { padding: 10px 14px; border-radius: 999px; background: #222222; border: 1px solid #404040; color: #d1d5db; }
.subnav-link:hover { background: #2a2a2a; text-decoration: none; color: #ffffff; }
.subnav-link-active { background: #2196F3; border-color: #2196F3; color: #ffffff; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; min-width: 0; }
.stat-card { background: linear-gradient(180deg, #2b2b2b 0%, #202020 100%); border: 1px solid #404040; border-radius: 12px; padding: 16px; min-width: 0; overflow: hidden; }
.stat-label { color: #9ca3af; text-transform: uppercase; letter-spacing: 0.8px; font-size: 11px; margin-bottom: 8px; }
.stat-value { color: #ffffff; font-size: 28px; line-height: 1.2; margin-bottom: 6px; overflow-wrap: anywhere; }
.admin-stat-text { font-size: 16px; line-height: 1.4; word-break: normal; }
.stat-meta { color: #9ca3af; font-size: 12px; }
.page-shell .flip-counter {
  display: inline-flex;
  align-items: flex-start;
  gap: 0;
  margin: 0 0 6px;
}
.page-shell .flip-counter-char {
  position: relative;
  display: inline-block;
}
.page-shell .flip-counter-char.is-digit {
  min-width: 0.62em;
  overflow: hidden;
}
.page-shell .flip-counter-char.is-separator {
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  white-space: pre;
}
.page-shell .flip-counter-sizer {
  display: block;
  color: transparent;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  white-space: pre;
  user-select: none;
  pointer-events: none;
}
.page-shell .flip-counter-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  white-space: pre;
  transition: transform 0.17s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
.page-shell .flip-counter-value.is-current {
  transform: translateY(0);
}
.page-shell .flip-counter-value.is-next {
  transform: translateY(-100%);
}
.page-shell .flip-counter-char.animating .flip-counter-value.is-current {
  transform: translateY(100%);
}
.page-shell .flip-counter-char.animating .flip-counter-value.is-next {
  transform: translateY(0);
}
.page-shell .flip-counter-char.no-transition .flip-counter-value {
  transition: none;
}
.section-card { margin-bottom: 18px; min-width: 0; }
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty-state { color: #9ca3af; background: #1a1a1a; border: 1px dashed #404040; border-radius: 10px; padding: 14px; }
.user-shell .page-copy { max-width: 620px; }
.user-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.user-stat-card {
  background: linear-gradient(180deg, #2d2d2d 0%, #232323 100%);
  border: 1px solid #404040;
  box-shadow: inset 0 1px 0 rgba(124, 196, 255, 0.05);
}
.user-stat-value { font-size: 22px; }
.user-overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.user-overview-card {
  background: linear-gradient(180deg, #262626 0%, #1f1f1f 100%);
  border: 1px solid #404040;
  border-radius: 10px;
  padding: 14px;
  min-width: 0;
}
.user-overview-value { color: #ffffff; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.user-callout {
  background: #202020;
  border: 1px solid #404040;
  border-left: 3px solid #2196F3;
  color: #d1d5db;
  border-radius: 10px;
  padding: 14px;
}
.user-refresh-note { color: #9ca3af; font-size: 12px; margin: 12px 0 10px; }
.hero { text-align: center; padding: 60px 20px; }
.hero h1 { font-size: 32px; margin-bottom: 12px; color: #ffffff; }
.hero p { color: #9ca3af; font-size: 16px; margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; }
.hero .btn { margin: 0 8px; padding: 12px 28px; font-size: 16px; }
.form-group { margin-bottom: 12px; }
.inline-form { display: inline; }
#verify-result { margin-top: 12px; }
.info-table th { background: #2196F3 !important; color: #ffffff !important; text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px; font-weight: 400; width: 130px; white-space: nowrap; border-bottom: 1px solid #1a6fb5; border-radius: 0 !important; border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
.info-table td { border-bottom: 1px solid #404040; background: #1a1a1a; }
.info-table tr:nth-child(even) td { background: #222222; }
.info-table tr:hover td { background: #2a2a2a; }
.info-table { border-radius: 8px; overflow: hidden; border: 1px solid #404040; margin: 8px 0; max-width: 100%; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }
.table-wrapper, .table-wrap { display: block; width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scrollbar-width: thin; touch-action: pan-x pan-y; border-radius: 8px; border: 1px solid #404040; -webkit-overflow-scrolling: touch; }
.table-wrapper table, .table-wrap table { margin: 0; width: 100%; min-width: 640px; max-width: none; }
.table-wrapper th, .table-wrapper td, .table-wrap th, .table-wrap td { overflow-wrap: anywhere; }
.table-wrapper .data-table, .table-wrap .data-table { min-width: 780px; }
.war-time-cell { font-size: 12px; }
.war-time-short { display: none; }
.admin-wars-table .btn-action { min-width: 72px; padding-left: 12px; padding-right: 12px; }
.table-wrapper tr:last-child td, .table-wrap tr:last-child td { border-bottom: none; }
td { vertical-align: middle; }
.table-cell-wrap { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.card > .info-table { table-layout: fixed; }
.card > .info-table th { width: 32%; white-space: normal; overflow-wrap: anywhere; }
.card > .info-table td { overflow-wrap: anywhere; word-break: break-word; }
.admin-users-table-wrapper { overflow-x: auto; }
.admin-users-table {
  width: 100%;
  max-width: 100%;
  min-width: 820px !important;
  table-layout: fixed;
}
.admin-users-table th,
.admin-users-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.admin-users-table th:nth-child(1),
.admin-users-table td:nth-child(1) { width: 23%; }
.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) { width: 23%; }
.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) { width: 10%; }
.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) { width: 14%; }
.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) { width: 30%; }
.admin-users-actions {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.admin-users-actions .inline-form,
.admin-users-actions > a {
  display: flex;
  width: 100%;
}
.admin-users-actions .user-action-btn {
  width: 100%;
  min-width: 0;
}
.admin-users-mobile-list { display: none; }
.actions-cell { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-header h1, .section-header h2 { margin: 0; }
.section-header p { margin: 4px 0 0; color: #9ca3af; font-size: 13px; }
.btn-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-toolbar .inline-form { display: inline-flex; }
.btn-toolbar .btn,
.btn-toolbar button,
.btn-toolbar input[type=submit] { min-width: 140px; }
.table-actions { min-width: 260px; }
.user-actions { min-width: 260px; }
.user-actions .inline-form { display: inline-flex; }
.user-action-btn {
  min-width: 92px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #404040 !important;
  color: #ffffff !important;
}
.user-action-btn:hover {
  background: #5a5a5a !important;
}
details { margin-top: 16px; }
summary { cursor: pointer; color: #9ca3af; font-size: 13px; font-family: 'DM Mono', monospace; overflow-wrap: anywhere; }
summary > * { min-width: 0; }
summary:hover { color: #2196F3; }
.pagination { display: flex; gap: 8px; align-items: center; margin: 16px 0; justify-content: center; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 6px; font-size: 13px; max-width: 100%; overflow-wrap: anywhere; }
.pagination a { background: #404040; color: #fff; }
.pagination a:hover { background: #2196F3; text-decoration: none; }
.pagination .current { background: #2196F3; color: #fff; }
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: end; flex-wrap: wrap; }
.search-bar input[type=text] { max-width: 300px; }
.search-bar select { background: #1a1a1a; color: #fff; border: 2px solid #404040; padding: 10px 12px; border-radius: 8px; font-family: 'DM Mono', monospace; font-size: 14px; }
.admin-users-filter { flex-wrap: nowrap; align-items: flex-end; overflow-x: auto; padding-bottom: 4px; }
.admin-users-filter > div { flex: 0 0 170px; min-width: 0; }
.admin-users-filter > div:first-of-type { flex-basis: 280px; }
.admin-users-filter > div:nth-of-type(3) { flex-basis: 170px; }
.admin-users-filter label { font-size: 12px; }
.admin-users-filter-actions { display: flex; align-items: center; gap: 8px; }
.admin-users-filter-actions .btn { min-width: 110px; min-height: 42px; }
.checkbox-group { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.checkbox-group input[type=checkbox] { width: 18px; height: 18px; accent-color: #2196F3; }
.checkbox-group label { margin: 0; text-transform: none; font-size: 14px; }
.consent-label { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; text-transform: none; letter-spacing: 0; line-height: 1.5; }
.consent-label input[type=checkbox] { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; accent-color: #2196F3; }
.consent-label span { min-width: 0; overflow-wrap: anywhere; }
.consent-label a { display: inline; }
.login-submit, .login-register-link { margin-top: 12px; }
.login-forgot-link { margin-top: 4px; }
.text-center { text-align: center; }
.text-muted { color: #9ca3af; }
.lead-sm { font-size: 13px; line-height: 1.6; }
.divider { border: none; border-top: 1px solid #404040; margin: 20px 0; }
.error-card { max-width: 500px; margin: 80px auto 0; }
.error-home-link { display: block; text-align: center; margin-top: 16px; }

@media (max-width: 900px) {
  .user-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding: 8px 10px; font-size: 12px; }
  .table-wrapper th, .table-wrapper td, .table-wrap th, .table-wrap td { white-space: nowrap; overflow-wrap: normal; }
  .table-wrapper .table-cell-wrap, .table-wrap .table-cell-wrap { min-width: 180px; max-width: 420px; white-space: normal; overflow-wrap: anywhere; }
  .table-wrapper table, .table-wrap table { width: max-content; min-width: 100%; }
  .table-wrapper .data-table, .table-wrap .data-table { min-width: 780px; }
  .table-wrapper .policy-table { width: 100%; min-width: 0; table-layout: fixed; }
  .table-wrapper .policy-table th, .table-wrapper .policy-table td { white-space: normal; overflow-wrap: anywhere; }
  .table-wrapper .policy-table th:first-child, .table-wrapper .policy-table td:first-child { width: 34%; }
  .table-wrapper .btn, .table-wrap .btn { white-space: nowrap; }
  .table-wrapper .active-wars-table { min-width: 500px; }
  .active-wars-table .btn-action { min-width: 58px; padding-left: 8px; padding-right: 8px; }
  .table-wrapper .war-history-table { width: 100%; table-layout: fixed; }
  .table-wrapper .admin-war-history-table { min-width: 620px; }
  .admin-war-history-table th:nth-child(1), .admin-war-history-table td:nth-child(1) { width: 12%; }
  .admin-war-history-table th:nth-child(2), .admin-war-history-table td:nth-child(2) { width: 21%; }
  .admin-war-history-table th:nth-child(3), .admin-war-history-table td:nth-child(3) { width: 21%; }
  .admin-war-history-table th:nth-child(4), .admin-war-history-table td:nth-child(4),
  .admin-war-history-table th:nth-child(5), .admin-war-history-table td:nth-child(5) { width: 17%; }
  .admin-war-history-table th:nth-child(6), .admin-war-history-table td:nth-child(6) { width: 12%; }
  .table-wrapper .user-war-history-table { min-width: 540px; }
  .user-war-history-table th:nth-child(1), .user-war-history-table td:nth-child(1) { width: 14%; }
  .user-war-history-table th:nth-child(2), .user-war-history-table td:nth-child(2) { width: 28%; }
  .user-war-history-table th:nth-child(3), .user-war-history-table td:nth-child(3),
  .user-war-history-table th:nth-child(4), .user-war-history-table td:nth-child(4) { width: 21%; }
  .user-war-history-table th:nth-child(5), .user-war-history-table td:nth-child(5) { width: 16%; }
  .war-time-full { display: none; }
  .war-time-short { display: inline; white-space: nowrap; }
  .admin-users-table-wrapper { display: none; }
  .admin-users-mobile-list { display: block; width: 100%; overflow: hidden; border: 1px solid #404040; border-radius: 8px; }
  .admin-users-mobile-table { width: 100%; margin: 0; table-layout: fixed; }
  .admin-users-mobile-table th:nth-child(1), .admin-users-mobile-table td:nth-child(1) { width: 22%; }
  .admin-users-mobile-table th:nth-child(2), .admin-users-mobile-table td:nth-child(2) { width: 38%; }
  .admin-users-mobile-table th:nth-child(3), .admin-users-mobile-table td:nth-child(3) { width: 40%; }
  .admin-users-mobile-table td { overflow-wrap: anywhere; }
  .admin-users-mobile-table .user-action-btn { width: 100%; min-width: 0; }
}

/* Mobile */
@media (max-width: 600px) {
  .container { padding: 12px; }
  .card { padding: 14px; }
  .card-sm { margin-top: 40px; }
  .card-md { margin-top: 24px; }
  .hero { padding: 30px 12px; }
  .hero h1 { font-size: 22px; }
  .hero .btn { display: block; margin: 8px 0; }
  .nav { flex-wrap: wrap; gap: 8px; }
  .nav-links { gap: 8px; font-size: 13px; justify-content: flex-start; }
  .nav-links a { padding: 6px 8px; }
  .page-hero { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
  .user-overview-grid { grid-template-columns: 1fr; }
  .subnav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .subnav-link { white-space: nowrap; }
  h1 { font-size: 20px; }
  .info-table th { width: auto; white-space: normal; }
  .admin-users-table th,
  .admin-users-table td { white-space: normal; }
  .admin-users-table th:nth-child(1),
  .admin-users-table td:nth-child(1),
  .admin-users-table th:nth-child(2),
  .admin-users-table td:nth-child(2),
  .admin-users-table th:nth-child(3),
  .admin-users-table td:nth-child(3),
  .admin-users-table th:nth-child(4),
  .admin-users-table td:nth-child(4),
  .admin-users-table th:nth-child(5),
  .admin-users-table td:nth-child(5) { width: auto; }
  .admin-users-actions { grid-template-columns: 1fr; }
  .admin-users-table { min-width: 720px !important; }
  .search-bar:not(.admin-users-filter) { flex-direction: column; }
  .search-bar.admin-users-filter { flex-direction: row; flex-wrap: nowrap; align-items: flex-end; }
  .search-bar input[type=text] { max-width: 100%; }
  .actions-cell { gap: 3px; }
  .btn-toolbar { flex-direction: column; align-items: stretch; }
  .btn-toolbar .btn,
  .btn-toolbar button,
  .btn-toolbar input[type=submit] { width: 100%; min-width: 0; }
  .table-actions { min-width: 0; }
  .user-actions { min-width: 0; }
  .user-action-btn { min-width: 84px; }
  .btn-sm { padding: 4px 8px; font-size: 11px; }
  .pagination { flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .container { padding: 8px; }
  .card { padding: 12px; }
  .nav-links { gap: 4px; }
  .nav-links a, .logout-btn { padding-left: 6px; padding-right: 6px; }
  button, input[type=submit], .btn { padding-left: 12px; padding-right: 12px; letter-spacing: 0.6px; }
}
