/* static/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background: #0f111a;
    color: #cbd5e0;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
}
a {
    color: #ff6c00;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
/* Шапка */
#header {
    width: 100%;
    background: #1a1d2e;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}
#header nav {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.nav-btn {
    background: #ff6c00;
    color: white;
    padding: 8px 18px;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95em;
}
.nav-btn:hover {
    background: #e65c00;
    text-decoration: none;
}
/* Контейнер контента */
.container {
    max-width: 600px;
    width: 100%;
    background: #1a1d2e;
    padding: 25px;
    border-radius: 8px;
    margin: 0 auto 30px auto;
    text-align: center;
}
h1 {
    color: #ff6c00;
    margin-bottom: 15px;
}
/* Формы */
input, button {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    border: 1px solid #333;
    background: #222;
    color: #ddd;
    font-size: 1em;
}

#error, #message {
    color: #ff5555;
    margin-top: 10px;
}
.legal {
    font-size: 0.85em;
    color: #888;
    margin-top: 15px;
}
/* Футер */
#footer {
    width: 100%;
    margin-top: auto;
    padding: 15px 20px;
    background: #1a1d2e;
    border-radius: 8px;
    text-align: center;
    color: #718096;
    font-size: 0.85em;
}
#footer a {
    color: #ff6c00;
}


/* Существующие стили остаются, в конец файла добавить: */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.form-row label {
    width: 160px;
    flex-shrink: 0;
    color: #ff6c00;
    text-align: right;
    margin-right: 10px;
}
.form-row input {
    flex: 1;
    margin: 0;
}
.course-info {
    border: 2px solid #00aaff;
    background: #0a1a2a;
    color: #00aaff;
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}
.balance-info {
    border: 2px solid #00aaff;
    background: #0a1a2a;
    color: #00aaff;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 1.2em;
}


