/* Page layout around the InOut UI-kit components (web/kit/src/main.jsx):
   the bet panel along the bottom, the menu top right, the loader, and the few
   pieces the kit has no component for (connection indicator, toast, rotate
   screen). The kit's own styles come with its components. */

/* the kit's typeface, Roboto Flex (variable, weights 100–1000: the kit's
   400–700 and the game's captions at 900), with the subsets and unicode ranges
   of Google Fonts, served with the game; other scripts use the device's fonts */
@font-face { font-family: "Roboto Flex"; font-style: normal; font-weight: 100 1000; font-display: block; src: url("ui/fonts/RobotoFlex-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Roboto Flex"; font-style: normal; font-weight: 100 1000; font-display: block; src: url("ui/fonts/RobotoFlex-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Roboto Flex"; font-style: normal; font-weight: 100 1000; font-display: block; src: url("ui/fonts/RobotoFlex-greek.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Roboto Flex"; font-style: normal; font-weight: 100 1000; font-display: block; src: url("ui/fonts/RobotoFlex-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Roboto Flex"; font-style: normal; font-weight: 100 1000; font-display: block; src: url("ui/fonts/RobotoFlex-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto Flex"; font-style: normal; font-weight: 100 1000; font-display: block; src: url("ui/fonts/RobotoFlex-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

#io {
	position: fixed;
	inset: 0;
	z-index: 5;
	pointer-events: none;
	font-family: "Roboto Flex", Arial, sans-serif;
	color: #fff;
	-webkit-user-select: none;
	user-select: none;
}
#io .io-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding-bottom: max(8px, env(safe-area-inset-bottom));
	pointer-events: auto;
	transition: opacity 0.3s ease;
}
/* phones: the kit's round Play button reaches below its panel */
@media (max-aspect-ratio: 1.1) { #io .io-bar { padding-bottom: max(14px, env(safe-area-inset-bottom)); } }
#io .io-menu {
	position: absolute;
	top: max(12px, env(safe-area-inset-top));
	right: max(12px, env(safe-area-inset-right));
	z-index: 20;
	pointer-events: auto;
	transition: opacity 0.3s ease;
}
/* the kit's dialogs sit in #io, whose empty area lets clicks through to the game */
#io dialog { pointer-events: auto; }
#io .io-menu-icon { display: flex; align-items: center; justify-content: center; }
#io .io-menu-icon svg { display: block; }
/* right-to-left languages (Arabic, Persian, Urdu): the dialogs and the menu
   read from the right; the bet panel keeps its drawn shape */
.io-rtl #io dialog, .io-rtl #io .ioui-menu__panel { direction: rtl; }
/* …while each text keeps its own direction ("0.10 USD" stays in that order) */
.io-rtl #io dialog *, .io-rtl #io .ioui-menu__panel * { unicode-bidi: plaintext; }
/* …and lines up on the right like the rest (what the kit centres stays centred) */
:where(.io-rtl #io dialog, .io-rtl #io .ioui-menu__panel) :where(:not(button, button *, input)) { text-align: right; }
/* How to play is running text of the language (a line may begin with BET or
   Play, the level rows with EASY…): the dialog's direction orders it */
.io-rtl #io .io-htp, .io-rtl #io .io-htp * { unicode-bidi: normal; }
.io-rtl #io .ioui-bet-panel p { unicode-bidi: plaintext; text-align: left; }

/* the kit's avatar picker needs 296 px for a row of four: on narrow phones the
   avatars get a little smaller instead of the row being cut at the right */
#io .ioui-change-avatar__item { flex: 0 1 74px; min-width: 0; height: auto; aspect-ratio: 1; }
#io .ioui-change-avatar__item > button { width: 100%; height: 100%; }
/* InOut checklist: the empty bet field reads "Enter your bet" (in every language) */
#io .ioui-bet-panel__bet-input::placeholder { color: rgba(255, 255, 255, 0.4); font-size: calc(0.52em * var(--io-ph, 1)); }

/* lost connection (Play is blocked meanwhile) */
#io .io-net {
	position: absolute;
	left: 50%;
	top: var(--io-top, 12px);          /* below the game's multiplier (main.jsx) */
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(42, 17, 22, 0.94);
	border: 1px solid rgb(229, 72, 77);
	font-size: 13px;
	font-weight: 700;
	width: max-content;
	max-width: calc(100vw - 32px);
	box-sizing: border-box;
	text-align: center;
	z-index: 25;
}
#io .io-net i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: rgb(229, 72, 77); animation: io-blink 1s ease-in-out infinite; }
@keyframes io-blink { 50% { opacity: 0.3; } }

/* short messages: errors, connection */
#io .io-toast {
	/* shown as a popover (above an open UI-kit dialog): the browser's popover
	   defaults are reset here */
	inset: auto;
	margin: 0;
	overflow: visible;
	color: #fff;
	position: fixed;
	left: 50%;
	top: var(--io-top, 16px);
	transform: translateX(-50%);
	width: max-content;
	max-width: min(calc(100vw - 32px), 520px);
	padding: 12px 18px;
	border-radius: 12px;
	background: rgb(28, 28, 33);
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: rgba(0, 0, 0, 0.4) 0 8px 24px;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 60;
	animation: io-drop 0.25s ease;
}
#io .io-toast.below { top: var(--io-net-bottom, calc(var(--io-top, 16px) + 58px)); }      /* under the connection indicator (main.jsx) */
#io .io-toast i { width: 10px; height: 10px; border-radius: 50%; background: rgb(229, 72, 77); flex: none; }
#io .io-toast.ok i { background: rgb(27, 205, 73); }
@keyframes io-drop { from { transform: translate(-50%, -12px); opacity: 0; } }      /* (a short drop: it never sweeps over the logo) */

/* phones held sideways (InOut Figma: Rotate Mobile Lock Screen) */
#io .io-rotate {
	position: absolute;
	inset: 0;
	z-index: 90;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 22px;
	background: rgba(8, 9, 12, 0.96);
	pointer-events: auto;
}
#io .io-phone { width: 46px; height: 80px; border: 4px solid rgb(255, 198, 0); border-radius: 10px; position: relative; animation: io-rot 2.2s ease-in-out infinite; }
#io .io-phone::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 12px; height: 3px; border-radius: 2px; background: rgb(255, 198, 0); transform: translateX(-50%); }
#io .io-rotate p { font-size: 18px; font-weight: 700; margin: 0; padding: 0 16px; max-width: 100%; box-sizing: border-box; text-align: center; overflow-wrap: anywhere; }
@keyframes io-rot { 0%, 20% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0deg); } }

/* the kit Loader until the game is ready, then a short fade */
#io .io-loader { position: fixed; inset: 0; z-index: 9999; pointer-events: auto; transition: opacity 0.4s ease; }
#io .io-loader.out { opacity: 0; pointer-events: none; }
#io .io-loader-error {
	position: fixed;
	left: 50%;
	bottom: 12vh;
	transform: translateX(-50%);
	z-index: 10000;
	max-width: 80vw;
	padding: 14px 18px;
	border-radius: 10px;
	background: #2a1116;
	border: 1px solid #e5484d;
	color: #f3f4f6;
	font-size: 14px;
	line-height: 1.35;
	text-align: center;
	white-space: pre-line;
}

