/* Online play with a friend (js/online-room.js), shared by Dame, Moară, Reversi, 4 în linie and X și 0.
   Each page hands its own colours to the panel through --ol-accent / --ol-card / --ol-border / --ol-muted on the mount. */
.ol-panel {
    --ol-accent-c: var(--ol-accent, #2563eb);
    --ol-card-c: var(--ol-card, #ffffff);
    --ol-border-c: var(--ol-border, #e5e7eb);
    --ol-muted-c: var(--ol-muted, #6b7280);
    margin: 0 0 10px;
    text-align: left;
}
body.dark-theme .ol-panel {
    --ol-card-c: var(--ol-card, #1f2937);
    --ol-border-c: var(--ol-border, #374151);
    --ol-muted-c: var(--ol-muted, #9ca3af);
}
/* while online the local-only controls (modes, levels, undo, new game, local score) step aside */
body.ol-on [data-ol-local] { display: none !important; }

.ol-open {
    width: 100%; min-height: 52px; padding: 6px 12px; border-radius: 14px;
    border: 1.5px dashed var(--ol-accent-c); background: var(--ol-card-c); color: var(--ol-accent-c);
    font-weight: 700; font-size: .95rem; line-height: 1.2; display: flex; align-items: center; justify-content: center; gap: 10px;
    cursor: pointer; touch-action: manipulation; text-align: left;
}
.ol-open small { display: block; font-weight: 500; font-size: .76rem; color: var(--ol-muted-c); }
.ol-open:hover { border-style: solid; }
.ol-open-ic { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ol-accent-c); color: #fff; flex: none; }
body.dark-theme .ol-open-ic { color: #0b1220; }
.ol-open[hidden], .ol-card[hidden] { display: none; }

.ol-card {
    border-radius: 16px; border: 1px solid var(--ol-border-c); background: var(--ol-card-c);
    padding: 12px 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}
.ol-lead { margin: 0 0 10px; color: var(--ol-muted-c); font-size: .92rem; line-height: 1.45; }
.ol-head { margin: 0 0 4px; font-size: 1.05rem; }
.ol-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; color: var(--ol-accent-c); white-space: nowrap; }
.ol-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.ol-row:first-child { margin-top: 0; }
.ol-btn {
    min-height: 44px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--ol-border-c);
    background: transparent; color: inherit; font-weight: 700; font-size: .92rem;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; touch-action: manipulation;
}
.ol-btn:hover { border-color: var(--ol-accent-c); }
.ol-btn.ol-primary { background: var(--ol-accent-c); border-color: var(--ol-accent-c); color: #fff; flex: 1 1 auto; }
body.dark-theme .ol-btn.ol-primary { color: #0b1220; }
.ol-btn.ol-ghost { color: var(--ol-muted-c); }
.ol-btn:focus-visible, .ol-open:focus-visible, .ol-join input:focus-visible, .ol-link:focus-visible { outline: 2px solid var(--ol-accent-c); outline-offset: 2px; }

.ol-join { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--ol-border-c); }
.ol-join label { display: block; font-size: .85rem; font-weight: 600; color: var(--ol-muted-c); margin: 0 0 5px; }
.ol-join-row { display: flex; gap: 8px; }
.ol-join input, .ol-link {
    flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 6px 10px; border-radius: 10px;
    border: 1px solid var(--ol-border-c); background: transparent; color: inherit; font-size: 1rem;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.ol-join input { text-transform: uppercase; }
.ol-link { width: 100%; font-size: .85rem; color: var(--ol-muted-c); }

.ol-side { margin: 10px 0 0; font-size: .95rem; }
.ol-swatch {
    display: inline-block; width: .95em; height: .95em; border-radius: 50%; vertical-align: -.12em; margin: 0 .3em 0 .1em;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .3);
}
.ol-wait { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-weight: 600; color: var(--ol-muted-c); }
.ol-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--ol-border-c); border-top-color: var(--ol-accent-c); animation: ol-spin .9s linear infinite; flex: none; }
@keyframes ol-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ol-spin { animation-duration: 3s; } }

.ol-bar { display: flex; align-items: center; gap: 10px; }
.ol-bar-text { flex: 1 1 auto; min-width: 0; font-size: .9rem; line-height: 1.35; }
.ol-pres { width: 12px; height: 12px; border-radius: 50%; flex: none; background: #9ca3af; }
.ol-pres.is-on { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .2); }
.ol-pres.is-off { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .2); }
.ol-pres.is-wait { background: #d97706; }
.ol-leave { flex: none; min-height: 40px; padding: 4px 10px; }
.ol-note { margin: 8px 0 0; font-size: .92rem; font-weight: 600; color: var(--ol-muted-c); }

.ol-msg { min-height: 0; margin: 6px 2px 0; font-size: .9rem; font-weight: 600; color: var(--ol-muted-c); text-align: center; }
.ol-msg:empty { margin: 0; }
.ol-msg.is-alert, .ol-note.is-alert { color: #b45309; }
body.dark-theme .ol-msg.is-alert, body.dark-theme .ol-note.is-alert { color: #fbbf24; }

@media (max-width: 400px) {
    .ol-card { padding: 10px 11px; }
    .ol-bar { flex-wrap: wrap; }
    .ol-bar-text { flex-basis: calc(100% - 22px); }
    .ol-leave { margin-left: auto; }
}
