/* Shared identity styles: quick-chat bubbles (one look per rarity), effect tiles and the polished in-game social wheel.
 * Name frames live in name-frames.css.  The in-game wheel rules sit under `body.games-retro-page` with a
 * higher specificity than game-portal.css, so this file only has to be loaded, not ordered. */

/* ------------------------------------------------------------------ chat bubbles */
.idc {
    --idc-bg: #fffaf0; --idc-ink: #2f1d12; --idc-edge: rgba(47, 29, 18, .78); --idc-glow: transparent; --idc-accent: #c98f1f;
    position: relative; display: inline-flex; align-items: center; gap: .5em; box-sizing: border-box; max-width: min(260px, calc(100vw - 28px));
    padding: .5em .85em .5em .6em; border-radius: 1.05em; border: .14em solid var(--idc-edge);
    background: var(--idc-bg); color: var(--idc-ink); box-shadow: .22em .28em 0 rgba(47, 29, 18, .22), 0 0 1.1em var(--idc-glow);
    font: 800 .94rem/1.16 var(--gp-body, "Trebuchet MS", system-ui, sans-serif); text-align: left; isolation: isolate;
}
.idc-ico { display: grid; place-items: center; flex: none; width: 1.55em; height: 1.55em; border-radius: 50%; background: var(--idc-accent); color: #fff; box-shadow: inset 0 0 0 .08em rgba(0, 0, 0, .18); }
.idc-ico svg { width: 1.05em; height: 1.05em; }
.idc-ico:empty { display: none; }
.idc-text { min-width: 0; overflow-wrap: anywhere; }
.idc::after { content: ""; position: absolute; left: calc(50% + var(--idc-tail, 0px)); bottom: -.58em; width: .9em; height: .9em; background: var(--idc-bg); border-right: .14em solid var(--idc-edge); border-bottom: .14em solid var(--idc-edge); transform: translateX(-50%) rotate(45deg); z-index: -1; border-bottom-right-radius: .2em; }
.idc--below::after { bottom: auto; top: -.58em; transform: translateX(-50%) rotate(225deg); }
.idc--cpu { --idc-bg: #eef5ff; --idc-accent: #5b7fb8; }

/* live (positioned) bubbles */
.idc--live { position: fixed; z-index: 2147482500; opacity: 0; pointer-events: none; transform: translate(-50%, -100%) translateY(10px) scale(.9); transition: opacity .2s ease, transform .24s cubic-bezier(.2, 1.3, .4, 1); width: max-content; }
.idc--live.idc--below { transform: translate(-50%, 0) translateY(-10px) scale(.9); }
.idc--live.is-visible { opacity: 1; transform: translate(-50%, -100%) translateY(-.55em) scale(1); }
.idc--live.idc--below.is-visible { transform: translate(-50%, 0) translateY(.55em) scale(1); }
.idc--static { box-shadow: .18em .22em 0 rgba(47, 29, 18, .2); margin-bottom: .6em; }

/* common: warm paper */
.idc--common { --idc-accent: #a8794a; }
/* uncommon: fresh green with a leaf-notch accent */
.idc--uncommon { --idc-bg: #f2fbe9; --idc-edge: #4f8a3a; --idc-ink: #1f3a14; --idc-accent: #4f8a3a; --idc-glow: rgba(110, 190, 80, .18); }
.idc--uncommon .idc-ico { border-radius: 60% 0 60% 0; }
/* rare: blue card, double rule */
.idc--rare { --idc-bg: #eef6ff; --idc-edge: #2a64b8; --idc-ink: #11264a; --idc-accent: #2a64b8; --idc-glow: rgba(60, 130, 230, .28); box-shadow: .22em .28em 0 rgba(20, 50, 100, .24), 0 0 1.1em var(--idc-glow), inset 0 0 0 .12em #fff, inset 0 0 0 .2em rgba(42, 100, 184, .4); }
.idc--rare .idc-ico { border-radius: .4em; }
/* epic: violet gradient with a slow sparkle */
.idc--epic { --idc-bg: linear-gradient(135deg, #f4ecff, #e5dcff); --idc-edge: #7b3fd0; --idc-ink: #2a1056; --idc-accent: #7b3fd0; --idc-glow: rgba(150, 90, 240, .4); overflow: visible; }
.idc--epic::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: radial-gradient(circle at 12% 30%, #fff 0 .06em, transparent .1em), radial-gradient(circle at 80% 70%, #fff 0 .07em, transparent .11em), radial-gradient(circle at 60% 20%, #fff 0 .05em, transparent .09em); animation: idc-twinkle 2.6s ease-in-out infinite; }
.idc--epic::after { background: #e8defe; }
.idc--epic .idc-ico { clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); border-radius: 0; box-shadow: none; }
/* legendary: gold rim with a shine that sweeps through */
.idc--legendary { --idc-bg: linear-gradient(160deg, #fff8dc, #ffe9a6); --idc-edge: #b37d12; --idc-ink: #4a2f05; --idc-accent: #d6921c; --idc-glow: rgba(255, 200, 70, .55); }
.idc--legendary::before { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .85) 50%, transparent 62%) -140% 0 / 60% 100% no-repeat; animation: idc-sweep 3.4s ease-in-out infinite; pointer-events: none; }
.idc--legendary .idc-ico { box-shadow: 0 0 .5em rgba(255, 190, 40, .8), inset 0 0 0 .08em rgba(255, 255, 255, .6); }
.idc--legendary::after { background: #ffe9a6; }
.idc--legendary::before { border-radius: inherit; }
/* mythic: iridescent animated ring on a deep plate */
@property --idc-ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.idc--mythic { --idc-bg: linear-gradient(160deg, #1a1236, #0e0a24); --idc-ink: #fff; --idc-edge: transparent; --idc-accent: #b58bff; --idc-glow: rgba(160, 110, 255, .6); border: .16em solid transparent; background: linear-gradient(160deg, #1a1236, #0e0a24) padding-box, conic-gradient(from var(--idc-ang), #ff5d8f, #ffc14d, #7bff8e, #5dd8ff, #b58bff, #ff5d8f) border-box; animation: idc-ring 3.6s linear infinite; text-shadow: 0 0 .5em rgba(190, 150, 255, .7); }
.idc--mythic::after { background: #0e0a24; border-color: #b58bff; }
.idc--mythic .idc-ico { background: conic-gradient(from var(--idc-ang), #ff5d8f, #ffc14d, #7bff8e, #5dd8ff, #b58bff, #ff5d8f); }

@keyframes idc-sweep { from { background-position: -140% 0; } 60%, to { background-position: 260% 0; } }
@keyframes idc-twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes idc-ring { to { --idc-ang: 360deg; } }
@media (prefers-reduced-motion: reduce) { .idc, .idc::before, .idc::after { animation: none !important; } .idc--live { transition: opacity .2s ease; } }

/* ------------------------------------------------------------------ effect tiles */
.idfx-canvas { pointer-events: none; }
.idfx-tile { position: relative; display: grid; place-items: center; width: 100%; min-height: 4.4em; aspect-ratio: 5 / 3; border-radius: .7em; overflow: hidden; background: radial-gradient(circle at 50% 120%, rgba(255, 255, 255, .16), transparent 60%), linear-gradient(160deg, #26304f, #141a30); box-shadow: inset 0 0 0 .08em rgba(255, 255, 255, .14); cursor: pointer; }
.idfx-tile img { width: 46%; max-width: 3.4em; height: auto; image-rendering: auto; filter: drop-shadow(0 .15em .3em rgba(0, 0, 0, .5)); transition: transform .2s ease; }
.idfx-tile:hover img { transform: scale(1.12) rotate(-4deg); }
.idfx-tile small { position: absolute; left: 0; right: 0; bottom: .35em; text-align: center; font: 800 .62rem/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }

/* ------------------------------------------------------------------ in-game social wheel (polish) */
body.games-retro-page .retro-social-wheel .retro-social-trigger {
    width: 58px; height: 58px; border: 3px solid #2f1d12; background: radial-gradient(circle at 32% 26%, #ffe9a6, #f6c85f 60%, #e0a93a); color: #2f1d12;
    box-shadow: 0 4px 0 #2f1d12, 0 8px 14px rgba(0, 0, 0, .28); transition: transform .16s cubic-bezier(.2, 1.4, .4, 1), box-shadow .16s ease;
}
body.games-retro-page .retro-social-wheel .retro-social-trigger:hover, body.games-retro-page .retro-social-wheel .retro-social-trigger:focus-visible { transform: translateY(-2px) rotate(-6deg) scale(1.05); box-shadow: 0 6px 0 #2f1d12, 0 12px 18px rgba(0, 0, 0, .3); }
body.games-retro-page .retro-social-wheel.is-open .retro-social-trigger { transform: rotate(90deg) scale(.96); box-shadow: 0 2px 0 #2f1d12; }
body.games-retro-page .retro-social-wheel .retro-social-menu {
    grid-template-columns: repeat(2, minmax(124px, 1fr)); gap: 7px; width: min(332px, calc(100vw - 104px)); max-height: min(70vh, 520px); overflow: auto; padding: 12px;
    border: 3px solid #2f1d12; border-radius: 14px; background: linear-gradient(180deg, #fff9ea, #f6e8c8); box-shadow: 0 5px 0 #2f1d12, 0 18px 34px rgba(0, 0, 0, .34);
    transform: translate(14px, -50%) scale(.92); transition: opacity .16s ease, transform .22s cubic-bezier(.2, 1.3, .4, 1);
}
body.games-retro-page .retro-social-wheel.is-open .retro-social-menu { transform: translate(0, -50%) scale(1); }
body.games-retro-page .retro-social-wheel .retro-social-menu .idw-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin: 0 0 2px; font: 900 .68rem/1 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: rgba(47, 29, 18, .6); }
body.games-retro-page .retro-social-wheel .retro-social-option {
    --opt: #a8794a; position: relative; min-height: 44px; padding: 6px 9px 6px 7px; border: 2px solid color-mix(in srgb, var(--opt) 55%, #2f1d12); border-radius: 10px; background: #fffdf6; overflow: hidden;
    box-shadow: 0 2px 0 color-mix(in srgb, var(--opt) 60%, #2f1d12); transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
body.games-retro-page .retro-social-wheel .retro-social-option::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--opt); }
body.games-retro-page .retro-social-wheel .retro-social-option:hover, body.games-retro-page .retro-social-wheel .retro-social-option:focus-visible { transform: translateY(-1px); background: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--opt) 60%, #2f1d12); }
body.games-retro-page .retro-social-wheel .retro-social-option:active { transform: translateY(1px); box-shadow: 0 1px 0 color-mix(in srgb, var(--opt) 60%, #2f1d12); }
body.games-retro-page .retro-social-wheel .retro-social-option[data-rarity="uncommon"] { --opt: #4f8a3a; }
body.games-retro-page .retro-social-wheel .retro-social-option[data-rarity="rare"] { --opt: #2a64b8; }
body.games-retro-page .retro-social-wheel .retro-social-option[data-rarity="epic"] { --opt: #7b3fd0; }
body.games-retro-page .retro-social-wheel .retro-social-option[data-rarity="legendary"] { --opt: #d6921c; background: linear-gradient(160deg, #fffbe8, #ffefb8); }
body.games-retro-page .retro-social-wheel .retro-social-option[data-rarity="mythic"] { --opt: #8d5cff; background: linear-gradient(160deg, #f6f0ff, #e6dcff); }
body.games-retro-page .retro-social-wheel .retro-social-option--effect { background: #eaf6f1; }
body.games-retro-page .retro-social-wheel .retro-social-option--effect img.idw-glyph { width: 24px; height: 24px; }
body.games-retro-page .retro-social-wheel .retro-social-option-icon { color: var(--opt); }
@media (max-width: 900px) {
    body.games-retro-page .retro-social-wheel .retro-social-menu { grid-template-columns: 1fr 1fr; width: min(300px, calc(100vw - 24px)); transform: translateY(10px) scale(.94); }
    body.games-retro-page .retro-social-wheel.is-open .retro-social-menu { transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) { body.games-retro-page .retro-social-wheel * { transition-duration: .01ms !important; } }

/* ------------------------------------------------------------------ IdentityWheel (radial social wheel, social-wheel.js) */
.idw { position: relative; width: 58px; height: 58px; font-family: var(--gp-body, "Trebuchet MS", system-ui, sans-serif); }
.idw--fixed { position: fixed; right: 24px; top: 50%; margin-top: -29px; z-index: 2147482100; }
.idw--inline { display: inline-block; vertical-align: middle; }
.idw-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.idw-trigger { position: relative; z-index: 3; width: 58px; height: 58px; border-radius: 50%; border: 3px solid #2f1d12; background: radial-gradient(circle at 32% 26%, #ffe9a6, #f6c85f 60%, #e0a93a); color: #2f1d12; cursor: pointer; display: grid; place-items: center; box-shadow: 0 4px 0 #2f1d12, 0 8px 14px rgba(0, 0, 0, .28); transition: transform .18s cubic-bezier(.2, 1.4, .4, 1), box-shadow .18s ease; }
.idw-trigger:hover, .idw-trigger:focus-visible { transform: translateY(-2px) rotate(-6deg) scale(1.05); }
.idw.is-open .idw-trigger { transform: rotate(90deg) scale(.94); box-shadow: 0 2px 0 #2f1d12; }
.idw-trigger:focus-visible, .idw-item:focus-visible { outline: 3px solid #5dd8ff; outline-offset: 2px; }
.idw-trigger-ico { display: grid; place-items: center; width: 28px; height: 28px; }
.idw-svg { width: 100%; height: 100%; }
.idw-arc { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 2; pointer-events: none; }
.idw-item { --rc: #a8794a; position: absolute; left: calc(var(--s) / -2); top: calc(var(--s) / -2); width: var(--s); height: var(--s); padding: 9px; border-radius: 50%; border: 3px solid var(--rc); background: #fffaf0; color: #2f1d12; cursor: pointer; display: grid; place-items: center;
    box-shadow: 0 3px 0 rgba(47, 29, 18, .55), 0 6px 12px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transform: translate(0, 0) scale(.2); transition: transform .28s cubic-bezier(.2, 1.4, .4, 1) var(--d, 0ms), opacity .16s ease var(--d, 0ms); }
.idw.is-open .idw-item { opacity: 1; pointer-events: auto; transform: translate(var(--x), var(--y)) scale(1); }
.idw-item--fx { background: radial-gradient(circle at 50% 110%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(160deg, #2a3354, #161b33); padding: 6px; }
.idw-item img { width: 100%; height: 100%; }
.idw-item.r-uncommon { --rc: #4f8a3a; } .idw-item.r-rare { --rc: #2a64b8; } .idw-item.r-epic { --rc: #7b3fd0; } .idw-item.r-legendary { --rc: #d6921c; background: #fff3c4; } .idw-item.r-mythic { --rc: #8d5cff; background: #efe6ff; }
.idw-item:hover, .idw-item:focus-visible { z-index: 4; transform: translate(var(--x), var(--y)) scale(1.16); }
.idw-item::after { content: attr(data-label); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px); max-width: 220px; width: max-content; padding: 5px 9px; border-radius: 9px; background: #2f1d12; color: #fff6e0; font: 800 .74rem/1.15 system-ui, sans-serif; opacity: 0; pointer-events: none; transition: opacity .12s ease, transform .12s ease; white-space: normal; text-align: center; }
.idw-item:hover::after, .idw-item:focus-visible::after { opacity: 1; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) { .idw-item, .idw-trigger { transition: opacity .1s ease !important; } }

/* rarity accents win over the portal's flat !important skin: a coloured edge bar and icon tile per rarity */
body.games-retro-page .retro-social-wheel .retro-social-option { border-color: color-mix(in srgb, var(--opt) 60%, #2f1d12) !important; position: relative !important; padding-left: 12px !important; }
body.games-retro-page .retro-social-wheel .retro-social-option::before { content: "" !important; position: absolute !important; left: 0 !important; top: 0 !important; bottom: 0 !important; width: 5px !important; background: var(--opt) !important; }
body.games-retro-page .retro-social-wheel .retro-social-option .retro-social-option-icon { border-color: var(--opt) !important; color: var(--opt) !important; background: color-mix(in srgb, var(--opt) 14%, #fffaf0) !important; }
body.games-retro-page .retro-social-wheel .retro-social-option--effect .retro-social-option-icon { background: linear-gradient(160deg, #2a3354, #161b33) !important; }
body.games-retro-page .retro-social-wheel .retro-social-option[data-rarity="legendary"] { background: linear-gradient(160deg, #fffbe8, #ffefb8) !important; }
body.games-retro-page .retro-social-wheel .retro-social-option[data-rarity="mythic"] { background: linear-gradient(160deg, #f6f0ff, #e6dcff) !important; }
/* ------------------------------------------------------------------ avatar cosmetic effects on game pages
 * The sparkles, motes, ember flecks and aura game-identity.js draws round an avatar (avatarEffectMarkup). Game pages
 * load no other stylesheet with these, so this is where they move; the hub (body.hub-page) has its own copy in
 * games/assets/hub/hub-art.css and is left out here. Keep the two in step. Each piece runs on its own phase. */
body:not(.hub-page) .retro-human-avatar .retro-avatar-fx { pointer-events: none; }
body:not(.hub-page) .retro-human-avatar .retro-avatar-fx__p { transform-box: fill-box; transform-origin: center; }
body:not(.hub-page) .retro-human-avatar--fx-foil_glint .retro-avatar-fx--glint .retro-avatar-fx__p { animation: idfx-twinkle 3.2s ease-in-out infinite; }
body:not(.hub-page) .retro-human-avatar--fx-idle_sparkle .retro-avatar-fx--sparkle .retro-avatar-fx__p { animation: idfx-twinkle 2.4s ease-in-out infinite; }
body:not(.hub-page) .retro-human-avatar--fx-scene_particles .retro-avatar-fx--particles .retro-avatar-fx__p { animation: idfx-drift 4.8s ease-in-out infinite; }
body:not(.hub-page) .retro-human-avatar--fx-ember_pop .retro-avatar-fx--ember .retro-avatar-fx__p { animation: idfx-ember 2.2s ease-out infinite; }
body:not(.hub-page) .retro-human-avatar--fx-signature_aura .retro-avatar-fx--aura { animation: idfx-aura 3.6s ease-in-out infinite; }
body:not(.hub-page) .retro-human-avatar .retro-avatar-fx .retro-avatar-fx__p--2 { animation-delay: -.8s; }
body:not(.hub-page) .retro-human-avatar .retro-avatar-fx .retro-avatar-fx__p--3 { animation-delay: -1.6s; }
body:not(.hub-page) .retro-human-avatar .retro-avatar-fx .retro-avatar-fx__p--4 { animation-delay: -2.4s; }
body:not(.hub-page) .retro-human-avatar--fx-idle_sparkle-2 .retro-avatar-fx--sparkle .retro-avatar-fx__p { animation-duration: 1.9s; }
body:not(.hub-page) .retro-human-avatar--fx-scene_particles-2 .retro-avatar-fx--particles .retro-avatar-fx__p { animation-duration: 3.8s; }
body:not(.hub-page) .retro-human-avatar--fx-signature_aura-2 .retro-avatar-fx--aura { animation-duration: 2.8s; }
@keyframes idfx-twinkle { 0%, 100% { opacity: .35; transform: scale(.72); } 45% { opacity: 1; transform: scale(1.08); } 60% { opacity: .9; transform: scale(1); } }
@keyframes idfx-drift { 0% { opacity: 0; transform: translate(0, 1px); } 25% { opacity: .9; } 75% { opacity: .7; } 100% { opacity: 0; transform: translate(.8px, -2.4px); } }
@keyframes idfx-ember { 0% { opacity: 0; transform: translate(0, 1.2px) scale(.85); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(.6px, -3.2px) scale(.5); } }
@keyframes idfx-aura { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
/* still (each shape at its own opacity) under the system's reduced motion, a game's own Motion: Reduced setting
   (html[data-motion="reduce"] in Člověče / Prší, html.pk-reduced in Piškvorky) and its battery saver
   (body[data-lowpower="1"], html.pk-lowpower). A page-wide "animation-duration: .01ms" rule would instead stop the
   motes and embers on their last, invisible frame, so this sets animation: none. */
html[data-motion="reduce"] body:not(.hub-page) .retro-human-avatar .retro-avatar-fx,
html[data-motion="reduce"] body:not(.hub-page) .retro-human-avatar .retro-avatar-fx .retro-avatar-fx__p,
html.pk-reduced body:not(.hub-page) .retro-human-avatar .retro-avatar-fx,
html.pk-reduced body:not(.hub-page) .retro-human-avatar .retro-avatar-fx .retro-avatar-fx__p,
html.pk-lowpower body:not(.hub-page) .retro-human-avatar .retro-avatar-fx,
html.pk-lowpower body:not(.hub-page) .retro-human-avatar .retro-avatar-fx .retro-avatar-fx__p,
body[data-lowpower="1"]:not(.hub-page) .retro-human-avatar .retro-avatar-fx,
body[data-lowpower="1"]:not(.hub-page) .retro-human-avatar .retro-avatar-fx .retro-avatar-fx__p { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
    body:not(.hub-page) .retro-human-avatar .retro-avatar-fx,
    body:not(.hub-page) .retro-human-avatar .retro-avatar-fx .retro-avatar-fx__p { animation: none !important; }
}