/* touch screens have no hover: a tapped button must not keep the kit's hover look until the next tap elsewhere */
@media (hover: none) {
	.ioui-bet-panel button:hover:not(:disabled) > div::after { opacity: 0 !important; }
	.ioui-bet-panel button:hover { filter: none !important; }
}

/* ---- InOut QA round 06/11 ---- */
/* no text selection in the menu and its windows (the bet field keeps its own) */
#io dialog, #io dialog *:not(textarea), #io .io-menu, #io .io-menu * { -webkit-user-select: none !important; user-select: none !important; }
#io dialog input { pointer-events: none; }
#io dialog .ioui-input__copy { pointer-events: auto; }
/* the menu button as in InOut's games on desktop (50 px) */
@media (min-width: 769px) { #io .ioui-burger-button { width: 50px; height: 50px; padding: 9px; box-sizing: border-box; } #io .ioui-burger-button svg { width: 32px; height: 32px; } }
/* a long player name ends with … inside the menu */
#io .ioui-menu__user-nickname { display: block; min-width: 0; max-width: 118px; margin-inline-end: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#io .ioui-menu__user-change-avatar { flex: none; white-space: nowrap; }
/* the windows' scrollbar runs beside the text, never over it */
#io .ioui-popup__content { padding-inline-end: 14px; margin-inline-end: -14px; scrollbar-gutter: stable; }
/* How to play: InOut's numbered list */
#io .io-htp { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
#io .io-htp > li { display: flex; gap: 10px; align-items: flex-start; }
#io .io-htp-n { flex: none; min-width: 20px; font-weight: 700; font-size: 14px; line-height: 22px; color: #fff; }
#io .io-htp-t { flex: 1 1 auto; min-width: 0; }
#io .io-htp-t p { margin: 0; font-size: 14px; line-height: 22px; font-weight: 400; color: rgba(255, 255, 255, 0.92); overflow-wrap: anywhere; }
#io .io-htp-t ul { list-style: none; margin: 8px 0 0; padding: 0 0 0 4px; display: flex; flex-direction: column; gap: 6px; }
#io .io-htp-t ul li { font-size: 14px; line-height: 21px; color: rgba(255, 255, 255, 0.92); }
/* amounts with their currency's icon */
#io .io-amt { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#io .io-amt > svg, #io .io-amt > span:first-child { flex: none; }

/* ---- the bet history as in InOut's own games (measured on their Twist: 576 px window, 32 px in; the columns
   144 / 87 / 78 / rest / 16 px; rows of 48 px on white 10 %; the multiplier on an orange badge; a list of 220 px that
   scrolls; the green LOAD MORE). On a tall screen (portrait, aspect ≤ 0.95) the columns 64 / rest / 60 / rest / 16,
   one line of the date, rows of 46 px; at 768 px and less the window 12 px from the edges, 10 / 12 px in. */
#io dialog.ioui-popup:has(.io-hist) { width: 576px; max-width: calc(100vw - 24px); padding: 32px; border-radius: 12px; }
#io dialog.ioui-popup:has(.io-hist) .ioui-popup__header { margin-bottom: 24px; }
/* (its list scrolls by itself: the window keeps no scrollbar lane - the rows and the button 510 px as in Twist) */
#io dialog.ioui-popup:has(.io-hist) .ioui-popup__content { padding-inline-end: 0; margin-inline-end: 0; scrollbar-gutter: auto; }
#io dialog.ioui-popup:has(.io-hist) .ioui-popup__title { font-size: 18px; line-height: 27px; font-weight: 600; }
@media (max-width: 768px) {
	#io dialog.ioui-popup:has(.io-hist) { width: calc(100vw - 24px); padding: 10px 12px; }
	#io dialog.ioui-popup:has(.io-hist) .ioui-popup__header { margin-bottom: 12px; }
}
#io .io-hist { display: flex; flex-direction: column; min-width: 0; }
#io .io-hist-table { margin: 0 0 24px; min-width: 0; }
@media (max-width: 768px) { #io .io-hist-table { margin-bottom: 12px; } }
#io .io-hist-head, #io .io-hist-row { display: grid; grid-template-columns: 144px 87px 78px minmax(0, 1fr) 16px; gap: 4px; padding: 8px; align-items: center; box-sizing: border-box; }
#io .io-hist-head { font-size: 14px; line-height: 21px; font-weight: 500; letter-spacing: -0.3px; color: #c2c2c2; }
#io .io-hist-head > span { white-space: nowrap; min-width: 0; overflow: visible; }
#io .io-hist-list { height: 220px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: auto; scrollbar-color: auto; }
/* (a 4 px scrollbar inside the list: Chrome draws the webkit one only while both standard properties are auto - the
   window's colour would be inherited otherwise; the standard ones where the webkit ones are unknown) */
#io .io-hist-list::-webkit-scrollbar { width: 4px; }
#io .io-hist-list::-webkit-scrollbar-track { background: transparent; }
#io .io-hist-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 4px; }
@supports not selector(::-webkit-scrollbar) { #io .io-hist-list { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.3) transparent; } }
#io .io-hist-body { display: flex; flex-direction: column; gap: 4px; }
#io .io-hist-row { background: rgba(255, 255, 255, 0.1); border-radius: 6px; color: #fff; font-size: 12px; line-height: 16px; font-weight: 400; min-height: 48px; }
#io .io-hist-cell { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
#io .io-hist-date { font-size: 14px; line-height: 24px; font-weight: 400; gap: 0.3em; }
#io .io-hist-bet { font-size: 12px; font-weight: 600; }
#io .io-hist-win { font-size: 12px; font-weight: 600; }
#io .io-hist-row .io-amt { gap: 4px; }
#io .io-hist-row .io-amt > svg { width: 18px; height: 18px; }
#io .io-hist-dash { font-weight: 400; }
#io .io-hist-coef { width: 60px; min-width: 60px; height: 32px; border-radius: 6px; background: #ffc27d; color: #3b322b; font-size: 12px; line-height: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
#io .io-hist-fair { width: 16px; height: 16px; display: flex; cursor: pointer; }
#io .io-hist-fair svg { display: block; }
#io .io-hist-fair path { fill: #1bcd49; }
#io .io-hist-fair:focus-visible { outline: 2px solid rgba(27, 205, 73, 0.6); outline-offset: 2px; border-radius: 3px; }
@media (min-width: 400px) { #io .io-hist-bet, #io .io-hist-win { font-size: 14px; } }
@media (min-width: 1600px) {
	#io .io-hist-head, #io .io-hist-row { gap: 8px; padding: 8px 16px; }
	#io .io-hist-head { font-weight: 600; }
	#io .io-hist-row { font-size: 16px; line-height: 24px; }
	#io .io-hist-bet { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; line-height: 24px; }
	#io .io-hist-win { font-size: 16px; line-height: 24px; }
}
/* the date: time and date; on a tall screen one of them (today's bet: its time; an older one: its date) */
@media (max-aspect-ratio: 95/100) {
	#io .io-hist-head, #io .io-hist-row { grid-template-columns: 64px minmax(0, 1fr) 60px minmax(0, 1fr) 16px; }
	#io .io-hist-row { min-height: 46px; }
	#io .io-hist-coef { height: 30px; }
	#io .io-hd-date:not(.io-hd-old), #io .io-hd-time.io-hd-old { display: none; }
}
#io .io-hist-more { width: 100%; height: 50px; flex: none; border: 0; border-radius: 12px; background: #05b763; color: #fff; font-family: inherit; font-size: 16px; line-height: 18px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25)); padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#io .io-hist-more:hover { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25)) brightness(110%); }
#io .io-hist-more:active { opacity: 0.6; }
#io .io-hist-more:disabled { pointer-events: none; cursor: default; opacity: 0.3; }
/* a short screen (a phone held sideways): the window fits the height, its list scrolls */
@media (max-height: 520px) {
	#io dialog.ioui-popup:has(.io-hist) { padding: 12px 16px; }
	#io dialog.ioui-popup:has(.io-hist) .ioui-popup__header { margin-bottom: 8px; }
	#io .io-hist-table { margin-bottom: 10px; }
	#io .io-hist-list { height: max(96px, calc(100dvh - 210px)); }
	#io .io-hist-more { height: 42px; }
}
/* a hover tip inside the row (the list scrolls and would cut one above it): a shortened number shown whole over its
   cell, the shield's "Check fairness" to its left (as in InOut's games) */
#io .io-tip { position: relative; }
#io .io-tip::after { content: attr(data-tip); position: absolute; inset-inline-start: -6px; top: 50%; transform: translateY(-50%); padding: 4px 8px; border-radius: 8px; background: #1b1d21; border: 1px solid rgba(255, 255, 255, 0.1); color: #fff; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.15s, visibility 0.15s; z-index: 2; }
#io .io-tip.io-tip-left::after { inset-inline-start: auto; inset-inline-end: calc(100% + 8px); font-weight: 500; }
@media (hover: hover) { #io .io-tip:hover::after { opacity: 1; visibility: visible; } }
/* LAST WIN under the bet panel (InOut's games) */
/* LAST WIN under the panel: on a soft dark plate of its own, so the road's dashes and a passing white truck never
   cross the text (InOut's games show it on a dark band) */
#io .io-lastwin { display: flex; justify-content: center; margin-top: 14px; pointer-events: none; }
#io .io-lastwin > span { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 12px; background: rgba(18, 20, 24, 0.72); font-size: 12px; line-height: 16px; font-weight: 700; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); letter-spacing: 0.02em; white-space: nowrap; }
#io .io-lastwin b { display: inline-flex; align-items: center; color: #fff; font-weight: 700; text-transform: none; }
#io .io-lastwin .io-amt { gap: 5px; }
#io .io-lastwin .io-amt > svg { width: 14px; height: 14px; }
/* the windows' close button as in InOut's games: the cross on a round grey button */
#io .ioui-popup__close { width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgb(41, 43, 46); }
#io .ioui-popup__close svg { width: 18px; height: 18px; }
/* long hashes and seeds end in an ellipsis, not cut through a character */
#io dialog input { text-overflow: ellipsis; }
#io .io-fair-random { display: block; margin: 14px 0 8px; }
