.gr-background {
	background-image: url('../images/black-lozenge.png');
	background-repeat: repeat;
	background-size: auto;
	background-color: var(--background-color);
}

#goBackBtn {
	border: none;
	background-color: transparent;
}

.gr-text {
	color: var(--gr-text-color-light);
}

.gr-text svg {
	stroke: var(--gr-text-color-light);
}

.gr-border {
	border-color: var(--gr-background-color-dark);
}

.gr-rules-container {
	display: flex;
	flex-direction: column;
	padding: 1rem;
	gap: 1rem;
	align-items: center;
	justify-content: center;
}

.gr-rule-tab {
	display: flex;
	flex-direction: column;
	width: 100%;
}

.gr-rule-title {
	display: flex;
	border: 1px solid var(--gr-border-color);
	padding: 1rem;
	background-color: var(--gr-background-color-dark);
	color: var(--gr-text-color-light);
	font-weight: bold;
	font-size: clamp(1rem, 5.5vw, 1.75rem);
	border-top-left-radius: 5px;
	border-top-right-radius: 5px;
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
}

.gr-rule-content {
	display: none;
	border-bottom: 1px solid var(--gr-border-color);
	border-right: 1px solid var(--gr-border-color);
	border-left: 1px solid var(--gr-border-color);
	padding: 1rem;
	flex-direction: column;
	gap: 0.5rem;
	background-color: var(--gr-background-color-light);
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
}

.gr-rule-content.active {
	display: flex;
}

.gr-rule-content span {
	display: flex;
	color: var(--gr-text-color-dark);
	font-size: clamp(0.8rem, 5vw, 1.5rem);
}

ul.gr-list {
	list-style-type: disc;
	list-style-position: inside;
	margin: 0;
	padding: 0;
	padding-left: 1.5rem;
}
ul.gr-list li, li::marker {
	color: var(--gr-text-color-dark);
	font-size: clamp(0.8rem, 5vw, 1.5rem);
}

.gr-pyramid-container {
	display: flex;
	justify-content: center;
}

.gr-pyramid-container .pe-pyramid-button {
	width: 22vw;
	height: 22vw;
	margin: -3vw -2vw;
}

.gr-pyramid-line-example {
	gap: 1rem;
	padding: 1rem;
}
.gr-pyramid-line-example .pe-pyramid-button {
	width: 16vw;
	height: 16vw;
}

.gr-span-example {
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gr-example-container {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	padding: 0 2rem;
}

.gr-example-line {
	display: flex;
	width: 100%;
	justify-content: space-between;
}

.gr-example-line-center {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.25rem;
}

.gr-example-line-around {
	display: flex;
	justify-content: space-around;
	align-items: center;
}

.gr-hi-lo-card-num, .gr-hi-lo-card-ope {
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: clamp(0.8rem, 5vw, 5rem);
	width: 6vw;
	height: 10vw;
	border-radius: 1vw;
	background-color: var(--gr-hi-lo-card-background-color);
	border: 1px solid black;
}

.gr-hi-lo-card-num {
	color: var(--gr-hi-lo-num-color);
	font-family: American Typewriter;
	font-weight: bold;
}

.gr-hi-lo-card-ope {
	color: var(--gr-hi-lo-ope-color);
	font-weight: lighter;
}

.gr-hi-lo-result {
	display: flex;
	color: var(--gr-hi-lo-res-color);
	font-family: American Typewriter;
	font-weight: bold;
	font-size: clamp(0.8rem, 5vw, 5rem);
}

.gr-hi-lo-result-difference {
	display: flex;
	color: red;
	font-family: American Typewriter;
	font-size: clamp(0.8rem, 3vw, 3.5rem);
	padding-left: 1rem;
}

.gr-hi-lo-result-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-top: 1rem;
}

.gr-hi-lo-hi-square {
	display: flex;
	align-items: center;
	justify-content: center;
	transform: rotate(45deg);
	background-color: black;
	width: clamp(0.8rem, 10vw, 4.5rem);
	height: clamp(0.8rem, 10vw, 4.5rem);
	border-radius: 1vw;
}

