/* Sors Duo: trophies (the cabinet, the jewel box, the trinkets on the player's machine) and the Daily Rival card and board | games/Sors_Duo/css/trophies.css | v.0.1 */

/* ---------------------------------------------------------------- title screen */
.daily {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  margin: 4px 0 16px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--gold-lo);
  background:
    linear-gradient(90deg, rgba(201, 164, 76, .12), transparent 60%),
    rgba(0, 0, 0, .35);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6);
}
.daily-pic { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold); background: #000; box-shadow: 0 0 14px rgba(240, 214, 138, .25); }
.daily-pic svg { width: 100%; height: 100%; display: block; }
.daily-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.daily-info small { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
.daily-info b { font-family: var(--font-deco); font-size: 17px; color: var(--ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-info span { font-size: 12px; color: var(--ivory-dim); }
.daily-state { color: var(--gold-hi) !important; }
.daily-next { font-size: 11px !important; letter-spacing: 1px; }
.daily-actions { display: flex; flex-direction: column; gap: 6px; }
.daily-actions .btn { min-width: 0; padding: 7px 12px; font-size: 12px; }

#trophyBtn.new { border-color: var(--gold-hi); box-shadow: 0 0 12px rgba(240, 214, 138, .45); }
#trophyBtn.new::after { content: ' \2726'; color: var(--gold-hi); }

/* ---------------------------------------------------------------- the day's board */
.daily-panel { width: min(560px, 94vw); }
.daily-list { list-style: none; margin: 14px 0 18px; padding: 0; text-align: left; }
.daily-list li {
  display: grid;
  grid-template-columns: 32px 1fr auto 70px;
  gap: 10px;
  align-items: baseline;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(201, 164, 76, .15);
  font-size: 13px;
  color: var(--ivory-dim);
}
.daily-list li:nth-child(-n+3) span:first-child { color: var(--gold-hi); font-weight: 700; }
.daily-list li b { color: var(--ivory); font-weight: 600; }
.daily-list li span:last-child { text-align: right; color: var(--gold); }
.daily-list li.me { background: rgba(201, 164, 76, .14); box-shadow: inset 3px 0 0 var(--gold-hi); }

/* ---------------------------------------------------------------- the cabinet */
.trophy-panel { width: min(980px, 94vw); }
.tr-shelves { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 18px; }
.tr-shelf h3 { margin: 14px 0 8px; }
/* A glass case: dark velvet behind, a glass shelf with a gold edge under the trinkets. */
.tr-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
  padding: 14px 12px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 30%),
    radial-gradient(ellipse at 50% 0%, rgba(120, 20, 38, .35), transparent 70%),
    #0b0708;
  border: 1px solid rgba(201, 164, 76, .35);
  box-shadow: inset 0 -6px 0 rgba(201, 164, 76, .18), inset 0 -8px 12px rgba(255, 255, 255, .04), 0 8px 18px rgba(0, 0, 0, .5);
}
.tr-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border: 1px solid transparent;
  background: none;
  color: var(--ivory-dim);
  font-family: inherit;
  cursor: default;
}
.tr-cell.own { cursor: pointer; }
.tr-cell.own:hover { border-color: rgba(240, 214, 138, .45); background: rgba(240, 214, 138, .05); }
.tr-pic { display: block; width: 72px; height: 72px; }
.tr-pic svg, .tr-pic .tr-img, .tr-big svg, .tr-big .tr-img, .tr-item svg, .tr-item .tr-img { width: 100%; height: 100%; display: block; }
.tr-cell b { font-size: 12px; font-weight: 600; color: var(--ivory); line-height: 1.25; }
.tr-cell small { font-size: 11px; color: var(--gold); letter-spacing: 1px; }
.tr-cell.locked .tr-pic { filter: brightness(0) drop-shadow(0 0 1px rgba(201, 164, 76, .35)); opacity: .55; }
.tr-cell.locked small { color: var(--ivory-dim); letter-spacing: 0; }
.tr-cell.worn::before {
  content: '';
  position: absolute;
  top: 4px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-hi);
  box-shadow: 0 0 8px var(--gold-hi);
}
.tr-cell.fresh { border-color: var(--gold-hi); animation: tr-fresh 1.6s ease-in-out 3; }
@keyframes tr-fresh { 50% { box-shadow: 0 0 18px rgba(240, 214, 138, .5); } }
/* Lustre: two stars glow, three stars sparkle. */
.tr-cell.lustre2 .tr-pic { filter: drop-shadow(0 0 6px rgba(240, 214, 138, .55)); }
.tr-cell.lustre3 .tr-pic { filter: drop-shadow(0 0 8px rgba(240, 214, 138, .8)) drop-shadow(0 0 16px rgba(200, 230, 255, .45)); animation: tr-sparkle 2.4s ease-in-out infinite; }
@keyframes tr-sparkle { 50% { filter: drop-shadow(0 0 12px rgba(255, 244, 214, .95)) drop-shadow(0 0 22px rgba(200, 230, 255, .6)); } }