/* meta */
.meta-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; color: #ccc; }
.meta-table th, .meta-table td { padding: 6px 10px; border: 1px solid #333; text-align: left; }
.meta-table th { background: #111; color: #0f0; position: sticky; top: 0; }
.trend-up { color: #0f0; }
.trend-down { color: #f00; }
.trend-new { color: #ff0; }
.trend-same { color: #aaa; }
.rank { text-align: right; }

/* profile */
.profile-section { margin-bottom: 25px; text-align: left; }
.profile-section label { display: block; margin-bottom: 5px; color: #ff6c00; font-weight: bold; }
.profile-section input { width: 100%; }
.profile-section p { margin: 5px 0; color: #cbd5e0; }
.success { color: #0f0; margin-top: 5px; }
.error { color: #ff5555; margin-top: 5px; }
.verified { color: #00cc66; }
.unverified { color: #ffaa00; }

/* admin */
.admin-panel { background: #1a1d2e; border: 1px solid #ff6c00; border-radius: 8px; padding: 20px; margin: 20px auto; max-width: 600px; text-align: left; }
.evo-status { margin: 10px 0; padding: 10px; background: #222; border-radius: 4px; }
.evo-bar { height: 20px; background: #333; border-radius: 10px; overflow: hidden; margin: 5px 0; }
.evo-bar-fill { height: 100%; background: linear-gradient(90deg, #00aaff, #ff6c00); width: 0%; transition: width 0.5s ease; border-radius: 10px; }
.evo-btn { background: #ff6c00; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.evo-btn:hover { background: #e65c00; }
.evo-btn:disabled { opacity: 0.5; cursor: not-allowed; }


/* Стили для экрана загрузки */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}
.loader-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255,255,255,0.2);
  border-top-color: #ff6c00;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-message {
  margin-top: 20px;
  color: #cbd5e0;
  font-size: 1em;
  text-align: center;
}

/* Базовый стиль для всех кнопок (голубой контур) */
button,
.nav-btn,
.evo-btn {
    background: transparent;
    color: #00aaff;
    border: 2px solid #00aaff;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.3s ease;
    display: inline-block;
    line-height: 1.2;
}

button:hover,
.nav-btn:hover,
.evo-btn:hover {
    box-shadow: 0 0 14px rgba(0, 170, 255, 0.7);
    border-color: #66ccff;
    color: #66ccff;
    text-decoration: none;
}

/* Отключённые кнопки (серый контур) */
button:disabled,
.nav-btn:disabled,
.evo-btn:disabled {
    border-color: #555;
    color: #555;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Админская кнопка (оранжевый контур) */
.admin-btn {
    background: transparent;
    color: #ff6c00;
    border: 2px solid #ff6c00;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.admin-btn:hover {
    box-shadow: 0 0 14px rgba(255, 108, 0, 0.7);
    border-color: #ffaa33;
    color: #ffaa33;
    text-decoration: none;
}

.admin-btn:disabled {
    border-color: #555;
    color: #555;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

@keyframes flipIn {
  0% { transform: rotateY(90deg); opacity:0; }
  100% { transform: rotateY(0deg); opacity:1; }
}

.modal-overlay {
  position: fixed; top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,0.8); display:flex; align-items:center; justify-content:center;
  z-index:1000;
}
.modal-content {
  background: #1a1d2e; border: 2px solid #00aaff; border-radius:12px;
  padding:20px; max-width:700px; width:90%; text-align:center;
}


/* Вкладки верхней панели */
.nav-icon {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.15); /* всегда видна тонкая рамка */
  border-radius: 8px;
  text-decoration: none;
  color: #cbd5e0;
  transition: border-color 0.3s, box-shadow 0.3s, z-index 0s;
  overflow: visible;
  z-index: 1;
  background: transparent;
  flex-shrink: 0; /* чтобы не сжимались */
}

.nav-icon:hover {
  border-color: #00aaff;
  box-shadow: 0 0 10px rgba(0,170,255,0.4);
  z-index: 10; /* текст будет поверх соседей */
}

/* Иконка (по центру) */
.nav-icon-symbol {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  transition: opacity 0.2s ease;
  pointer-events: none; /* чтобы клик проходил на ссылку */
}

/* Текстовая метка (скрыта, выезжает вправо) */
.nav-icon-label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  opacity: 0;
  font-size: 0.9rem;
  font-weight: bold;
  padding: 0 10px;
  background: #1a1d2e; /* фон как у шапки */
  border-radius: 6px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* При наведении иконка исчезает, появляется текст */
.nav-icon:hover .nav-icon-symbol {
  opacity: 0;
}
.nav-icon:hover .nav-icon-label {
  opacity: 1;
}

/* Админская кнопка (оранжевая рамка при наведении) */
a.nav-icon[href="/admin"]:hover {
  border-color: #ff6c00;
  box-shadow: 0 0 10px rgba(255,108,0,0.4);
}

/* Подсказка в стиле MTG */
.unit-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  max-width: 250px;
  background: #0d0d0d;
  border: 2px solid #b87c2c;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.8);
  color: #e0d8c0;
  font-size: 0.85em;
  padding: 10px;
  opacity: 0.96;
  transition: opacity 0.2s ease;
}

.tooltip-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tooltip-portrait {
  width: 100%;
  height: 100px;
  background: #2a2a2a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.8em;
  border: 1px solid #444;
  margin-bottom: 4px;
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: bold;
}

.tooltip-name {
  font-size: 1.1em;
}

.tooltip-elo {
  color: #aaa;
  font-size: 0.9em;
}

.tooltip-skills {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 0.8em;
}

.tooltip-stats {
  font-size: 0.8em;
  line-height: 1.4;
  color: #ccc;
}

.tooltip-meta {
  font-size: 0.8em;
  color: #bbb;
  border-top: 1px solid #333;
  padding-top: 4px;
}

/* Мобильная адаптация */
@media (max-width: 600px) {
  body { padding: 10px; }
  #header { padding: 8px 10px; }
  #header nav {
    gap: 4px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .nav-icon { width: 36px; height: 36px; flex-shrink: 0; }
  .nav-icon-symbol { font-size: 1.4rem; }
  .container { padding: 15px; margin: 0; max-width: 100%; }
  .meta-table { display: block; overflow-x: auto; white-space: nowrap; }
  #free-units { grid-template-columns: repeat(4, 1fr) !important; }
  #banks-container { flex-direction: column; align-items: center; }
  .bank-card { width: 100%; max-width: 300px; }
  .evo-btn, .admin-btn, button { font-size: 0.8rem; padding: 6px 10px; }
  .modal-content { width: 95%; padding: 10px; }
}