.gr-hi-lo-hi-square span {
	transform: rotate(-45deg);
	color: white;
	font-family: American Typewriter;
	font-size: clamp(0.8rem, 7vw, 3.5rem);
	font-weight: bold;
}

.gr-hi-lo-lo-circle {
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: white;
	color: black;
	font-family: American Typewriter;
	font-size: clamp(0.8rem, 7vw, 3.5rem);
	font-weight: bold;
	border: 1px solid black;
	width: clamp(0.8rem, 10vw, 4.5rem);
	height: clamp(0.8rem, 10vw, 4.5rem);
	margin-bottom: -0.5rem;
	border-radius: 5vw;
}

.gr-hi-lo-card-selected {
	background-color: var(--gr-hi-lo-card-selected-background-color);
	border: 2px solid var(--gr-hi-lo-card-selected-border-color);
}

.gr-rr-board-container {
	display: flex;
	align-items: center;
	justify-content: center;
}

.gr-rr-board {
	display: grid;
	grid-template-columns: repeat(6, 10vw);
	grid-template-rows: repeat(6, 10vw);
	gap: 0;
	background: #ccc; /* background outside board */
	width: fit-content;
}

.gr-rr-cell {
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	color: black;
	border: 1px solid black;
}

/* Colors */
.gr-rr-red    { background: var(--gr-rr-red-color); }
.gr-rr-green  { background: var(--gr-rr-green-color); }
.gr-rr-blue   { background: var(--gr-rr-blue-color); }
.gr-rr-yellow { background: var(--gr-rr-yellow-color); }
.gr-rr-purple { background: var(--gr-rr-purple-color); }
.gr-rr-center { background: var(--gr-rr-center-color); }
.gr-rr-black  {	
	background: var(--gr-rr-black-color);
	font-size: clamp(0.25rem, 1vw, 1.5rem);
	color: white;
}

/* Example: icons (replace with real <img> if needed) */
.gr-rr-admin { font-size: 8vw; }

.gr-rr-btn-display-rules {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 0.5rem;
	background-color: transparent;
	font-weight: bold;
	font-size: clamp(1rem, 3.5vw, 1.75rem);
	border: none;
	cursor: pointer;
}

.gr-rr-rules-overlay {
	z-index: 2;
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	overflow-y: auto;
	overflow-x: hidden;
	flex-direction: column;
	-webkit-overflow-scrolling: touch;
	touch-action: auto;
	padding: 1rem;
	box-sizing: border-box;
	justify-content: center;
	align-items: center;
}

.gr-rr-rules-container {
	display: flex;
	flex-direction: column;
	padding: 0.5rem;
	overflow-y: auto; /* allow vertical scrolling for content */
	gap: 0.75rem;
	width: 100%;
}

.gr-rr-rules-tab {
	display: flex;
	flex-direction: column;
	padding: 0.5rem;
	background-color: var(--gr-rr-center-color);
	border: 2px solid var(--gr-border-color);
	border-radius: 3px;
}

.gr-rr-group-title {
	display: flex;
	font-weight: bold;
	padding-bottom: 0.5rem;
	color: var(--gr-text-color-dark);
	font-size: clamp(0.75rem, 4.5vw, 2.5rem);
}

.gr-rr-group-rules {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	justify-content: center;
	align-items: center;
}

.gr-rr-rule-item {
	display: flex;
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--gr-border-color);
	border-radius: 3px;
	color: var(--gr-text-color-dark);
	font-size: clamp(0.5rem, 3.5vw, 1.75rem);
	flex-shrink: 0; /* prevent shrinking of text/items */
}

.gr-rr-note-container {
	display: flex;
	flex-direction: column;
	padding: 0.5rem;
	background-color: var(--gr-text-color-light);
	border: 2px solid var(--gr-border-color);
	border-radius: 3px;
}

.gr-rr-note-title {
	display: flex;
	font-weight: bold;
	padding-bottom: 0.5rem;
	color: var(--gr-text-color-dark);
	font-size: clamp(0.75rem, 4vw, 2.5rem);
}

