﻿/* styles.css */
:root {
  --bg: #e8f4f8;
  --card: #ffffff;
  --accent: #ffd700;
  --accent-hover: #ffed4e;
  --accent-disabled: #3a3a3a;
  --text: #1a1a2e;
  --muted: #5a6c7d;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: rgba(0, 0, 0, 0.1);
}

* { 
  box-sizing: border-box; 
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(135deg, #a8d8ea 0%, #d4f1f4 50%, #c9e4ea 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  flex-direction: row-reverse;
  gap: 40px;
  position: relative;
}

/* Для фонового изображения */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('assets/heroR.png');
  background-size: cover;
  background-position: center;
  opacity: 1;
  z-index: -1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.app {
  padding-top: 200px;
  width: 100%;
  max-width: 1720px;
  padding: 32px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}


header {
  position: relative; /* убираем fixed */
  top: auto;
  left: auto;
  transform: none;
  text-align: center;
  z-index: auto;
  margin-bottom: 200px; /* отступ от содержимого под header */
  display: flex;
  flex-direction: column;
  align-items: center;
}


header h1 {
  font-size: clamp(40px, 4vw, 72px);
  font-weight: 900;
  margin: 0;
  letter-spacing: -1px;
}

header p {
  margin: 0;
  margin-top: 8px; /* небольшой отступ между строками */
  color: var(--muted);
  font-size: 20px;
}

.card {
  background: transparent;
  border: none;
  box-shadow: none;
}


.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Убираем фиксированное позиционирование у табов */
.tabs {
  display: flex;
  gap: 0;
  justify-content: center;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 4px;
  position: relative;
  overflow: hidden;
}

/* Скользящий фон */
.tabs::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  background: var(--accent);
  border-radius: 999px;
  transition: transform 0.3s ease;
  left: 4px;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
  z-index: 1;
}

.tabs:has(.tab[data-tab="bosses"].active)::before {
  transform: translateX(100%);
}

.tab {
  padding: 12px 24px;
  font-size: 18px;
  border-radius: 999px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  transition: color 0.3s ease;
  position: relative;
  z-index: 2;
  flex: 1;
  text-align: center;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: transparent;
  color: var(--text);
}

/* Рулетка */
.roulette-slot {
  position: relative;
  width: 97vw;        /* на всю ширину экрана */
  height: 600px;
  margin: 0;
  left: 50%;
  transform: translateX(-50%); /* центрируем относительно viewport */

  overflow: hidden;
  background: rgba(255, 255, 255, 0);
  border-radius: 400px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}


.roulette-track {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 20px;
  padding: 0;
  will-change: transform;
}

