cloze-reader / src /styles.css
milwright's picture
Add sticky control panel for mobile-friendly navigation
b48eb70
@tailwind base;
@tailwind components;
@tailwind utilities;
/* Chat functionality styles */
.typing-dots span {
animation: typing 1.5s infinite;
}
.typing-dots span:nth-child(2) {
animation-delay: 0.5s;
}
.typing-dots span:nth-child(3) {
animation-delay: 1s;
}
@keyframes typing {
0%, 60%, 100% { opacity: 0.3; }
30% { opacity: 1; }
}
.chat-button {
transition: all 0.2s ease;
border-radius: 4px;
padding: 2px 4px;
}
.chat-button:hover {
background-color: rgba(59, 130, 246, 0.1);
transform: scale(1.1);
}
/* Chat modal styling to match game font */
#chat-modal {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}
#chat-modal .bg-white {
background-color: var(--aged-paper-light);
border: 2px solid rgba(0, 0, 0, 0.1);
}
#chat-modal h3 {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
color: var(--typewriter-ink);
font-weight: 600;
}
#chat-messages {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
color: var(--typewriter-ink);
line-height: 1.6;
}
#chat-messages .text-gray-500 {
color: #666 !important;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}
.suggestion-btn, .question-btn {
transition: all 0.2s ease;
padding: 14px 18px;
background: #f8f9fa;
border: 2px solid #e9ecef;
border-radius: 8px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
font-size: 15px;
font-weight: 500;
text-align: center;
cursor: pointer;
line-height: 1.4;
min-height: 64px;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
box-sizing: border-box;
}
.suggestion-btn:hover, .question-btn:hover:not(:disabled) {
background: #e9ecef;
border-color: #6c757d;
transform: translateY(-1px);
}
.suggestion-btn:disabled, .question-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
background: #f8f9fa;
}
/* Answer revelation styles */
.revealed-answer {
background-color: #fef3c7 !important;
font-weight: bold !important;
color: #92400e !important;
border: 2px solid #f59e0b !important;
}
/* Correct and incorrect answer styles */
/* Welcome overlay styles */
.welcome-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
opacity: 0;
transition: opacity 0.3s ease;
}
.welcome-modal {
background: white;
border-radius: 12px;
padding: 24px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
max-height: 80vh;
overflow-y: auto;
}
.welcome-title {
margin: 0 0 16px 0;
color: #1f2937;
font-size: 22px;
font-weight: 600;
}
.welcome-content {
text-align: left;
color: #4b5563;
line-height: 1.4;
margin-bottom: 20px;
font-size: 14px;
}
.welcome-content p {
margin: 0 0 12px 0;
}
.welcome-overlay .typewriter-button {
background: #1f2937;
color: white;
border: 2px solid #374151;
padding: 8px 14px;
font-weight: 600;
font-size: 14px;
min-width: 100px;
min-height: 36px;
transition: all 0.2s ease;
}
.welcome-overlay .typewriter-button:hover {
background: #374151;
border-color: #4b5563;
transform: translateY(-1px);
}
.cloze-input.correct {
background-color: #dcfce7 !important;
border-color: #16a34a !important;
color: #15803d !important;
font-weight: bold !important;
}
.cloze-input.incorrect {
background-color: #fef2f2 !important;
border-color: #dc2626 !important;
color: #dc2626 !important;
font-weight: bold !important;
}
.cloze-input:disabled {
opacity: 0.8;
cursor: not-allowed;
}
/* Custom typewriter color scheme */
:root {
--aged-paper: #faf7f0;
--aged-paper-dark: #f5f1e8;
--aged-paper-light: #fefcf7;
--typewriter-ink: #2c2c2c;
--typewriter-ribbon: #8b5cf6;
--paper-shadow: rgba(0, 0, 0, 0.08);
}
@layer base {
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
background-color: var(--aged-paper);
color: var(--typewriter-ink);
line-height: 1.6;
font-size: 16px;
background-image:
radial-gradient(circle at 25% 25%, rgba(139, 92, 246, 0.02) 0%, transparent 50%),
radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.02) 0%, transparent 50%);
}
}
@layer components {
.typewriter-text {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
color: var(--typewriter-ink);
font-weight: 600;
line-height: 1.7;
}
.typewriter-subtitle {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
color: #666;
font-size: 1rem;
line-height: 1.5;
}
.paper-sheet {
background-color: var(--aged-paper-light);
border: 1px solid rgba(139, 92, 246, 0.1);
box-shadow:
0 2px 8px var(--paper-shadow),
inset 0 1px 0 rgba(255, 255, 255, 0.5);
position: relative;
}
.paper-sheet::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: repeating-linear-gradient(
to bottom,
transparent,
transparent 23px,
rgba(139, 92, 246, 0.03) 23px,
rgba(139, 92, 246, 0.03) 24px
);
pointer-events: none;
z-index: 1;
}
.paper-content {
position: relative;
z-index: 2;
}
.cloze-input {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
background-color: transparent;
border: none;
border-bottom: 2px dotted black;
color: var(--typewriter-ink);
text-align: center;
outline: none;
padding: 3px 4px;
margin: 0 1px;
min-width: 4ch;
width: auto;
font-size: inherit;
line-height: inherit;
transition: all 0.2s ease;
}
.cloze-input:focus {
border-bottom: 2px dotted black;
box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
background-color: rgba(0, 0, 0, 0.05);
}
.cloze-input.correct {
border-bottom: 2px dotted #10b981;
background-color: rgba(16, 185, 129, 0.1);
}
.cloze-input.incorrect {
border-bottom: 2px dotted #ef4444;
background-color: rgba(239, 68, 68, 0.1);
}
.cloze-input::placeholder {
color: rgba(0, 0, 0, 0.4);
font-style: normal;
font-family: monospace;
letter-spacing: 0.1em;
}
.typewriter-button {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
min-width: 100px;
min-height: 36px;
padding: 8px 14px;
background-color: var(--aged-paper-dark);
color: var(--typewriter-ink);
border: 2px solid black;
border-radius: 6px;
font-weight: 600;
font-size: 14px;
cursor: pointer;
transition: all 0.15s ease;
box-shadow:
0 3px 0 rgba(0, 0, 0, 0.3),
0 4px 8px rgba(0, 0, 0, 0.1);
position: relative;
overflow: hidden;
}
.typewriter-button:hover:not(:disabled) {
background-color: rgba(0, 0, 0, 0.05);
transform: translateY(-1px);
box-shadow:
0 4px 0 rgba(0, 0, 0, 0.3),
0 6px 12px rgba(0, 0, 0, 0.15);
}
.typewriter-button:active:not(:disabled) {
transform: translateY(2px);
box-shadow:
0 1px 0 rgba(0, 0, 0, 0.3),
0 2px 4px rgba(0, 0, 0, 0.1);
}
.typewriter-button:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: translateY(2px);
box-shadow:
0 2px 0 rgba(0, 0, 0, 0.2),
0 3px 6px rgba(0, 0, 0, 0.05);
}
.typewriter-button:focus {
outline: none;
box-shadow:
0 4px 0 rgba(0, 0, 0, 0.3),
0 6px 12px rgba(0, 0, 0, 0.1),
0 0 0 3px rgba(0, 0, 0, 0.2);
}
.prose {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
font-size: 1.125rem;
line-height: 1.7;
color: var(--typewriter-ink);
overflow-wrap: break-word;
}
.prose p {
margin-bottom: 1.5rem;
text-align: justify;
}
.biblio-info {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
font-size: 0.85rem;
color: #666;
font-style: italic;
}
.context-box {
background-color: rgba(245, 158, 11, 0.08);
border-left: 4px solid #f59e0b;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
font-size: 0.9rem;
line-height: 1.6;
}
.hints-box {
background-color: rgba(245, 158, 11, 0.08);
border-left: 4px solid #f59e0b;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
font-size: 0.9rem;
line-height: 1.6;
}
.round-badge {
background-color: rgba(245, 158, 11, 0.1);
color: #666;
border: 1px solid rgba(245, 158, 11, 0.2);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
font-weight: 600;
}
/* Ensure specific game info elements use accessible font */
#book-info, #round-info, #contextualization {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}
.loading-text {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
color: #666;
}
.result-text {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
font-weight: 600;
}
/* Responsive adjustments */
@media (max-width: 640px) {
.prose {
font-size: 1rem;
}
.typewriter-text {
font-size: 1.75rem;
}
.typewriter-subtitle {
font-size: 0.85rem;
}
.typewriter-button {
min-width: 100px;
min-height: 38px;
font-size: 0.9rem;
}
}
@media (max-width: 480px) {
.prose {
font-size: 0.95rem;
}
.typewriter-text {
font-size: 1.5rem;
}
.cloze-input {
min-width: 2.5ch;
}
}
/* Compact question buttons for chat interface */
#chat-modal .question-btn {
padding: 6px 8px;
min-height: auto;
font-size: 12px;
line-height: 1.3;
font-weight: 400;
transition: all 0.15s ease;
}
/* Mobile dropdown styling */
#question-dropdown {
background: var(--aged-paper-dark);
border: 2px solid rgba(0, 0, 0, 0.1);
border-radius: 8px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
font-size: 16px;
font-weight: 500;
color: var(--typewriter-ink);
transition: all 0.2s ease;
}
#question-dropdown:focus {
outline: none;
border-color: rgba(0, 0, 0, 0.3);
box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}
/* Sticky Control Panel */
.sticky-controls {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: var(--aged-paper-light);
border-top: 2px solid rgba(0, 0, 0, 0.1);
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
padding: 12px 16px;
z-index: 1000;
backdrop-filter: blur(8px);
}
.sticky-controls .controls-inner {
max-width: 1024px;
margin: 0 auto;
display: flex;
gap: 1px;
justify-content: center;
align-items: center;
}
.sticky-controls .typewriter-button {
flex: 1;
max-width: 200px;
min-height: 44px;
margin: 0;
border-radius: 0;
font-size: 16px;
font-weight: 600;
position: relative;
}
.sticky-controls .typewriter-button:first-child {
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
}
.sticky-controls .typewriter-button:last-child {
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
}
.sticky-controls .typewriter-button:not(:last-child) {
border-right: 1px solid rgba(0, 0, 0, 0.2);
}
.controls-divider {
height: 24px;
width: 2px;
background: rgba(0, 0, 0, 0.3);
margin: 0 -1px;
z-index: 1;
}
/* Add bottom padding to main content to prevent overlap */
#game-container {
padding-bottom: 100px;
}
/* Mobile optimizations for sticky controls */
@media (max-width: 640px) {
.sticky-controls {
padding: 10px 12px;
}
.sticky-controls .typewriter-button {
min-height: 48px;
font-size: 16px;
padding: 12px 8px;
}
#game-container {
padding-bottom: 90px;
}
}
/* Ensure controls stay above mobile keyboards */
@media (max-width: 640px) and (max-height: 500px) {
.sticky-controls {
position: fixed;
bottom: 0;
}
}
/* Print styles */
@media print {
body {
background: white;
color: black;
}
.paper-sheet::before {
display: none;
}
.typewriter-button {
display: none;
}
.sticky-controls {
display: none;
}
#game-container {
padding-bottom: 0;
}
}
}
/* Custom utility classes */
@layer utilities {
.ink-ribbon-lines {
background: repeating-linear-gradient(
to bottom,
transparent,
transparent 23px,
rgba(139, 92, 246, 0.03) 23px,
rgba(139, 92, 246, 0.03) 24px
);
}
}