.uno-entry-icon {
    position: relative;
    width: 27px !important;
    height: 25px !important;
}
.uno-entry-icon i,
.uno-title-mark i {
    position: absolute;
    width: 13px;
    height: 19px;
    border: 1.3px solid currentColor;
    border-radius: 3px;
    background: var(--bg2);
    transform-origin: 50% 90%;
}
.uno-entry-icon i:nth-child(1), .uno-title-mark i:nth-child(1) { left: 2px; transform: rotate(-17deg); opacity: .62; }
.uno-entry-icon i:nth-child(2), .uno-title-mark i:nth-child(2) { left: 7px; transform: rotate(-2deg); opacity: .82; }
.uno-entry-icon i:nth-child(3), .uno-title-mark i:nth-child(3) { left: 12px; transform: rotate(14deg); }

.uno-window {
    --uno-paper: #f7f3ec;
    --uno-ink: #514d47;
    --uno-muted: #918a80;
    --uno-line: rgba(98, 87, 73, .14);
    --uno-red: #c75d54;
    --uno-yellow: #d4a746;
    --uno-green: #5d9270;
    --uno-blue: #607fa8;
    position: fixed;
    z-index: 905;
    top: max(72px, env(safe-area-inset-top));
    right: max(18px, calc((100vw - 720px) / 2 + 18px));
    width: min(390px, calc(100vw - 24px));
    max-height: calc(var(--app-height, 100dvh) - 90px);
    color: var(--uno-ink);
    background: color-mix(in srgb, var(--uno-paper) 95%, transparent);
    border: 1px solid var(--uno-line);
    border-radius: 22px;
    box-shadow: 0 18px 52px rgba(67, 58, 48, .2), 0 2px 10px rgba(67, 58, 48, .07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    touch-action: auto;
}
.uno-head {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 16px;
    border-bottom: 1px solid var(--uno-line);
    cursor: grab;
    user-select: none;
    touch-action: none;
}
.uno-head:active { cursor: grabbing; }
.uno-title-wrap { display: flex; align-items: center; gap: 10px; }
.uno-title-wrap > div { display: grid; gap: 1px; }
.uno-title-wrap strong { font-size: 15px; letter-spacing: .06em; }
.uno-title-wrap small { color: var(--uno-muted); font-size: 10px; }
.uno-title-mark { position: relative; width: 30px; height: 30px; color: #777168; }
.uno-title-mark i { top: 5px; background: var(--uno-paper); }
.uno-window-actions { display: flex; gap: 4px; }
.uno-window-actions button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--uno-muted);
    font-size: 20px;
    line-height: 1;
}
.uno-window-actions button:hover { background: rgba(102, 91, 76, .08); }
.uno-body { padding: 12px 14px 14px; touch-action: auto; }
.uno-opponent { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 4px; }
.uno-opponent > span { font-size: 12px; font-weight: 650; }
.uno-opponent-cards { position: relative; width: 55px; height: 35px; }
.uno-opponent-cards i {
    position: absolute;
    top: 0;
    width: 23px;
    height: 34px;
    border: 2px solid #f2ede4;
    border-radius: 5px;
    background: #57534d;
    box-shadow: 0 2px 4px rgba(45, 39, 32, .18);
}
.uno-opponent-cards i:first-child { left: 8px; transform: rotate(-8deg); }
.uno-opponent-cards i:nth-child(2) { left: 20px; transform: rotate(7deg); }
.uno-opponent-cards b {
    position: absolute;
    right: 0;
    bottom: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    color: #fff;
    background: #8a8176;
    font-size: 9px;
    line-height: 18px;
    text-align: center;
}
.uno-table {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    min-height: 145px;
    margin: 7px 0;
    border: 1px solid rgba(95, 113, 91, .12);
    border-radius: 17px;
    background: linear-gradient(145deg, rgba(102, 132, 99, .12), rgba(156, 140, 105, .07));
}
.uno-pile { width: 63px; height: 94px; border-radius: 9px; }
.uno-draw-pile {
    position: relative;
    border: 3px solid #ebe5dc;
    color: #fff;
    background: #4d4a46;
    box-shadow: -4px 3px 0 #777067, -7px 5px 0 #dad3c8, 0 6px 14px rgba(55, 47, 39, .2);
}
.uno-draw-pile:disabled { opacity: .56; }
.uno-draw-pile span,
.uno-mini-card,
.uno-result-mark {
    display: grid;
    place-items: center;
    font-weight: 800;
    font-style: italic;
    letter-spacing: -.08em;
    transform: rotate(-17deg);
}
.uno-draw-pile span { position: absolute; inset: 17px 7px; border-radius: 50%; background: #b95a50; font-size: 14px; }
.uno-discard { position: relative; }
.uno-card {
    --card-color: #74706a;
    position: relative;
    flex: 0 0 auto;
    width: 54px;
    height: 81px;
    padding: 0;
    border: 3px solid #f5f0e8;
    border-radius: 8px;
    color: #fff;
    background: var(--card-color);
    box-shadow: 0 3px 8px rgba(52, 44, 36, .18);
    overflow: hidden;
    transition: transform .16s ease, opacity .16s ease;
}
.uno-pile .uno-card { width: 63px; height: 94px; border-radius: 9px; }
.uno-card::before {
    content: '';
    position: absolute;
    inset: 13% 17%;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    transform: rotate(24deg);
}
.uno-card::after {
    content: attr(data-label);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--card-color);
    font-size: 25px;
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255,255,255,.45);
}
.uno-card[data-color="red"] { --card-color: var(--uno-red); }
.uno-card[data-color="yellow"] { --card-color: var(--uno-yellow); }
.uno-card[data-color="green"] { --card-color: var(--uno-green); }
.uno-card[data-color="blue"] { --card-color: var(--uno-blue); }
.uno-card[data-color="wild"] { --card-color: #56514b; }
.uno-card[data-value="wild"]::after { content: '◆'; background: conic-gradient(var(--uno-red) 0 25%, var(--uno-yellow) 0 50%, var(--uno-green) 0 75%, var(--uno-blue) 0); background-clip: text; -webkit-background-clip: text; color: transparent; }
.uno-card[data-value="wild4"]::after { content: '+4'; font-size: 19px; background: conic-gradient(var(--uno-red) 0 25%, var(--uno-yellow) 0 50%, var(--uno-green) 0 75%, var(--uno-blue) 0); background-clip: text; -webkit-background-clip: text; color: transparent; }
.uno-card[data-value="reverse"]::after { font-size: 29px; }
.uno-card-playable { cursor: pointer; }
.uno-hand .uno-card-playable:hover { transform: translateY(-7px) rotate(-1deg); }
.uno-hand .uno-card:not(.uno-card-playable) { opacity: .52; filter: saturate(.65); }
.uno-card.is-drawn { box-shadow: 0 0 0 2px var(--uno-paper), 0 0 0 4px rgba(93, 126, 94, .5); }
.uno-turn { min-height: 19px; margin: 8px 0 6px; color: var(--uno-ink); font-size: 12px; font-weight: 650; text-align: center; }
.uno-hand {
    display: flex;
    align-items: flex-end;
    min-height: 91px;
    padding: 7px 6px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    touch-action: pan-x;
}
.uno-hand .uno-card + .uno-card { margin-left: -12px; }
.uno-hand .uno-card:focus-visible { z-index: 3; outline: 2px solid rgba(72, 94, 79, .6); outline-offset: 1px; }
.uno-empty-hand { margin: auto; color: var(--uno-muted); font-size: 11px; }
.uno-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.uno-actions button,
.uno-dialog button {
    min-height: 36px;
    border: 1px solid var(--uno-line);
    border-radius: 11px;
    color: #716a60;
    background: rgba(255,255,255,.45);
    font-size: 12px;
}
.uno-actions button:disabled { opacity: .38; }
.uno-primary { color: #f9f6f0 !important; background: #686e63 !important; }
.uno-feedback { min-height: 15px; margin: 7px 3px 0; color: #9a7168; font-size: 10px; text-align: center; }
.uno-mini { display: none; align-items: center; gap: 9px; width: 100%; padding: 9px 13px; text-align: left; }
.uno-mini > span:last-child { display: grid; }
.uno-mini strong { font-size: 12px; }
.uno-mini small { color: var(--uno-muted); font-size: 9px; }
.uno-mini-card { width: 29px; height: 41px; border: 2px solid #eee8df; border-radius: 5px; color: #fff; background: #b95a50; font-size: 8px; box-shadow: 0 2px 5px rgba(57,47,38,.18); }
.uno-window.minimized { width: 154px; border-radius: 16px; }
.uno-window.minimized .uno-head,
.uno-window.minimized .uno-body { display: none; }
.uno-window.minimized .uno-mini { display: flex; }
.uno-window.minimized .uno-overlay { display: none; }
.uno-overlay { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 18px; background: rgba(242, 237, 228, .8); backdrop-filter: blur(8px); }
.uno-overlay[hidden] { display: none; }
.uno-dialog { width: min(275px, 92%); padding: 23px 20px 18px; border: 1px solid var(--uno-line); border-radius: 18px; background: #fbf8f2; box-shadow: 0 14px 38px rgba(64, 54, 43, .16); text-align: center; }
.uno-dialog > strong { display: block; margin-bottom: 15px; font-size: 15px; }
.uno-first-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; padding: 4px; border-radius: 12px; background: #eee9e0; }
.uno-first-options button { min-height: 33px; border: 0; background: transparent; }
.uno-first-options button[aria-checked="true"] { color: #565149; background: #fffdf9; box-shadow: 0 2px 7px rgba(62,53,44,.1); font-weight: 650; }
.uno-setup-card > .uno-primary { width: 100%; }
.uno-dialog-cancel { width: 100%; margin-top: 7px; border: 0 !important; background: transparent !important; }
.uno-colors { display: grid; grid-template-columns: repeat(4, 42px); justify-content: center; gap: 9px; }
.uno-colors button { width: 42px; min-height: 50px; border: 3px solid #f3eee6; box-shadow: 0 3px 7px rgba(50,43,36,.15); }
.uno-colors button[data-uno-color="red"] { background: var(--uno-red); }
.uno-colors button[data-uno-color="yellow"] { background: var(--uno-yellow); }
.uno-colors button[data-uno-color="green"] { background: var(--uno-green); }
.uno-colors button[data-uno-color="blue"] { background: var(--uno-blue); }
.uno-result-mark { width: 51px; height: 70px; margin: 0 auto 12px; border: 3px solid #f1ebe2; border-radius: 8px; color: #fff; background: #b95a50; font-size: 13px; box-shadow: 0 4px 10px rgba(55,46,37,.17); }
.uno-result-card h2 { margin: 0; font-size: 20px; }
.uno-result-card p { margin: 7px 0 14px; color: var(--uno-muted); font-size: 11px; }
.uno-record { padding: 9px; border-radius: 10px; color: #81796f; background: #f0ebe2; font-size: 11px; }
.uno-result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }

[data-theme="dark"] .uno-window,
body.dark .uno-window {
    --uno-paper: #302e2b;
    --uno-ink: #e7e0d6;
    --uno-muted: #aaa197;
    --uno-line: rgba(255,255,255,.1);
    background: rgba(48,46,43,.96);
    box-shadow: 0 20px 55px rgba(0,0,0,.4);
}
[data-theme="dark"] .uno-title-mark i,
body.dark .uno-title-mark i { background: #302e2b; }
[data-theme="dark"] .uno-dialog,
body.dark .uno-dialog { background: #383530; }
[data-theme="dark"] .uno-overlay,
body.dark .uno-overlay { background: rgba(38,36,33,.84); }
[data-theme="dark"] .uno-first-options,
body.dark .uno-first-options { background: #2b2926; }
[data-theme="dark"] .uno-first-options button[aria-checked="true"],
body.dark .uno-first-options button[aria-checked="true"] { color: #eee7dd; background: #4a4640; }
[data-theme="dark"] .uno-actions button,
body.dark .uno-actions button,
[data-theme="dark"] .uno-dialog button,
body.dark .uno-dialog button { color: #d8d0c5; background: rgba(255,255,255,.05); }
[data-theme="dark"] .uno-record,
body.dark .uno-record { color: #c3b9ac; background: #2e2b28; }

@keyframes uno-deal { from { opacity: 0; transform: translateY(-14px) scale(.85); } }
.uno-hand .uno-card { animation: uno-deal .22s ease both; }

@media (max-width: 540px) {
    .uno-window { top: max(60px, env(safe-area-inset-top)); right: 12px; width: calc(100vw - 24px); }
    .uno-body { padding: 10px 11px 12px; }
    .uno-table { min-height: 125px; }
    .uno-pile { width: 56px; height: 84px; }
    .uno-pile .uno-card { width: 56px; height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
    .uno-card { animation: none !important; transition: none; }
}
