/* Telegram Mini App Design System */ :root { /* Telegram theme colors */ --tg-color-bg: var(--tg-theme-bg-color, #ffffff); --tg-color-secondary-bg: var(--tg-theme-secondary-bg-color, #f1f1f1); --tg-color-section-bg: var(--tg-theme-section-bg-color, #ffffff); --tg-color-text: var(--tg-theme-text-color, #000000); --tg-color-hint: var(--tg-theme-hint-color, #999999); --tg-color-link: var(--tg-theme-link-color, #007aff); --tg-color-button: var(--tg-theme-button-color, #007aff); --tg-color-button-text: var(--tg-theme-button-text-color, #ffffff); --tg-color-destructive: var(--tg-theme-destructive-text-color, #ff3b30); /* Telegram dimensions */ --tg-border-radius: 12px; --tg-border-radius-small: 8px; --tg-spacing-xs: 4px; --tg-spacing-sm: 8px; --tg-spacing-md: 12px; --tg-spacing-lg: 16px; --tg-spacing-xl: 20px; --tg-spacing-xxl: 24px; /* Typography */ --tg-font-size-xs: 12px; --tg-font-size-sm: 14px; --tg-font-size-md: 16px; --tg-font-size-lg: 17px; --tg-font-size-xl: 20px; --tg-font-size-xxl: 28px; --tg-line-height-tight: 1.2; --tg-line-height-normal: 1.4; --tg-line-height-relaxed: 1.6; } * { margin: 0; padding: 0; box-sizing: border-box; } html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body { background: var(--tg-color-bg); color: var(--tg-color-text); font-size: var(--tg-font-size-md); line-height: var(--tg-line-height-normal); overflow-x: hidden; } /* Root container */ .tg-root { min-height: 100vh; display: flex; flex-direction: column; } /* Content area */ .tg-content { flex: 1; padding: var(--tg-spacing-lg); padding-bottom: 100px; display: flex; flex-direction: column; gap: var(--tg-spacing-xl); } /* Form components */ .tg-form { position: fixed; bottom: 0; left: 0; right: 0; padding: var(--tg-spacing-lg); background: var(--tg-color-bg); border-top: 1px solid var(--tg-color-secondary-bg); z-index: 100; } .tg-input-wrapper { position: relative; } .tg-input { width: 100%; height: 48px; padding: 0 var(--tg-spacing-lg); background: var(--tg-color-section-bg); border: 2px solid var(--tg-color-secondary-bg); border-radius: var(--tg-border-radius); font-size: var(--tg-font-size-lg); color: var(--tg-color-text); transition: all 0.2s ease; outline: none; } .tg-input::placeholder { color: var(--tg-color-hint); } .tg-input:focus { border-color: var(--tg-color-button); background: var(--tg-color-bg); } /* Button components */ .tg-button { position: relative; display: flex; align-items: center; justify-content: center; gap: var(--tg-spacing-sm); border: none; border-radius: var(--tg-border-radius); font-family: inherit; font-weight: 500; cursor: pointer; transition: all 0.2s ease; outline: none; user-select: none; -webkit-tap-highlight-color: transparent; } .tg-button--primary { background: var(--tg-color-button); color: var(--tg-color-button-text); } .tg-button--large { height: 48px; padding: 0 var(--tg-spacing-xl); font-size: var(--tg-font-size-lg); } .tg-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3); } .tg-button:active:not(:disabled) { transform: translateY(0); } .tg-button:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; } .tg-button__text { display: flex; align-items: center; gap: var(--tg-spacing-xs); } /* Placeholder component */ .tg-placeholder { text-align: center; padding: var(--tg-spacing-xxl) var(--tg-spacing-lg); max-width: 300px; margin: 0 auto; } .tg-placeholder__icon { font-size: 48px; margin-bottom: var(--tg-spacing-lg); opacity: 0.6; } .tg-placeholder__title { font-size: var(--tg-font-size-xl); font-weight: 600; color: var(--tg-color-text); margin-bottom: var(--tg-spacing-sm); } .tg-placeholder__description { font-size: var(--tg-font-size-sm); color: var(--tg-color-hint); line-height: var(--tg-line-height-relaxed); } .tg-placeholder--secondary { opacity: 0.8; } /* Spinner component */ .tg-spinner { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; padding: var(--tg-spacing-xxl); display: none; z-index: 10; } .tg-spinner.tg-spinner--visible { display: block; } .tg-spinner__icon { width: 32px; height: 32px; border: 2px solid var(--tg-color-secondary-bg); border-top: 2px solid var(--tg-color-button); border-radius: 50%; margin: 0 auto var(--tg-spacing-lg); animation: tg-spin 1s linear infinite; } .tg-spinner__text { font-size: var(--tg-font-size-sm); color: var(--tg-color-hint); } @keyframes tg-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* List component */ .tg-list { display: none; flex-direction: column; gap: var(--tg-spacing-xs); } .tg-list.tg-list--visible { display: flex; } .tg-list-item { background: var(--tg-color-section-bg); border-radius: var(--tg-border-radius); overflow: hidden; transition: all 0.2s ease; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; position: relative; } /* Hover effects for desktop */ @media (hover: hover) and (pointer: fine) { .tg-list-item:hover { background: var(--tg-color-secondary-bg); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); } } /* Touch feedback for mobile - brief highlight only */ .tg-list-item:active { transform: translateY(0); background: var(--tg-color-secondary-bg); } /* Prevent sticky hover states on touch devices */ @media (hover: none) { .tg-list-item:hover { background: var(--tg-color-section-bg); transform: none; box-shadow: none; } } .tg-list-item__content { display: flex; align-items: center; gap: var(--tg-spacing-md); padding: var(--tg-spacing-md); } .tg-list-item__media { position: relative; flex-shrink: 0; } .tg-list-item__thumbnail { width: 80px; height: 60px; object-fit: cover; border-radius: var(--tg-border-radius-small); background: var(--tg-color-secondary-bg); image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; image-rendering: optimizeQuality; } .tg-list-item__duration { position: absolute; bottom: 2px; right: 2px; background: rgba(0, 0, 0, 0.8); color: white; font-size: var(--tg-font-size-xs); padding: 2px 4px; border-radius: 4px; font-weight: 500; } .tg-list-item__info { flex: 1; min-width: 0; } .tg-list-item__title { font-size: var(--tg-font-size-md); font-weight: 500; color: var(--tg-color-text); line-height: var(--tg-line-height-tight); margin-bottom: var(--tg-spacing-xs); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .tg-list-item__subtitle { font-size: var(--tg-font-size-sm); color: var(--tg-color-hint); line-height: var(--tg-line-height-tight); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* Converting state */ .tg-list-item--converting { opacity: 0.6; pointer-events: none; } .tg-list-item--converting::after { content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 20px; height: 20px; border: 2px solid var(--tg-color-secondary-bg); border-top: 2px solid var(--tg-color-button); border-radius: 50%; animation: tg-spin 1s linear infinite; } /* Status message */ .tg-status-message { position: fixed; top: 20px; left: var(--tg-spacing-lg); right: var(--tg-spacing-lg); z-index: 1000; padding: var(--tg-spacing-md) var(--tg-spacing-lg); border-radius: var(--tg-border-radius); font-size: var(--tg-font-size-sm); font-weight: 500; animation: tg-slide-down 0.3s ease-out; display: flex; align-items: center; gap: var(--tg-spacing-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15); } .tg-status-message--success { background: #34c759; border: 1px solid #2aa854; color: #ffffff; } .tg-status-message--error { background: #ff3b30; border: 1px solid #d70015; color: #ffffff; } .tg-status-message--info { background: #007aff; border: 1px solid #0056cc; color: #ffffff; } @keyframes tg-slide-down { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } } /* Utility classes */ .tg-hidden { display: none !important; } .tg-visible { display: block !important; } /* Responsive design */ @media (max-width: 768px) and (min-width: 481px) { .tg-list-item__thumbnail { width: 100px; height: 100px; } .tg-list-item__title { font-size: var(--tg-font-size-sm); } } @media (max-width: 480px) { .tg-content { padding: var(--tg-spacing-md); } .tg-navigation { padding: var(--tg-spacing-md); } .tg-list { grid-template-columns: 1fr; gap: var(--tg-spacing-sm); } .tg-list-item__content { flex-direction: row; text-align: left; padding: var(--tg-spacing-sm); } .tg-list-item__media { margin-bottom: 0; margin-right: var(--tg-spacing-sm); flex-shrink: 0; } .tg-list-item__thumbnail { width: 60px; height: 60px; } .tg-list-item__info { flex: 1; min-width: 0; } .tg-list-item__title { text-align: left; font-size: var(--tg-font-size-sm); -webkit-line-clamp: 1; } .tg-list-item__subtitle { text-align: left; } } /* Dark theme support */ @media (prefers-color-scheme: dark) { :root { --tg-color-bg: var(--tg-theme-bg-color, #000000); --tg-color-secondary-bg: var(--tg-theme-secondary-bg-color, #1c1c1e); --tg-color-section-bg: var(--tg-theme-section-bg-color, #1c1c1e); --tg-color-text: var(--tg-theme-text-color, #ffffff); --tg-color-hint: var(--tg-theme-hint-color, #8e8e93); } }