.tr-detail {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  align-items: center;
  margin: 12px 0 4px;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--gold);
  background: radial-gradient(ellipse at 20% 50%, rgba(120, 20, 38, .45), transparent 70%), #0b0708;
}
.tr-detail[hidden] { display: none; }
.tr-big { width: 150px; height: 150px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .7)) drop-shadow(0 0 10px rgba(240, 214, 138, .3)); }
.tr-info { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tr-info b { font-family: var(--font-deco); font-size: 22px; color: var(--gold-hi); letter-spacing: 1px; }
.tr-info p { margin: 0; font-style: italic; color: var(--ivory); line-height: 1.5; }
.tr-from, .tr-next { font-size: 12px; color: var(--ivory-dim); }
.tr-stars { font-style: normal; color: var(--gold-hi); letter-spacing: 4px; font-size: 16px; }

/* ---------------------------------------------------------------- the jewel box */
.tr-reveal { flex-direction: column; gap: 22px; background: rgba(3, 3, 5, .9); opacity: 0; transition: opacity .35s; z-index: 30; }
.tr-reveal.open { opacity: 1; }
.tr-box { position: relative; width: 230px; height: 170px; }
/* Light pouring out of the open box. */
.tr-rays {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(240, 214, 138, .22) 0 6deg, transparent 6deg 18deg);
  mask-image: radial-gradient(circle, #000 12%, transparent 62%);
  opacity: 0;
  transform: scale(.4);
  transition: opacity .8s .55s, transform 1.4s .55s cubic-bezier(.2, .8, .2, 1);
  animation: tr-rays 24s linear infinite;
}
@keyframes tr-rays { to { rotate: 360deg; } }
.tr-reveal.open .tr-rays { opacity: 1; transform: scale(1); }
/* The box: black lacquer outside, red velvet inside, a gold rim. */
.tr-velvet {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 0;
  height: 80px;
  border: 2px solid var(--gold);
  border-radius: 6px 6px 10px 10px;
  background:
    radial-gradient(ellipse at 50% 20%, #b2213b 0, #6d0f22 45%, #2a0510 100%);
  box-shadow: inset 0 10px 18px rgba(0, 0, 0, .6), 0 14px 30px rgba(0, 0, 0, .8), 0 0 0 5px #0a0a0a, 0 0 0 6px var(--gold-lo);
}
.tr-lid {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 78px;
  height: 46px;
  border: 2px solid var(--gold);
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #2a2a2a, #0b0b0b 60%), #0b0b0b;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 0 0 5px #0a0a0a, 0 0 0 6px var(--gold-lo);
  transform-origin: 50% 0;
  transform: perspective(500px) rotateX(-8deg) translateY(46px);
  transition: transform .8s .15s cubic-bezier(.3, 1.4, .5, 1);
  z-index: 3;
}
.tr-lid::after { content: ''; position: absolute; left: 50%; top: 14px; width: 26px; height: 12px; margin-left: -13px; border-radius: 3px; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); }
.tr-reveal.open .tr-lid { transform: perspective(500px) rotateX(-68deg) translateY(-6px); }
.tr-item {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 128px;
  height: 128px;
  margin-left: -64px;
  opacity: 0;
  transform: translateY(40px) scale(.6);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .7)) drop-shadow(0 0 14px rgba(240, 214, 138, .55));
  transition: transform 1.1s .6s cubic-bezier(.2, 1.3, .3, 1), opacity .5s .6s;
  z-index: 2;
}
.tr-reveal.open .tr-item { opacity: 1; transform: translateY(-58px) scale(1); animation: tr-float 3.2s 1.8s ease-in-out infinite; }
@keyframes tr-float { 50% { translate: 0 -6px; } }
.tr-text { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: min(520px, 90vw); text-align: center; opacity: 0; transform: translateY(12px); transition: opacity .6s 1.1s, transform .6s 1.1s; }
.tr-reveal.open .tr-text { opacity: 1; transform: none; }
.tr-text small { font-size: 12px; letter-spacing: 5px; text-transform: uppercase; color: var(--gold); }
.tr-text b { font-family: var(--font-deco); font-size: 30px; letter-spacing: 2px; color: var(--gold-hi); text-shadow: 0 0 14px rgba(240, 214, 138, .4); }
.tr-text p { margin: 4px 0 0; font-style: italic; color: var(--ivory); line-height: 1.5; }
.tr-text .tr-from { margin-top: 2px; }
.tr-buttons { display: flex; gap: 10px; margin-top: 12px; }