.roulette-item {
  flex: 0 0 400px;
  height: 400px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(168, 216, 234, 0.6);
  background: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.roulette-item:hover {
  transform: scale(1.05);
}

.roulette-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.roulette-item.winner {
  flex: 0 0 440px;   /* +40px */
  height: 440px;
  transition: all 0.3s ease;
  z-index: 20;
}


/* Красивое кольцо для победителя */
.roulette-pointer,
.roulette-pointer::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.roulette-pointer {
  position: absolute;
  top: 50%;
  left: 49.6%;
  width: 430px;
  height: 430px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 15;

  /* SVG через background */
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 430 430'>\
<defs>\
  <linearGradient id='g' x1='0%' y1='0%' x2='100%' y2='100%'>\
    <stop offset='0%' stop-color='%232f5fff'/>\
    <stop offset='50%' stop-color='%238fd8ff'/>\
    <stop offset='100%' stop-color='%232f5fff'/>\
  </linearGradient>\
</defs>\
<circle cx='215' cy='215' r='212' fill='none' stroke='url(%23g)' stroke-width='4'/>\
</svg>");

  background-size: cover;
  background-repeat: no-repeat;

  animation: rotateClockwise 10s linear infinite;
  transition: transform 0.5s ease;
}

/* Состояние увеличения при спине */
.roulette-pointer.spinning {
  animation: rotateClockwise 10s linear infinite, scaleUpDownFast 5s ease;
}

.dashed-ring {
  position: absolute;
  top: 50%;
  left: 49.6%;
  width: 410px;
  height: 410px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 16;

  /* Пунктирное кольцо через SVG в CSS */
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 430 430'>\
<circle cx='215' cy='215' r='212' fill='none' stroke='%235aa9ff' stroke-width='2' stroke-dasharray='8 4'/>\
</svg>");

  background-size: cover;
  background-repeat: no-repeat;

  animation: rotateCounterClockwise 180s linear infinite;
  transition: transform 0.5s ease;
}

/* Состояние увеличения при спине */
.dashed-ring.spinning {
  animation: rotateCounterClockwise 180s linear infinite, scaleUpDownFast 5s ease;
}

/* Анимации */
@keyframes rotateClockwise {
  0%   { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes rotateCounterClockwise {
  0%   { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* Анимация масштабирования во время спина */
@keyframes scaleUpDown {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  25% {
    transform: translate(-50%, -50%) scale(1.15);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Быстрое увеличение, держим большим, быстрое уменьшение в конце */
@keyframes scaleUpDownFast {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  10% {
    transform: translate(-50%, -50%) scale(1.15);
  }
  85% {
    transform: translate(-50%, -50%) scale(1.15);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}



.info {
  text-align: center;
  height: 120px; /* фиксированная высота для имени + иконки, подберите под свой дизайн */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}


.info h2 {
  font-size: 56px;
  margin: 0;
  min-height: 56px; /* для страховки */
}


.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.badge {
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 16px;
  background: rgba(168, 216, 234, 0.2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
}

.actions {
  position: fixed;
  bottom: 20px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 400px;
  
  /* Добавь эти строки для эффекта стекла */
  background: rgba(255, 255, 255, 0.0);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}



button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 32px 32px;
  font-size: 23px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-main {
  background: var(--accent);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.35);
}

.btn-main:hover:not(:disabled) { 
  background: var(--accent-disabled);
  color: #e0e0e0;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(58, 58, 58, 0.35);
}

.btn-main:active:not(:disabled) { 
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.25);
}

/* Состояние во время прокрутки */
.btn-main:disabled,
.btn-main.spinning {
  background: var(--accent-disabled);
  color: #888;
  cursor: not-allowed;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Стили для боссов */
.avatar {
  flex: 1;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid var(--border);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 768px) {
  .avatar {
    aspect-ratio: 1 / 1;
  }
  
  .roulette-item {
    flex: 0 0 80px;
    height: 80px;
  }
}

/* Стили для монетки */
.coin-flip {
  position: fixed;
  top: 30px;
  right: 30px;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  z-index: 1000;
}


.coin-flip button {
  background: var(--accent);
  color: var(--text);
  border-radius: 999px;
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.coin-flip button:hover {
  background: var(--accent-disabled);
  color: #e0e0e0;
  box-shadow: 0 8px 24px rgba(58, 58, 58, 0.3);
}

.coin-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.coin-container {
  perspective: 1000px;
  width: 200px;
  height: 200px;
}

.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.coin .front,
.coin .back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.coin .front img,
.coin .back img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.coin .back {
  transform: rotateY(180deg);
}

@keyframes spin-heads {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(1800deg); }
}

@keyframes spin-tails {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(1980deg); }
}

.coin.spin-heads {
  animation: spin-heads 2s ease-in-out forwards;
}

.coin.spin-tails {
  animation: spin-tails 2s ease-in-out forwards;
}

#coinText {
  min-height: 32px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text);
}

.element-icon {
  width: 48px;
  height: 48px;
  vertical-align: middle;
  margin-left: 8px;
}

@media (max-width: 420px) {
  .element-icon {
    width: 32px;
    height: 32px;
  }
}

#element {
  width: 60px; /* размер иконки */
  height: 60px; /* фиксируем высоту */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* История круток - выпадающий список */
.spin-history {
  position: fixed;
  top: 30px;
  left: 30px;
  width: 280px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  z-index: 1000;
  overflow: hidden;
}

.history-header {
  padding: 16px 20px;
  background: var(--accent);
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.history-header:hover {
  background: var(--accent-hover);
}

.history-header::after {
  content: '▼';
  font-size: 14px;
  transition: transform 0.3s ease;
}

.spin-history.open .history-header::after {
  transform: rotate(180deg);
}

.history-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.spin-history.open .history-list {
  max-height: 450px;
  overflow-y: auto;
}

.history-table-header {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.05);
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  border-bottom: 2px solid var(--border);
}

.history-table-row {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.history-table-row:hover {
  background: rgba(255, 215, 0, 0.15);
  transform: translateX(3px);
}

.history-table-row:last-child {
  border-bottom: none;
}

.history-col-time {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.history-col-name {
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-element-small {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.history-list::-webkit-scrollbar {
  width: 8px;
}

.history-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* История круток - выпадающий список */
.spin-history {
  position: fixed;
  top: 30px;
  left: 30px;
  width: 280px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  z-index: 1000;
  overflow: hidden;
}

.history-header {
  padding: 12px 16px;
  background: var(--accent);
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-header:hover {
  background: var(--accent-disabled);
  color: #e0e0e0;
}

.history-header::after {
  content: '▼';
  font-size: 12px;
  transition: transform 0.3s ease;
}

.spin-history.open .history-header::after {
  transform: rotate(180deg);
}

.history-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.spin-history.open .history-list {
  max-height: 400px;
  overflow-y: auto;
}

.history-table-header {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.05);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.history-table-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.2s ease;
}

.history-table-row:hover {
  background: rgba(255, 215, 0, 0.1);
}

.history-table-row:last-child {
  border-bottom: none;
}

.history-col-time {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.history-col-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-element-small {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

#bossesTab ~ .spin-history {
  display: none;
}

.tab-content.active#bossesTab ~ .spin-history {
  display: none;
}