/* Album kolekce: kožené desky se zlatými rohy, papírové stránky, ozdobná hlavička sady,
   zlaté šipky na listování a dole kožená lišta s filtrem podle Hype a hledáním.
   Bez prolínání barev, rozostření a masek: stránka se při otáčení jen transformuje. */

/* Obrazovka s albem se neposouvá, album vyplní místo pod záložkami */
#collection.album-mode { overflow: hidden; }
#collection.album-mode .hub-inner { flex: 1; min-height: 0; gap: 10px; }
#collection.album-mode .tab-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.album { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }

/* Záložky sad nahoře (jako záložky tříd v Hearthstonu) */
.album-sets { display: flex; align-items: flex-end; gap: 6px; padding: 0 10px; }
.set-tab { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border: 0; border-radius: 12px 12px 4px 4px; cursor: pointer;
  background: linear-gradient(180deg, #4a1630, #2a0b1c); box-shadow: inset 0 0 0 1.5px rgba(255, 204, 77, .3); color: #f3e3c0; transition: transform .15s; }
.set-tab b { font: 800 13px/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--gold); }
.set-tab img { height: 17px; width: auto; }
.set-tab small { font: 700 11px/1 var(--font-display); color: #d9c39a; font-variant-numeric: tabular-nums; }
.set-tab[aria-selected="true"] { height: 44px; background: linear-gradient(180deg, #7a2448, #3a0f24); box-shadow: inset 0 0 0 2px var(--gold), 0 -4px 14px rgba(255, 204, 77, .25); }
.set-tab.set-clash[aria-selected="true"] { background: linear-gradient(180deg, #2b3f9a, #101a44); box-shadow: inset 0 0 0 2px #6d8dff, 0 -4px 14px rgba(91, 143, 249, .35); }
.owned-btn { margin-left: auto; align-self: center; white-space: nowrap; border: 1px solid rgba(255, 214, 128, .35); border-radius: 999px; padding: 8px 11px; cursor: pointer;
  background: rgba(30, 14, 26, .9); color: #e9d9b5; font: 700 12px/1 var(--font-body); }
.owned-btn::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; box-shadow: inset 0 0 0 1.5px currentColor; }
.owned-btn[aria-pressed="true"] { color: #2a1400; background: linear-gradient(180deg, #fff1b0, var(--gold) 55%, var(--gold-deep)); border-color: transparent; }
.owned-btn[aria-pressed="true"]::before { background: #2a1400; box-shadow: none; }

/* Kožené desky */
.album-book { position: relative; flex: 1; min-height: 0; padding: 10px 12px 12px 14px; border-radius: 18px;
  background: radial-gradient(120% 90% at 30% 20%, #5a1b3a, #2a0b1c 60%, #17050f);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 128, .4), inset 0 2px 0 rgba(255, 255, 255, .08), 0 18px 40px rgba(0, 0, 0, .6);
  outline: 1.5px dashed rgba(255, 214, 128, .3); outline-offset: -6px; }
.album-corners { position: absolute; inset: 0; border-radius: 18px; pointer-events: none;
  background:
    linear-gradient(135deg, #f6d27a 0 15px, #a8701a 15px 18px, transparent 18px) top left / 34px 34px no-repeat,
    linear-gradient(225deg, #f6d27a 0 15px, #a8701a 15px 18px, transparent 18px) top right / 34px 34px no-repeat,
    linear-gradient(45deg, #f6d27a 0 15px, #a8701a 15px 18px, transparent 18px) bottom left / 34px 34px no-repeat,
    linear-gradient(315deg, #f6d27a 0 15px, #a8701a 15px 18px, transparent 18px) bottom right / 34px 34px no-repeat; }
.album-pages { position: relative; height: 100%; perspective: 1800px; }

/* Papírová stránka: světlý střed, starší okraje, stín u hřbetu a vrstvy listů vpravo */
.album-page { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 8px 14px 6px 24px; border-radius: 3px 10px 10px 3px;
  transform-origin: 0 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background:
    linear-gradient(90deg, rgba(92, 56, 18, .42), rgba(92, 56, 18, .12) 3%, transparent 8%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .28 0 0 0 0 .1 0 0 0 .13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 80% 70% at 55% 45%, #fbf4de, #f1e3be 55%, #dcc493);
  box-shadow: inset 0 0 34px rgba(130, 84, 30, .32), 2px 0 0 #efe2c3, 4px 1px 0 #c8b086, 6px 1px 0 #ede0c0, 8px 2px 0 #a68c5e, 0 8px 18px rgba(0, 0, 0, .45); }
.album-page.turning { z-index: 2; }
/* Stín při otáčení leží úplně navrchu. Kdyby nad ním byly drahokamy karet (z-index), Safari by jim dal
   vlastní vrstvy a ty by se s otáčenou stránkou nehýbaly. */
.page-shade { position: absolute; inset: 0; z-index: 20; border-radius: inherit; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(40, 22, 6, .15), rgba(40, 22, 6, .55)); }

/* Ozdobná hlavička s názvem sady */
.page-plaque { flex: 0 0 34px; display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 4px; }
.page-plaque > span, .page-plaque > img { padding: 6px 18px; border-radius: 6px; background: linear-gradient(180deg, #f8eed2, #e4cf9d);
  box-shadow: 0 0 0 1.5px #a07a3c, 0 0 0 4px #f3e6c4, 0 0 0 5px #b89252, 0 3px 8px rgba(90, 56, 18, .3); }
.page-plaque > span { font: 800 17px/1 'Barlow Condensed', var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: #5a3a14; }
.page-plaque > img { height: 30px; width: auto; box-sizing: border-box; padding: 5px 14px; background: linear-gradient(180deg, #23357e, #0e1430);
  box-shadow: 0 0 0 1.5px #6d8dff, 0 0 0 4px #f3e6c4, 0 0 0 5px #b89252, 0 3px 8px rgba(90, 56, 18, .3); }
.page-plaque svg { width: 46px; height: 20px; fill: none; stroke: #a07a3c; stroke-width: 1.6; stroke-linecap: round; }
.page-plaque svg:first-child { transform: scaleX(-1); }

/* Karty na stránce: velikost spočítá album.js podle místa */
.page-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), var(--card-w)); align-content: center; justify-content: center; gap: 8px 12px; }
.album-cell { position: relative; isolation: isolate; width: var(--card-w); padding: 0; border: 0; background: none; cursor: pointer; display: grid; justify-items: center; gap: 2px; }
.album-cell .card, .album-cell .card-back { width: var(--card-w); }
.album-cell .card-rays, .album-cell .card-back.mystery::before { animation: none; }
@media (hover: hover) { .album-cell:not(.locked):hover .card { transform: translateY(-4px) scale(1.04); } }
.album-cell:not(.locked):active .card { transform: scale(.97); }
.album-count { height: 20px; min-width: 44px; display: grid; place-items: center; font: 800 14px/1 'Barlow Condensed', var(--font-display); color: #6b4a1e; }
.album-count:not(:empty) { padding: 0 10px; border-radius: 0 0 9px 9px; background: linear-gradient(180deg, #e9d7ab, #d6bd86); box-shadow: inset 0 0 0 1px #b08c50, 0 2px 3px rgba(90, 56, 18, .25); }
.album-cell.locked .card-back { opacity: .42; }
.album-cell.locked .album-count { background: none; box-shadow: none; }
.album-cell.locked small { font: 600 10.5px/1 var(--font-body); color: #8a6a3a; white-space: nowrap; }
.page-empty { grid-column: 1 / -1; margin: 0; font: italic 600 15px/1.4 var(--font-body); color: #7a5a2a; text-align: center; }
.page-num { flex: 0 0 18px; text-align: center; font: 700 12px/18px 'Barlow Condensed', var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: #8a6a3a; }

/* Zlaté šipky na okrajích stránky */
.album-arrow { position: absolute; top: 50%; z-index: 5; width: 34px; height: 54px; margin-top: -27px; padding: 0; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, #fff1b0, var(--gold) 50%, var(--gold-deep)); box-shadow: 0 0 0 2px #5a2a00, 0 6px 14px rgba(0, 0, 0, .55); transition: opacity .2s, transform .15s; }
.album-arrow.prev { left: -8px; }
.album-arrow.next { right: -8px; }
.album-arrow svg { width: 100%; height: 100%; padding: 12px 8px; fill: none; stroke: #4a2200; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.album-arrow:active { transform: scale(.92); }
.album-arrow:disabled { opacity: .25; cursor: default; }

/* Kožená lišta dole: krystaly Hype a hledání */
.album-bar { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 16px;
  background: linear-gradient(180deg, #4a1630, #24081a); box-shadow: inset 0 0 0 1.5px rgba(255, 204, 77, .3), 0 8px 20px rgba(0, 0, 0, .45); }
.hype-filter { flex: 1; display: flex; justify-content: space-between; gap: 3px; min-width: 0; }
.hype-gem { position: relative; flex: 0 1 34px; height: 36px; padding: 0; border: 0; cursor: pointer; background: none; display: grid; place-items: center; transition: transform .12s; }
.hype-gem::before { content: ''; position: absolute; inset: 1px; clip-path: polygon(50% 0, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%);
  background: linear-gradient(160deg, #ffe0f0, #ff5aa5 35%, var(--hot) 55%, #7a0038); opacity: .72; }
.hype-gem span { position: relative; font: 900 14px/1 var(--font-display); color: #fff; -webkit-text-stroke: 3px #3a0018; paint-order: stroke fill; }
.hype-gem.on { transform: scale(1.14); }
.hype-gem.on::before { opacity: 1; background: linear-gradient(160deg, #ffffff, #ffd1e8 30%, #ff5aa5 60%, #a0004a); }
.hype-gem.on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 12px 3px rgba(255, 255, 255, .75); }
.album-search { position: relative; display: flex; align-items: center; height: 36px; flex: 0 0 auto; }
.album-search svg { width: 36px; height: 36px; padding: 8px; fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; cursor: pointer; }
.album-search input { width: 0; padding: 0; border: 0; opacity: 0; height: 32px; border-radius: 10px; background: #160510; color: #f6e8c8;
  font: 600 14px/1 var(--font-body); box-shadow: inset 0 0 0 1.5px rgba(255, 204, 77, .45); transition: width .2s, opacity .2s; }
.album-search input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--gold); }
.album.searching .album-search { flex: 1; }
.album.searching .album-search input { width: 100%; padding: 0 10px; opacity: 1; }
.album.searching .hype-filter { display: none; }
@media (min-width: 700px) {
  .album-search { flex: 0 0 240px; }
  .album-search input { width: 100%; padding: 0 10px; opacity: 1; }
  .album.searching .hype-filter { display: flex; }
}
@media (max-width: 420px) {
  .album-sets { padding: 0 4px; gap: 5px; }
  .set-tab { padding: 0 9px; gap: 5px; }
  .set-tab b { font-size: 12px; }
  .set-tab img { height: 14px; }
  .owned-btn { padding: 7px 9px; font-size: 11px; }
}