/* ---------------------------------------------------------------- on the player's machine
   Only in the casino; the guest skins keep their tribute looks. */
html[class*="theme-"] .charm { display: none; }
html:not([class*="theme-"]) .lever-knob.trinket { background: none; box-shadow: none; overflow: visible; }
html:not([class*="theme-"]) .lever-knob.trinket svg,
html:not([class*="theme-"]) .lever-knob.trinket .tr-img { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
html[class*="theme-"] .lever-knob.trinket svg, html[class*="theme-"] .lever-knob.trinket .tr-img { display: none; }

/* The charm hangs outside the top right corner of the cabinet and swings when you pull. */
.charm {
  position: absolute;
  top: 24px;
  right: -50px;
  width: 58px;
  height: 88px;
  transform-origin: 50% 0;
  animation: charm-idle 5s ease-in-out infinite alternate;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6));
  pointer-events: none;
  z-index: 2;
}
.charm svg, .charm .tr-img { width: 100%; height: 100%; display: block; }
.charm.swing { animation: charm-swing 2.2s cubic-bezier(.3, .6, .4, 1); }
@keyframes charm-idle { from { rotate: -3deg; } to { rotate: 3deg; } }
@keyframes charm-swing { 12% { rotate: 22deg; } 30% { rotate: -16deg; } 48% { rotate: 10deg; } 64% { rotate: -6deg; } 80% { rotate: 3deg; } 100% { rotate: 0deg; } }

