/* Алфавитная рулетка навыков — стили */
html, body { margin: 0; padding: 0; background: #07080b; }
* { box-sizing: border-box; }

@keyframes omPulse { 0%, 100% { filter: brightness(1) saturate(1); } 50% { filter: brightness(1.3) saturate(1.25); } }
@keyframes landFlash { 0% { transform: scale(1.3); filter: brightness(2.6); } 40% { transform: scale(.95); filter: brightness(1.5); } 100% { transform: scale(1); filter: brightness(1); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spinBlur { 0%, 100% { filter: blur(0); opacity: 1; } 50% { filter: blur(2px); opacity: .5; } }
@keyframes shakeX { 0%, 100% { transform: none; } 20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, -1px); } 80% { transform: translate(3px, 1px); } }
@keyframes sparkFly { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

/* качество навыка: зеленый (тир 1 / нет в магазине убийцы), синий, фиолетовый */
.q0 { --g: linear-gradient(160deg, #55d44a, #1e9c28 55%, #0c5216); --c: #55d44a; --glow: 0 0 12px rgba(80, 220, 90, .45); }
.q1 { --g: linear-gradient(160deg, #3d7bff, #1c45cc 55%, #0a1e78); --c: #3d7bff; --glow: 0 0 14px rgba(80, 130, 255, .5); }
.q2 { --g: linear-gradient(160deg, #c650ff, #8a17e8 45%, #3c0575); --c: #c650ff; --glow: 0 0 18px rgba(190, 80, 255, .7); }

/* ромб перка с иконкой — как в магазине убийцы */
.pk { position: relative; flex-shrink: 0; }
.pk-d {
  position: absolute; inset: 13%; transform: rotate(45deg);
  background: var(--g); border: 5px solid #0c0d10;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .85), inset 0 0 16px rgba(0, 0, 0, .6), var(--glow);
}
.pk-d::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(100% 100% at 50% 50%, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, .5) 100%);
}
.pk-i {
  position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .8)); pointer-events: none;
}

.wrap {
  height: 100vh; overflow: hidden; padding: 18px 26px 16px;
  display: flex; flex-direction: column;
  font-family: 'PT Sans', sans-serif; color: #d8dde3;
  background: radial-gradient(120% 100% at 50% 0%, #1c2331 0%, #10141d 45%, #07080b 100%);
}

.title-row { position: relative; text-align: center; margin-bottom: 12px; flex: none; }
.title {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 30px;
  letter-spacing: 3px; color: #f0f3f6; text-transform: uppercase;
  text-shadow: 0 3px 8px rgba(0, 0, 0, .7);
}

/* ---- настройки звука (как в магазине убийцы) ---- */
.hdr-actions {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 14px;
}
.vol {
  display: flex; align-items: center; gap: 8px;
  background: rgba(14, 12, 18, .85); border: 1px solid #2a2230;
  padding: 7px 12px; font-family: 'Oswald', sans-serif; font-weight: 500;
  font-size: 12px; letter-spacing: 1px; color: #7d8794; cursor: pointer;
}
.vol:hover { border-color: #4a5260; color: #c9d2dc; }
.vol input { width: 70px; flex: 0 0 auto; accent-color: #d3222a; cursor: pointer; }
.vol-val { width: 4ch; flex: 0 0 auto; text-align: right; }
.ctl-btn {
  flex: 0 0 auto; text-align: center;
  padding: 9px 16px; background: rgba(14, 12, 18, .85); border: 1px solid #2a2230; cursor: pointer;
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 12px; letter-spacing: 2px;
  color: #7d8794; text-transform: uppercase;
}
.ctl-btn:hover { filter: brightness(1.6); }
/* фиксированная ширина, чтобы «вкл»/«выкл» не дергали ряд */
#btn-sound { width: 122px; }
.home-btn {
  display: inline-block; text-decoration: none;
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
}

.grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px;
  flex: 1; min-height: 0; max-width: 1600px; width: 100%; margin: 0 auto;
}

/* ---- панель игрока ---- */
.panel {
  display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0;
  padding: 14px 12px 10px;
  background: linear-gradient(170deg, #26334a 0%, #161e2e 65%, #0e131d 100%);
  border: 2px solid #3a4250;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .6);
  animation: riseIn .5s ease both;
}
.panel.killer {
  background: linear-gradient(170deg, #3a2126 0%, #241318 60%, #12090b 100%);
  border-color: #5a2a2e;
}

.head { display: flex; align-items: center; gap: 10px; flex: none; }
.avatar {
  position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%;
  overflow: hidden; background: #12151d; border: 3px solid #23262e; cursor: pointer;
  box-shadow: 0 8px 14px -4px rgba(0, 0, 0, .7);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.7) translate(0, 9%); }
.avatar:hover { filter: brightness(1.35); border-color: #3d7bff; }
.panel.killer .avatar:hover { border-color: #a3232c; }

.who { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.char-name {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 16px; letter-spacing: 1px;
  color: #f0f2f5; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-label {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 11px; letter-spacing: 2px;
  color: #a9b4c1; text-transform: uppercase;
}
.panel.killer .role-label { color: #d3222a; }

/* ---- переключатель языка ---- */
.lang-row { display: flex; gap: 6px; flex: none; }
.lang-btn {
  flex: 1; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 12px;
  letter-spacing: 2px; padding: 5px 0; cursor: pointer; text-transform: uppercase;
  border: 2px solid #2c3442; background: #0b0c0f; color: #4a5260;
}
.lang-btn:hover { filter: brightness(1.3); }
.lang-btn.active { border-color: #8d95a1; background: rgba(255, 255, 255, .08); color: #f0f3f6; }
.panel.killer .lang-btn.active { border-color: #d3222a; }

/* ---- окно с буквами ---- */
.window {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 76px; flex: none; background: rgba(0, 0, 0, .4);
  border: 1px solid #262c38; box-shadow: inset 0 0 24px rgba(0, 0, 0, .8);
}
.window.shake { animation: shakeX .45s ease; }

.tile {
  position: relative; width: 54px; height: 54px; flex: none;
  border: 5px solid #0e0f12; background: #151a24;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .85), inset 0 0 16px rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center;
}
.tile span {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 30px;
  color: #f2f4f6; text-shadow: 0 2px 6px rgba(0, 0, 0, .65);
}
.tile.idle span { color: #2c3442; font-size: 24px; }
.tile.spin { background: linear-gradient(160deg, #4a4f5a, #23262e); animation: spinBlur .25s linear infinite; }
.tile.spin span { color: #b7c0cb; }
.tile.land {
  background: linear-gradient(160deg, #3d7bff, #1c45cc 55%, #0a1e78);
  animation: landFlash .6s ease-out both, omPulse 2.4s ease-in-out .6s infinite;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .85), inset 0 0 16px rgba(0, 0, 0, .6), 0 0 22px rgba(80, 130, 255, .6);
}
.panel.killer .tile.land {
  background: linear-gradient(160deg, #c22a30, #7e1418 55%, #3a0608);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .85), inset 0 0 16px rgba(0, 0, 0, .6), 0 0 22px rgba(220, 30, 30, .75);
}

.spark {
  position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; border-radius: 50%;
  pointer-events: none; background: #9fc2ff; box-shadow: 0 0 8px #3d7bff;
  animation: sparkFly .7s ease-out both;
}
.panel.killer .spark { background: #ff5a4a; box-shadow: 0 0 8px #d3222a; }

.status {
  text-align: center; font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase; color: #8d95a1;
  min-height: 14px; flex: none;
}

/* ---- список навыков ---- */
.perk-list {
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto; min-height: 0; flex: 1; padding-right: 4px;
}
.perk {
  display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 6px; flex: none;
  background: rgba(0, 0, 0, .35); border: 1px solid #262c38;
  animation: riseIn .4s ease both;
}
.perk .pk { width: 84px; height: 84px; }
.perk .txt { min-width: 0; }
.perk .name {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 15px; letter-spacing: .5px;
  color: var(--c); text-transform: uppercase; line-height: 1.25;
}
.perk .sub { margin-top: 2px; font-size: 12px; color: #6d7682; }

/* выбор 4 навыков после рандома */
.perk-list.pickable .perk { cursor: pointer; }
.perk-list.pickable .perk:hover { filter: brightness(1.3); border-color: #4a5260; }
.perk { position: relative; }
.perk.sel { border-color: var(--c); box-shadow: var(--glow), inset 0 0 18px rgba(0, 0, 0, .5); cursor: pointer; }
.perk.sel::after {
  content: "✓"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 18px; color: var(--c);
  text-shadow: 0 0 8px var(--c);
}
.perk.sel .txt { padding-right: 22px; }
.perk.off { display: none; }

/* ---- дизайн скроллбара ---- */
.perk-list::-webkit-scrollbar, .roster-cards::-webkit-scrollbar { width: 11px; }
.perk-list::-webkit-scrollbar-track, .roster-cards::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, .45);
  border: 1px solid #1c212c;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .8);
}
.perk-list::-webkit-scrollbar-thumb, .roster-cards::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3a4a68, #232c40);
  border: 2px solid #0c0d10;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
}
.perk-list::-webkit-scrollbar-thumb:hover, .roster-cards::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #4c619c, #2c3854);
}
.panel.killer .perk-list::-webkit-scrollbar-track { border-color: #2c1518; }
.panel.killer .perk-list::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #6a2a30, #38151a); }
.panel.killer .perk-list::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #8c3a42, #4a1d24); }
.perk-list { scrollbar-width: thin; scrollbar-color: #3a4a68 rgba(0, 0, 0, .45); }
.panel.killer .perk-list { scrollbar-color: #6a2a30 rgba(0, 0, 0, .45); }
.roster-cards { scrollbar-width: thin; scrollbar-color: #3a4a68 rgba(0, 0, 0, .45); }

/* ---- кнопка ---- */
.roll-row { display: flex; justify-content: center; margin-top: 12px; flex: none; }
.roll-btn {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 19px; letter-spacing: 3px;
  text-transform: uppercase; color: #f0f3f6; padding: 12px 54px; border: none; cursor: pointer;
  background: linear-gradient(120deg, #5a4460, #3a2a44 70%, #241a2e);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .6);
}
.roll-btn:hover { filter: brightness(1.25); }
.roll-btn:disabled { opacity: .55; cursor: wait; filter: none; }

/* ---- ростер персонажей (как в магазине убийцы) ---- */
.ov {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: rgba(3, 4, 6, .93);
  font-family: 'PT Sans', sans-serif;
}
.ov-title {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 28px; letter-spacing: 5px;
  color: #f0e6e8; text-transform: uppercase; text-align: center;
}
.ov-hint { font-size: 13px; color: #7d8794; }

.roster-search {
  width: 420px; max-width: 90%; padding: 10px 16px;
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 17px; letter-spacing: 1.5px;
  color: #dfe5ec; background: rgba(14, 12, 16, .85); border: 2px solid #23262e;
  outline: none; text-transform: uppercase;
}
.roster-search::placeholder { color: #7d8794; text-transform: none; letter-spacing: 1px; }
.roster-search:focus { border-color: #3d7bff; }

.roster-cards {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  max-width: 1560px; max-height: 70vh; overflow: auto; padding: 4px;
}
.roster-card {
  width: 118px; padding: 14px 8px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(14, 12, 16, .85); border: 2px solid #23262e; cursor: pointer;
}
.roster-card.hide { display: none; }
.roster-card:hover { filter: brightness(1.35); }
.roster-card.cur { border-color: #3d7bff; }
.roster-card.cur.killer { border-color: #a3232c; }
.roster-card.taken { cursor: default; opacity: .4; }
.roster-av {
  width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
  background: #12151d; border: 3px solid #23262e;
}
.roster-av img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.7) translate(0, 9%); }
.roster-name {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 12.5px; letter-spacing: 1px;
  color: #dfe5ec; text-transform: uppercase; text-align: center; line-height: 1.25;
}
.roster-tag { min-height: 14px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #7d8794; }
.roster-tag.cur { color: #3d7bff; }
.roster-tag.curk { color: #d3222a; }

/* ---- список перков по буквам (как в магазине убийцы) ---- */
.pl-box {
  width: 1560px; max-width: 96%; max-height: 92%; padding: 26px 30px 28px;
  display: flex; flex-direction: column; gap: 18px;
  background: linear-gradient(160deg, #1a1420 0%, #100a12 60%); border: 2px solid #3a2a44;
  box-shadow: 0 0 50px rgba(120, 80, 180, .2), 0 30px 80px rgba(0, 0, 0, .8);
}
.pl-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.pl-title {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 20px; letter-spacing: 3px;
  color: #f0e6e8; text-transform: uppercase;
}
.pl-langs { display: flex; gap: 6px; margin-left: auto; }
.pl-langs .lang-btn { flex: none; width: 56px; }
.pl-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: #1c0e10; border: 1px solid #3a1418; cursor: pointer; font-size: 14px; color: #d3222a;
}
.pl-close:hover { filter: brightness(1.5); }
.pl-cols { display: flex; gap: 34px; overflow: auto; min-height: 0; }
.pl-cols::-webkit-scrollbar { width: 11px; }
.pl-cols::-webkit-scrollbar-track { background: rgba(0, 0, 0, .45); border: 1px solid #1c212c; box-shadow: inset 0 0 8px rgba(0, 0, 0, .8); }
.pl-cols::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #4a3a5c, #2c2238); border: 2px solid #0c0d10; }
.pl-cols::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #5c4a74, #382c48); }
.pl-cols { scrollbar-width: thin; scrollbar-color: #4a3a5c rgba(0, 0, 0, .45); }
.pl-col { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.pl-col-title {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 2.5px;
  color: #8d95a1; text-transform: uppercase;
}
.pl-letter {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 6px; color: #b7c0cb;
}
.pl-col.killer .pl-letter { color: #d3646b; }
.pl-col.surv .pl-letter { color: #7ba3e8; }
.pl-count { font-size: 13px; color: #7d8794; font-weight: 500; }
.pl-perks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; }
.pl-perk {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: .5px; color: var(--c, #dfe5ec); text-transform: uppercase;
}
.pl-perk img { width: 26px; height: 26px; object-fit: contain; flex: none; }