.gr-rr-note-text {
	display: flex;
	color: var(--gr-text-color-dark);
	font-size: clamp(0.5rem, 3.75vw, 1.75rem);
}

.gr-rr-rule-item-block {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 0.25rem;
}

.gr-rr-rule-example-container {
	display: flex;
	gap: 0.25rem;
	justify-content: space-around;
	flex-wrap: wrap; /* allow items to wrap to the next line */
}

.gr-vg-display-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.gr-vg-display-group {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	color: var(--gr-text-color-dark);
}

.gr-vg-character-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 8vw;
	height: auto;
}

.gr-vg-display-title {
	display: flex;
	font-weight: bold;
	font-size: clamp(0.75rem, 3.5vw, 2.5rem);
}

.gr-vg-oval-display {
	display: flex;
	position: relative;
	justify-content: center;
	margin-left: -8vw;
	margin-top: -25vw;
	margin-bottom: -25vw;
	width: 80vw;   /* base width of oval */
	height: 80vw;  /* start with a circle */
	transform: scaleY(0.25); /* squash into oval */
}

.gr-vg-oval-icon {
	position: absolute;
	width: 8vw;
	height: 8vw;
	left: 50%;
	top: 50%;
	transform-origin: center center;
}
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(5)  { --angle:   0.0deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(6)  { --angle:  42.5deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(7)  { --angle:  67.5deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(8)  { --angle:  90.0deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(9)  { --angle: 112.5deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(10) { --angle: 137.5deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(11) { --angle: 180.0deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(12) { --angle: 222.5deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(1)  { --angle: 247.5deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(2)  { --angle: 270.0deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(3)  { --angle: 292.5deg; }
.gr-vg-oval-display .gr-vg-oval-icon:nth-child(4)  { --angle: 317.5deg; }

.gr-vg-oval-display .gr-vg-oval-icon {
	/* Step 1: rotate around center */
	/* Step 2: translate outward by oval "radius" */
	/* Step 3: counter-rotate to keep icon upright */
	transform:
		rotate(var(--angle))
		translateX(40vw)   /* radius */
		rotate(calc(-1 * var(--angle)))
		scaleY(4); /* fix squashed icon */
}

.gr-overlay-container {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

.gr-overlay-content {
	display: flex;
	flex-direction: column;
	background-color: var(--gr-background-color-light);
	border: 2px solid var(--gr-border-color);
	border-radius: 5px;
	padding: 1rem;
	gap: 0.5rem;
	color: var(--gr-text-color-dark);
	font-size: clamp(0.75rem, 2.5vw, 1.5rem);
}

.gr-overlay-title {
	font-weight: bold;
	font-size: clamp(1rem, 3vw, 1.75rem);
	color: var(--gr-border-color);
}

.gr-overlay-text {
	padding: 0.5rem 0;
}

.gr-overlay-input {
	padding: 0.5rem;
	border: 1px solid var(--gr-border-color);
	color: var(--gr-text-color-dark);
	border-radius: 3px;
	font-size: clamp(0.75rem, 2vw, 1.25rem);
}

.gr-overlay-btn {
	display: flex;
	justify-content: center;
	width: fit-content;
	align-items: center;
	font-weight: bold;
	background-color: var(--gr-background-color-dark);
	color: var(--gr-text-color-light);
	border: 1px solid var(--gr-border-color);
	border-radius: 3px;
	padding: 0.5rem 1rem;
	font-size: clamp(0.75rem, 3.5vw, 1.25rem);
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.gr-overlay-btn-container {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding-top: 1.5rem;
	padding-right: 1rem;
}

.gr-bc-display-container {
	display: flex;
	justify-content: space-around;
	align-items: center;
	padding: 0.5rem;
}

.gr-bc-token {
	display: flex;
	aspect-ratio: 1 / 1;
	width: 16vw;
}

.gr-bc-board-wrap {
	width: 75%;
}

.gr-bc-board {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
	padding: 5vw 0 5vw 0;
}

.gr-wt-container {
	display: flex;
	justify-content: space-evenly;
	align-items: center;
	padding: 0.5rem;
}

.gr-wt-group {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
}

.gr-wt-line {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
}

.gr-wt-letter {
	display: flex;
	color: var(--gr-wt-letter-color);
	font-weight: bold;
	font-size: clamp(1rem, 3.5vw, 1.75rem);
	border: 1px solid var(--gr-wt-tile-border-color);
	height: 5.5vw;
	aspect-ratio: 1 / 1;
	justify-content: center;
	align-items: center;
	background-image: url('../images/retina-wood.png');
	background-repeat: repeat;
	background-size: auto;
	background-color: var(--gr-wt-tile-background-color);
}

.gr-wt-letter.selected {
	border: 2px solid var(--gr-wt-tile-border-selected);
}

.gr-wt-letter.selected2 {
	border: 2px solid var(--gr-wt-tile-border-selected2);
}

.gr-wt-arrow {
	display: flex;
	width: 5vw;
	fill: var(--gr-wt-tile-border-color);
}

.gr-span-important {
	font-weight: bold;
}

.gr-span-small {
	color: var(--gr-wt-letter-color);
	font-size: clamp(0.75rem, 3vw, 1.5rem);
}

.gr-kt-secret {
	display: flex;
	color: var(--gr-wt-letter-color);
	font-size: clamp(0.75rem, 3vw, 1.5rem);
	background: none;
	border: none;
	justify-content: right;
}

.gr-kt-demo {
	background: var(--gr-kt-demo-background-color);
}

.gr-kt-card{
	border:1px solid var(--gr-text-color-dark);
	padding: 5px;
}

.gr-kt-controls{
	display:flex;
	gap:10px;
	align-items:center;
	flex-wrap:wrap;
	margin-bottom:10px;
}

.gr-kt-btn{
	appearance:none;
	border:1px solid rgba(255,255,255,0.16);
	background:rgba(255,255,255,0.06);
	color:var(--gr-text-color-light);
	padding:8px 10px;
	border-radius:4px;
	cursor:pointer;
	font-weight:600;
}

.gr-kt-btn:hover{background:rgba(255,255,255,0.10)}

.gr-kt-board{
	width:100%;
	aspect-ratio:1/1;
	border-radius:14px;
	border:1px solid rgba(255,255,255,0.12);
	background:rgba(0,0,0,0.25);
	position:relative;
	overflow:hidden;
}

.gr-kt-grid{
	position:absolute;
	inset:12px;
	display:grid;
	grid-template-columns:repeat(5,1fr);
	grid-template-rows:repeat(5,1fr);
	gap:6px;
}

.gr-kt-cell{
	position:relative;
	border-radius:10px;
	border:1px solid rgba(255,255,255,0.10);
	background:rgba(255,255,255,0.04);
	cursor:pointer;
	user-select:none;
	transition:transform .08s ease, background .2s ease, border-color .2s ease;
}

.gr-kt-cell:hover{background:rgba(255,255,255,0.07)}
.gr-kt-cell:active{transform:scale(0.97)}

.gr-kt-cell .step{
	position:absolute;
	inset:0;
	display:flex;
	align-items:center;
	justify-content:center;
	font-family:var(--mono);
	font-weight:800;
	font-size:16px;
}

.gr-kt-cell.visited{
	background:rgba(214,180,91,0.12);
	border-color:rgba(214,180,91,0.35);
}

.gr-kt-cell.current{
	background:rgba(255,218,106,0.18);
	border-color:rgba(255,218,106,0.55);
	box-shadow:0 0 0 2px rgba(255,218,106,0.18), 0 0 22px rgba(214,180,91,0.35);
}

.gr-kt-cell.candidate{
	background:rgba(124,224,141,0.14);
	border-color:rgba(124,224,141,0.45);
}

.gr-kt-cell.invalid{
	background:rgba(255,107,107,0.16);
	border-color:rgba(255,107,107,0.45);
}

.gr-kt-status{
	margin-top:8px;
	font-size:12px;
	color:var(--gr-text-color-light);
	text-align:center;
}
