/* Fruity: play online. The deep indigo and bright red of the card borders, with a ripe orange. */
.fy { --indigo: #3a1f93; --navy: #1b1058; --red: #d0121b; --gold: #ffc94d; max-width: 1100px; margin: 0 auto; }
.fy-name { font: 800 1.6rem/1 Georgia, serif; color: var(--indigo); text-decoration: none; }
[hidden] { display: none !important; }
.fy-steps { padding-left: 1.2rem; }

#game { background: linear-gradient(170deg, #1b1058 0%, #2e1a7a 55%, #4a2a9a 100%); border-radius: .9rem; padding: .6rem; color: #f2eefc; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
@media (min-width: 768px) { #game { padding: .9rem; } }
.fy-h { font-size: .95rem; font-weight: 800; margin: .8rem 0 .3rem; color: #d9d0f5; }

/* what to do now */
.fy-status { padding: .55rem .8rem; border-radius: .7rem; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.18); margin-bottom: .6rem; min-height: 3.2rem; }
.fy-status.mine { background: rgba(255,201,77,.2); border-color: var(--gold); }
.fy-status .big { font: 800 1.15rem/1.25 Georgia, serif; }
.fy-status .sub { font-size: .84rem; color: #d9d0f5; }
.fy-status .acts { margin-top: .4rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.fy-steps3 { display: flex; gap: .3rem; margin-top: .35rem; font-size: .72rem; font-weight: 700; }
.fy-steps3 span { padding: .05rem .55rem; border-radius: 1rem; background: rgba(255,255,255,.12); color: #cfc4f2; }
.fy-steps3 span.on { background: var(--gold); color: #24135f; }
.fy-steps3 span.done { background: rgba(255,255,255,.28); color: #fff; }

/* me: my basket and my cards */
.fy-me { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .6rem; }
.fy-basket { flex: none; width: 8.6rem; background: #fff; color: #222; border: 4px solid var(--red); border-radius: .7rem; padding: .35rem .4rem; }
.fy-basket h3 { font: 700 .66rem/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--red); margin: 0 0 .25rem; }
.fy-bslot { display: flex; align-items: center; gap: .35rem; padding: .1rem 0; font: 700 .86rem/1.1 Georgia, serif; }
.fy-bslot img { width: 1.9rem; height: 1.9rem; object-fit: contain; flex: none; }
.fy-bslot.miss { opacity: .38; filter: grayscale(.7); }
.fy-bslot.got::after { content: "\2713"; margin-left: auto; color: #198754; font-weight: 800; }
.fy-hand { display: flex; flex-wrap: wrap; gap: .5rem; flex: 1 1 auto; --cw: clamp(78px, 24vw, 118px); }
.fy-c { position: relative; width: var(--cw); aspect-ratio: 320 / 481; padding: 0; border: 0; background: none; border-radius: 9px; cursor: default; }
.fy-c img { display: block; width: 100%; height: 100%; border-radius: 9px; box-shadow: 0 2px 6px rgba(0,0,0,.5); pointer-events: none; }
.fy-hand.pick .fy-c { cursor: pointer; }
.fy-hand.pick .fy-c:hover img, .fy-hand.pick .fy-c:focus-visible img { box-shadow: 0 0 0 4px var(--gold), 0 0 1rem var(--gold); transform: translateY(-4px); }
.fy-c:focus-visible { outline: none; }
.fy-c .tg { position: absolute; left: 50%; bottom: -.55rem; transform: translateX(-50%); white-space: nowrap; font: 700 .64rem/1.3 system-ui, sans-serif; padding: 0 .45rem; border-radius: 1rem; background: #fff; color: #24135f; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.fy-c .tg.need { background: #ff5a5f; color: #fff; }
.fy-c.new img { animation: fy-pop .9s ease-out; }
@keyframes fy-pop { 0% { transform: scale(.7) translateY(-1rem); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
.fy-empty { color: #cfc4f2; font-size: .9rem; align-self: center; }

/* the others */
.fy-table { display: grid; gap: .6rem; }
@media (min-width: 768px) { .fy-table { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.fy-players { display: grid; gap: .4rem; }
.fy-pl { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; padding: .4rem .6rem; border-radius: .6rem; background: rgba(255,255,255,.08); border: 2px solid transparent; }
.fy-pl.turn { border-color: var(--gold); background: rgba(255,201,77,.14); }
.fy-pl.done { opacity: .85; }
.fy-pl .nm { font-weight: 800; min-width: 4.2rem; }
.fy-pl .nm small { display: block; font-weight: 600; font-size: .66rem; color: var(--gold); }
.fy-pl .bk { display: flex; gap: .3rem; }
.fy-ic { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .5rem; background: #fff; border: 2px solid var(--red); }
.fy-ic img { width: 1.5rem; height: 1.5rem; object-fit: contain; }
.fy-ic.miss { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }
.fy-ic.miss img { opacity: .3; filter: grayscale(1); }
.fy-pl .ct { margin-left: auto; font-size: .78rem; color: #d9d0f5; text-align: right; }
.fy-piles { display: flex; gap: 1rem; justify-content: center; align-items: flex-start; padding: .3rem 0; }
.fy-pile { text-align: center; font-size: .78rem; color: #d9d0f5; }
.fy-pile img { display: block; width: 5.2rem; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.5); margin: 0 auto .25rem; }
.fy-pile .ph { width: 5.2rem; aspect-ratio: 320 / 481; border: 2px dashed rgba(255,255,255,.3); border-radius: 8px; margin: 0 auto .25rem; }

.fy-log { margin: 0; padding-left: 0; list-style: none; font-size: .86rem; display: flex; flex-direction: column-reverse; max-height: 11rem; overflow-y: auto; }
.fy-log li { margin-bottom: .1rem; }
.fy-log li.me { font-weight: 700; color: var(--gold); }
.fy-log li.win { font-weight: 800; color: #9be7b0; }

.fy-dialog { border: 0; border-radius: .8rem; max-width: min(94vw, 34rem); width: 100%; padding: 1rem 1.2rem; box-shadow: 0 10px 40px rgba(0,0,0,.4); max-height: 92vh; overflow-y: auto; position: relative; }
.fy-dialog::backdrop { background: rgba(0,0,0,.55); }
.fy-x { position: absolute; top: .4rem; right: .6rem; border: 0; background: none; font-size: 1.8rem; line-height: 1; color: #5c636a; cursor: pointer; }
.fy-rank { list-style: none; padding: 0; margin: 0; }
.fy-rank li { display: flex; align-items: center; gap: .6rem; padding: .35rem .2rem; border-bottom: 1px solid #e3e6ec; }
.fy-rank .n { font: 800 1.3rem/1 Georgia, serif; width: 2rem; color: var(--indigo); }
.fy-rank li.you { background: #fff7e0; font-weight: 700; }
.fy-rank small { margin-left: auto; color: #5c636a; }
@media (prefers-reduced-motion: reduce) { .fy-c.new img { animation: none; } }

/* hands-on turn: what to tap */
.fy-c.can img { box-shadow: 0 0 0 4px #5be08a, 0 0 1rem #5be08a; }
.fy-hand.laying .fy-c:not(.can) img { opacity: .55; }
.fy-hand.laying .fy-c.can { cursor: pointer; }
.fy-c.sel img { box-shadow: 0 0 0 4px #fff, 0 0 1.1rem rgba(255,255,255,.9); transform: translateY(-8px); }
.fy-c.back img { box-shadow: 0 0 0 4px var(--gold), 0 0 1rem var(--gold); animation: fy-beat 1s ease-in-out infinite; }
.fy-c.back { cursor: pointer; }
@keyframes fy-beat { 50% { filter: brightness(1.25) drop-shadow(0 0 .7rem var(--gold)); } }
.fy-pile.target img, .fy-pile.target .ph { box-shadow: 0 0 0 4px var(--gold), 0 0 1.2rem var(--gold); animation: fy-beat 1s ease-in-out infinite; cursor: pointer; }
.fy-pile.target { cursor: pointer; color: var(--gold); font-weight: 700; }
.fy-pl.target { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 1rem rgba(255,201,77,.6); cursor: pointer; animation: fy-beat 1.2s ease-in-out infinite; }
.fy-bslot.pulse { animation: fy-bpulse 1.1s ease-out; }
@keyframes fy-bpulse { 0% { background: #bff0cb; transform: scale(1.12); } 100% { background: transparent; transform: none; } }
.fy-status .sub.warn { color: #ffb4b8; font-weight: 700; }
.fy-status .acts { margin-top: .5rem; }

/* celebration: whenever anyone fills their basket */
.fy-party { position: fixed; inset: 0; z-index: 2000; pointer-events: none; overflow: hidden; display: grid; place-items: center; }
.fy-banner { text-align: center; padding: .9rem 1.6rem; border-radius: 1.1rem; background: rgba(27,16,88,.93); border: 3px solid var(--gold); box-shadow: 0 0 3rem rgba(255,201,77,.6); color: #fff; animation: fy-banner 3.4s ease-out forwards; max-width: 92vw; }
.fy-banner .t { font: 800 clamp(1.4rem, 6vw, 2.4rem)/1.15 Georgia, serif; color: var(--gold); }
.fy-banner .s { font-size: clamp(1rem, 4vw, 1.3rem); }
.fy-banner.me { padding: 1.3rem 2.2rem; }
.fy-banner.me .t { font-size: clamp(1.8rem, 8vw, 3.2rem); }
@keyframes fy-banner { 0% { opacity: 0; transform: scale(.6); } 10% { opacity: 1; transform: scale(1.08); } 18% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-1rem); } }
.fy-rain { position: absolute; top: -4rem; width: 3rem; height: 3rem; object-fit: contain; animation: fy-fall linear forwards; }
@keyframes fy-fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(110vh) rotate(var(--r)); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .fy-rain { display: none; } .fy-pile.target img, .fy-pile.target .ph, .fy-pl.target, .fy-c.back img { animation: none; } }