/* Card frames: the ornament around the player's two face cards. */
html[data-frame]:not([data-frame=""]):not([class*="theme-"]) #cardsYou .card { position: relative; }
html[data-frame]:not([data-frame=""]):not([class*="theme-"]) #cardsYou .card::before { content: ''; position: absolute; inset: 3px; border-radius: 3px; pointer-events: none; }
html[data-frame="fan"]:not([class*="theme-"]) #cardsYou .card { border: 2px solid var(--gold); }
html[data-frame="fan"]:not([class*="theme-"]) #cardsYou .card::before {
  border: 1px solid var(--gold-lo);
  background:
    repeating-conic-gradient(from 90deg at 0 100%, rgba(240, 214, 138, .55) 0 3deg, transparent 3deg 12deg) 0 100% / 22px 22px no-repeat,
    repeating-conic-gradient(from 270deg at 100% 0, rgba(240, 214, 138, .55) 0 3deg, transparent 3deg 12deg) 100% 0 / 22px 22px no-repeat;
}
html[data-frame="patchwork"]:not([class*="theme-"]) #cardsYou .card {
  border: 3px solid transparent;
  border-image: repeating-linear-gradient(90deg, #b5462f 0 10px, #4f8a3a 10px 20px, #3d5aa8 20px 30px, #c49a2c 30px 40px) 3;
}
html[data-frame="patchwork"]:not([class*="theme-"]) #cardsYou .card::before { border: 1px dashed rgba(233, 220, 192, .5); }
html[data-frame="moonlit"]:not([class*="theme-"]) #cardsYou .card { border: 2px solid #c9d2dc; box-shadow: 0 4px 10px rgba(0, 0, 0, .5), 0 0 12px rgba(200, 215, 235, .25); }
html[data-frame="moonlit"]:not([class*="theme-"]) #cardsYou .card::before {
  border: 1px solid #8793a3;
  /* A crescent: a silver disc with a card coloured disc laid over its edge. */
  background:
    radial-gradient(circle at calc(50% + 3px) 8px, #0f0d0a 0 4.4px, transparent 4.9px),
    radial-gradient(circle at 50% 10px, #e8eef5 0 5px, transparent 5.5px);
}
html[data-frame="scales"]:not([class*="theme-"]) #cardsYou .card {
  border: 4px solid transparent;
  border-image: repeating-radial-gradient(circle at 50% 0, #6fbf73 0 1px, #2f6b3a 1px 4px) 4;
}
html[data-frame="scales"]:not([class*="theme-"]) #cardsYou .card::before { border: 1px solid rgba(134, 217, 140, .6); }
html[data-frame="wheel"]:not([class*="theme-"]) #cardsYou .card { border: 3px double var(--gold-hi); box-shadow: 0 4px 10px rgba(0, 0, 0, .5), 0 0 16px rgba(240, 214, 138, .45); }
html[data-frame="wheel"]:not([class*="theme-"]) #cardsYou .card::before {
  background:
    repeating-conic-gradient(rgba(255, 241, 184, .8) 0 4deg, transparent 4deg 45deg) 3px 3px / 18px 18px no-repeat,
    repeating-conic-gradient(rgba(255, 241, 184, .8) 0 4deg, transparent 4deg 45deg) calc(100% - 3px) calc(100% - 3px) / 18px 18px no-repeat;
  -webkit-mask:
    radial-gradient(circle at 12px 12px, #000 0 8px, transparent 8.5px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #000 0 8px, transparent 8.5px);
  mask:
    radial-gradient(circle at 12px 12px, #000 0 8px, transparent 8.5px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #000 0 8px, transparent 8.5px);
}

/* Plating: the finish of the player's cabinet. */
html[data-plating="runes"]:not([class*="theme-"]) #machineYou .cabinet {
  border-color: #c98a45;
  background:
    repeating-linear-gradient(60deg, rgba(255, 210, 140, .08) 0 2px, transparent 2px 16px),
    repeating-linear-gradient(-60deg, rgba(255, 210, 140, .06) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #3d2512, #1c1108);
  box-shadow: 0 0 0 5px var(--black), 0 0 0 6px #8a5424, 0 16px 34px rgba(0, 0, 0, .6), 0 0 26px rgba(224, 161, 90, .22);
}
html[data-plating="chrome"]:not([class*="theme-"]) #machineYou .cabinet {
  border-color: #e9eef4;
  background:
    radial-gradient(circle, #f4f7fb 0 2px, #4b5360 2.5px, transparent 3.2px) 14px 14px / calc(100% - 28px) calc(100% - 28px),
    linear-gradient(135deg, #2a2d33 0%, #7b828d 38%, #2a2d33 55%, #5b616b 80%, #2a2d33 100%);
  box-shadow: 0 0 0 5px var(--black), 0 0 0 6px #b9c4d2, 0 16px 34px rgba(0, 0, 0, .6);
}
html[data-plating="circuit"]:not([class*="theme-"]) #machineYou .cabinet {
  border-color: #27f0ff;
  background:
    repeating-linear-gradient(90deg, rgba(39, 240, 255, .12) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(39, 240, 255, .08) 0 1px, transparent 1px 30px),
    #041016;
  box-shadow: 0 0 0 5px var(--black), 0 0 0 6px #0b6f7a, 0 16px 34px rgba(0, 0, 0, .6), 0 0 26px rgba(39, 240, 255, .35);
  animation: plate-pulse 3s ease-in-out infinite alternate;
}
@keyframes plate-pulse { to { box-shadow: 0 0 0 5px var(--black), 0 0 0 6px #0b6f7a, 0 16px 34px rgba(0, 0, 0, .6), 0 0 34px rgba(255, 63, 212, .35); } }
html[data-plating="chitin"]:not([class*="theme-"]) #machineYou .cabinet {
  border-color: #7b4fe0;
  background:
    conic-gradient(from 200deg at 50% 30%, rgba(41, 212, 164, .22), rgba(106, 69, 216, .22), rgba(224, 79, 160, .22), rgba(41, 212, 164, .22)),
    #0c0914;
  box-shadow: 0 0 0 5px var(--black), 0 0 0 6px #29d4a4, 0 16px 34px rgba(0, 0, 0, .6), 0 0 24px rgba(123, 79, 224, .35);
}
html[data-plating="blackgold"]:not([class*="theme-"]) #machineYou .cabinet {
  border-color: var(--gold-hi);
  background:
    linear-gradient(180deg, rgba(240, 214, 138, .16), transparent 30%),
    repeating-linear-gradient(90deg, rgba(240, 214, 138, .16) 0 1px, transparent 1px 12px),
    #040404;
  box-shadow: 0 0 0 5px var(--black), 0 0 0 6px var(--gold-hi), 0 16px 34px rgba(0, 0, 0, .6), 0 0 36px rgba(240, 214, 138, .35);
}

/* ---------------------------------------------------------------- narrow screens, motion */
@media (max-width: 900px) {
  .daily { grid-template-columns: 52px 1fr; }
  .daily-pic { width: 52px; height: 52px; }
  .daily-actions { grid-column: 1 / -1; flex-direction: row; }
  .daily-actions .btn { flex: 1; }
  .tr-detail { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tr-info { align-items: center; }
  .tr-row { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .tr-pic { width: 56px; height: 56px; }
  .charm { width: 30px; height: 46px; top: 20px; right: -26px; }
  .daily-list li { grid-template-columns: 26px 1fr auto; }
  .daily-list li span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .charm, .charm.swing, .tr-rays, .tr-reveal.open .tr-item, .tr-cell.lustre3 .tr-pic, html[data-plating] #machineYou .cabinet { animation: none !important; }
}
