/* ============================================================
   Дурак — карты, стол и витрина
   ============================================================ */

/* ---------- Карта ---------- */
.card{position:relative;width:62px;height:88px;flex:0 0 auto;padding:0;border:1px solid #d8d2c6;border-radius:9px;background:linear-gradient(160deg,#fff 0%,#f9f6f0 100%);color:#1c2030;cursor:default;box-shadow:0 3px 8px rgba(28,32,48,.16),inset 0 0 0 1px #fff;transform:rotate(var(--rot,0deg)) translateY(var(--lift,0px));transition:transform .18s,box-shadow .18s,border-color .14s;font-family:var(--font)}
.card.red{color:#d5343a}
.card-corner{position:absolute;left:5px;top:4px;display:flex;flex-direction:column;align-items:center;line-height:1}
.card-corner b{font-size:14px;font-weight:800;letter-spacing:-.02em}
.card-corner i{margin-top:1px;font-size:12px;font-style:normal}
.card-corner.bottom{left:auto;right:5px;top:auto;bottom:4px;transform:rotate(180deg)}
.card-pip{position:absolute;inset:0;display:grid;place-items:center;font-size:32px;line-height:1;text-shadow:0 1px 0 rgba(255,255,255,.6)}
.card-pip.ace{font-size:42px}
/* Картинки: буква в кольце — компактно, но узнаваемо. */
.card-pip.face{inset:auto;width:34px;height:34px;margin:auto;border:2px solid currentColor;border-radius:50%;font-size:20px;font-weight:800;background:rgba(255,255,255,.7)}
.card.small{width:44px;height:62px}
.card.small .card-corner b{font-size:11px}
.card.small .card-corner i{font-size:9px}
.card.small .card-pip{font-size:22px}
.card.small .card-pip.face{width:24px;height:24px;font-size:14px}
.card.playable{cursor:pointer;border-color:var(--accent);box-shadow:0 4px 10px rgba(110,79,245,.22),inset 0 0 0 1px #fff}
.card.playable:hover{transform:rotate(var(--rot,0deg)) translateY(calc(var(--lift,0px) - 14px)) scale(1.04);box-shadow:0 14px 22px rgba(28,32,48,.26),inset 0 0 0 1px #fff;z-index:3}
.card.selected{transform:rotate(0deg) translateY(calc(var(--lift,0px) - 18px)) scale(1.06);border-color:var(--accent);box-shadow:0 0 0 3px rgba(110,79,245,.35),0 14px 22px rgba(28,32,48,.26);z-index:4}
.card.trump::after{content:"";position:absolute;right:5px;top:5px;width:8px;height:8px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#fff2b8,#f5b81c 60%,#c88a08);box-shadow:0 0 0 1px rgba(200,138,8,.5),0 0 8px rgba(245,184,28,.7)}
/* Рубашка: сиреневый ромбический узор, белая окантовка. */
.card-back,.durak-deck-pile{background:linear-gradient(135deg,transparent 42%,rgba(255,255,255,.2) 42% 58%,transparent 58%),linear-gradient(45deg,transparent 42%,rgba(255,255,255,.2) 42% 58%,transparent 58%),linear-gradient(160deg,#8163f7,#4b2fcf);background-size:10px 10px,10px 10px,100% 100%;box-shadow:inset 0 0 0 2px #fff,inset 0 0 0 4px #9d86f5,0 3px 6px rgba(28,32,48,.28)}
.card-back{width:26px;height:38px;flex:0 0 auto;margin-left:-14px;border-radius:5px;background-size:6px 6px,6px 6px,100% 100%;box-shadow:inset 0 0 0 1.5px #fff,inset 0 0 0 2.5px #9d86f5,0 2px 4px rgba(28,32,48,.25)}
.card-back:first-child{margin-left:0}

/* ---------- Стол ---------- */
.durak-stage{display:flex;flex-direction:column;gap:16px;padding:20px 24px;min-height:540px}
.durak-opponents{display:flex;flex-wrap:wrap;gap:10px}
.durak-opponent{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:var(--r);background:var(--surface-2);transition:box-shadow .2s,opacity .2s}
.durak-opponent.defender{box-shadow:0 0 0 2px var(--coral);animation:durakGlowCoral 1.8s ease-in-out infinite}
.durak-opponent.attacker{box-shadow:0 0 0 2px var(--accent);animation:fxTurnGlow 1.8s ease-in-out infinite}
@keyframes durakGlowCoral{0%,100%{box-shadow:0 0 0 2px rgba(255,107,87,.5),0 8px 22px rgba(255,107,87,.18)}50%{box-shadow:0 0 0 4px rgba(255,107,87,.3),0 12px 30px rgba(255,107,87,.3)}}
.durak-opponent.out{opacity:.45}
.durak-opponent div{display:flex;flex-direction:column;min-width:0}
.durak-opponent strong{font-size:14px}
.durak-opponent small{color:var(--muted);font-size:11px}
.durak-opponent-avatar{width:34px;height:34px;flex:0 0 auto;display:grid;place-items:center;border-radius:50%;background:var(--accent-soft);color:var(--accent-ink);font-size:13px;font-weight:700}
.durak-opponent .durak-fan{flex-direction:row;align-items:center;gap:0;padding-left:6px}
.durak-fan b{margin-left:6px;color:var(--muted);font-size:12px}

.durak-table-row{display:flex;align-items:center;gap:18px;min-height:150px}
.durak-deck{position:relative;display:flex;align-items:center;flex:0 0 auto;height:110px}
/* Козырь лежит под колодой и торчит из-под неё — как на настоящем столе. */
.durak-trump{transform:rotate(90deg) translateX(6px);margin-right:22px}
.durak-deck-pile{position:relative;z-index:2;width:66px;height:92px;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:9px;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.4)}
/* Толщина колоды: две подложки со сдвигом. */
.durak-deck-pile::before,.durak-deck-pile::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:9px;background:#5b3ee3;box-shadow:inset 0 0 0 2px #fff,inset 0 0 0 4px #9d86f5}
.durak-deck-pile::before{transform:translate(3px,3px)}
.durak-deck-pile::after{transform:translate(6px,6px);filter:brightness(.85)}
.durak-deck-pile b{position:relative;padding:2px 8px;border-radius:8px;background:rgba(28,32,48,.35);font-size:20px;font-weight:800}
.durak-deck-pile small{position:relative;margin-top:3px;font-size:9px;opacity:.9}
.durak-deck-pile.empty{opacity:.25}
.durak-table{flex:1;min-height:120px;display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:16px;border-radius:var(--r-lg);background:radial-gradient(ellipse at 50% 30%,#eaf7ee 0%,#cfe8d8 70%,#bfdccb 100%);box-shadow:inset 0 0 0 2px rgba(31,138,107,.18),inset 0 12px 30px rgba(31,138,107,.12)}
.durak-table-empty{width:100%;color:#5b7a6c;font-size:14px;text-align:center}
.durak-pair{position:relative;width:62px;height:88px}
.durak-pair .card{position:absolute;left:0;top:0}
.durak-pair .attack{cursor:pointer}
/* Отбившая карта ложится поверх со сдвигом — видно обе. */
.durak-pair .defence{transform:translate(16px,18px) rotate(8deg);z-index:2;animation:durakCover .28s cubic-bezier(.2,.9,.3,1.3)}
@keyframes durakCover{0%{transform:translate(16px,-10px) rotate(-6deg) scale(1.1)}}
.durak-discard{flex:0 0 auto;width:66px;height:92px;display:grid;place-items:center;border:2px dashed var(--line-strong);border-radius:9px;color:var(--faint);font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;transition:background .2s}
.durak-discard.fx-bump{background:var(--surface-2)}

.durak-status{padding:11px 14px;border-radius:var(--r);background:var(--surface-2);font-size:15px;font-weight:600;text-align:center}
.durak-actions{display:flex;justify-content:center;gap:12px;min-height:46px}
.durak-take{background:var(--coral);box-shadow:0 6px 16px rgba(255,107,87,.28)}
.durak-take:hover{background:#f0553f}
.durak-hand{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:6px;min-height:110px;padding:18px 8px 8px;border-radius:var(--r-lg);background:var(--surface-2)}
.durak-hand.defending .card.playable{border-color:var(--coral)}

.durak-result-overlay{position:absolute;z-index:20;inset:0;display:grid;place-items:center;padding:20px;background:rgba(240,242,245,.75)}
#durakShell{position:relative}

/* ---------- Витрина на странице игры ---------- */
.durak-hero-visual{position:relative;display:grid;place-items:center;min-height:400px;padding:30px;border-radius:var(--r-lg);background:radial-gradient(circle at 50% 40%,#e8f5ec,#c6e3d1)}
.durak-hero-fan{display:flex}
.durak-hero-fan .card{margin-left:-26px;box-shadow:0 8px 18px rgba(28,32,48,.24);width:78px;height:110px}
.durak-hero-fan .card-corner b{font-size:17px}
.durak-hero-fan .card-corner i{font-size:14px}
.durak-hero-fan .card-pip{font-size:40px}
.durak-hero-fan .card-pip.ace{font-size:52px}
.durak-hero-fan .card-pip.face{width:42px;height:42px;font-size:24px}
.durak-hero-fan .card:first-child{margin-left:0}
.durak-hero-fan .card:nth-child(1){transform:rotate(-14deg) translateY(10px)}
.durak-hero-fan .card:nth-child(2){transform:rotate(-7deg) translateY(2px)}
.durak-hero-fan .card:nth-child(4){transform:rotate(7deg) translateY(2px)}
.durak-hero-fan .card:nth-child(5){transform:rotate(14deg) translateY(10px)}
.durak-hero-trump{position:absolute;right:28px;bottom:28px;display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:var(--r);background:rgba(255,255,255,.85);font-size:13px;font-weight:600}
.durak-hero-trump i{font-size:22px;font-style:normal;color:#d5343a}

@media(max-width:640px){
  .durak-stage{padding:14px 12px;gap:12px}
  .card{width:50px;height:72px}
  .card-corner b{font-size:12px}
  .card-corner i{font-size:10px}
  .card-pip{font-size:26px}
  .card-pip.ace{font-size:32px}
  .card-pip.face{width:28px;height:28px;font-size:16px}
  .durak-hand{gap:2px}
  .durak-pair{width:50px;height:72px}
  .durak-table-row{flex-wrap:wrap;gap:12px}
  .durak-deck{height:92px}
  .durak-deck-pile{width:54px;height:76px}
  .durak-deck-pile b{font-size:18px}
  .durak-discard{width:54px;height:76px}
  .durak-hand{gap:6px}
  .durak-opponent{padding:7px 9px}
}
